Skip to content

Surface failed metric collections to the collector #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
isker opened this issue Jan 29, 2025 · 0 comments · May be fixed by #111
Open

Surface failed metric collections to the collector #97

isker opened this issue Jan 29, 2025 · 0 comments · May be fixed by #111

Comments

@isker
Copy link
Contributor

isker commented Jan 29, 2025

We swallow errors making ECS task metadata API requests here and here. There is actually a way to surface errors to the caller: NewInvalidMetric.

I think we should use it so that errors are surfaced at write time, as in promhttp. The ECS APIs are supposed to be infallible, so the default behavior of serving an HTTP 500 on the /metrics request probably makes sense for everyone in all situations, though we could add a flag to control the behavior.

isker added a commit to isker/ecs_exporter that referenced this issue Apr 12, 2025
We occasionally see the ECS APIs called by ecs_exporter 500 on the first
request or two, so the metrics served by the exporter are nonsense. By
using NewInvalidMetric in response to Collect, we can ensure that HTTP
500s are served on /metrics whenever such errors occur.

Closes prometheus-community#97.

Signed-off-by: Ian Kerins <[email protected]>
@isker isker linked a pull request Apr 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant