Skip to content

Scrape error metric for receiver/sqlquery #39853

Open
@benjaminjb

Description

@benjaminjb

Component(s)

receiver/sqlquery

Is your feature request related to a problem? Please describe.

Moving from a non-OTel exporter to this, I found that if the receiver/sqlquery runs into an error, it doesn't have a "scrape error" metric. Should we have one?

What sqlquery does to scrape:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/internal/sqlquery/scraper.go#L78

Describe the solution you'd like

The postgres_exporter sets a gauge and exports that as a metric:

https://github.com/prometheus-community/postgres_exporter/blob/master/cmd/postgres_exporter/postgres_exporter.go#L680-L699

https://github.com/prometheus-community/postgres_exporter/blob/master/cmd/postgres_exporter/postgres_exporter.go#L542

(It is kind of open-ended: any number/type of errors gets reported as a scrape error "y/n" output, but it's useful to know if the scraping itself has run into an error)

Describe alternatives you've considered

Possibly there's something in the OTel internal metrics that should be leveraged for this sort of warning?

https://opentelemetry.io/docs/collector/internal-telemetry/

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions