Skip to content

[receiver/sqlquery] report component status on scrape and collection failures#47518

Open
vyagh wants to merge 1 commit intoopen-telemetry:mainfrom
vyagh:sqlquery-status-reporting
Open

[receiver/sqlquery] report component status on scrape and collection failures#47518
vyagh wants to merge 1 commit intoopen-telemetry:mainfrom
vyagh:sqlquery-status-reporting

Conversation

@vyagh
Copy link
Copy Markdown
Contributor

@vyagh vyagh commented Apr 10, 2026

Description

sqlqueryreceiver had no way to signal to the collector that a database connection or query was failing, it would just log errors and carry on.
This hooks into the componentstatus API so the healthcheckv2 extension can surface those failures as an unhealthy status, making the receiver's health alertable without digging through logs.

Link to tracking issue

fixes #43837

@vyagh vyagh requested review from a team, crobert-1 and dmitryax as code owners April 10, 2026 04:49
@github-actions
Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@github-actions github-actions bot added first-time contributor PRs made by new contributors receiver/sqlquery SQL query receiver labels Apr 10, 2026
@vyagh vyagh force-pushed the sqlquery-status-reporting branch from 98b1fb5 to 361c232 Compare April 10, 2026 17:12
@dmitryax
Copy link
Copy Markdown
Member

dmitryax commented Apr 10, 2026

@axw do you think it makes sense to be implemented right in the scraping controller instead?

@axw
Copy link
Copy Markdown
Contributor

axw commented Apr 13, 2026

@dmitryax hmm, not sure. That would mean that a single scrape failing implies that the component is generally unhealthy? Not sure how well that generalises.

It's also unclear to me if this PR is the right solution for the linked issue, which specifically talks about connection status. If the connection is healthy but a query fails, then should the component be marked unhealthy?

@vyagh
Copy link
Copy Markdown
Contributor Author

vyagh commented Apr 13, 2026

@axw so should i only report unhealthy when db connection itself fails, and leave query errors as just logged warnings?

@axw
Copy link
Copy Markdown
Contributor

axw commented Apr 13, 2026

@vyagh I'm not sure that's a great solution either, since it's not surfacing all the information. I think the ideal solution may involve multiple levels of status reporting: open-telemetry/opentelemetry-collector#13210

If that sounds good to @dmitryax, then I'd suggest doing it in multiple steps:

  • Start by reporting just connection-level failures for the receiver component
  • Follow up later with query-specific subcomponent reporting

@vyagh
Copy link
Copy Markdown
Contributor Author

vyagh commented Apr 13, 2026

got it, i'll wait for dmitryax's opinion :)

@vyagh vyagh force-pushed the sqlquery-status-reporting branch from 361c232 to 1316cdc Compare April 15, 2026 01:42
@vyagh
Copy link
Copy Markdown
Contributor Author

vyagh commented Apr 15, 2026

push to resolve merge conflicts

@vyagh
Copy link
Copy Markdown
Contributor Author

vyagh commented Apr 20, 2026

@dmitryax should i implement Andrew's solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors receiver/sqlquery SQL query receiver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/sqlquery] Add Connection Health Check Metric for Database Connectivity Status

4 participants