Skip to content

Apply a timeout on metrics collection #27

@arnedc

Description

@arnedc

Most Prometheus clients apply a timeout on metrics collection, but this doesn't seem to be the case for the Ocaml prometheus client.
The Prometheus scrape requests even add a specific header (X-Prometheus-Scrape-Timeout-Seconds) to each scrape request defining the timeout that is used at the server-side.

However, I assume that the timeout only closes the connection when no response is received within this timeout and I guess the Prometheus client already sends back a response even when all metrics are not collected yet. Because I'm seeing scrape durations (up to 1000s) exceeding largely the scrape timeout (30s).

I'm guessing it would be a good idea to apply a timeout on metrics collection and perhaps also try to only send a response when metrics collection is finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions