Skip to content

in_prometheus: do not disclosure error details for client - #259

Open
kenhys wants to merge 1 commit into
fluent:masterfrom
kenhys:suppress-exception
Open

in_prometheus: do not disclosure error details for client#259
kenhys wants to merge 1 commit into
fluent:masterfrom
kenhys:suppress-exception

Conversation

@kenhys

@kenhys kenhys commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

It is reasonable to logging error, but no need to disclose detail for client.

It is reasonable to logging error, but no need to disclose detail
for client.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@kenhys kenhys changed the title jin_prometheus: do not disclosure error details for client in_prometheus: do not disclosure error details for client Jul 31, 2026
response(::Prometheus::Client::Formats::Text.marshal(@registry))
rescue => e
[500, { 'Content-Type' => 'text/plain' }, e.to_s]
log.error "in_prometheus: failed to render metrics", error_class: e.class, error: e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all_metrics runs on every scrape, so if the failure is persistent, this will log an error on every scrape interval (15s by default in Prometheus).
That's a behavior change from before, when the failure was silent on the server side.
This is probably acceptable, and Fluentd's ignore_same_log_interval system config can mitigate it if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, surely that behavior might be bad. I'll think about it for a bit.

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 this pull request may close these issues.

2 participants