You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
The content-type header is expected by some prometheus tools to differentiate between plaintext and protobuf formatted metrics and no content-type is considered an error.
To Reproduce
Steps to reproduce the behavior:
Set httpServerEnabled=false and enable prometheus reporter
run curl localhost:8000/metrics and notice that a content-type header is set
Set httpServerEnabled=true and enable prometheus reporter
run curl localhost:8000/metrics -v notice that there is no content-type header set
Expected behavior
I expect a content-type header
It seems like the statsProvider interface should have a method for allowing to set headers on the response. Default to a given content type might cause problems with other providers.
The text was updated successfully, but these errors were encountered:
Original Issue: apache#2161
BUG REPORT
Describe the bug
When running with
httpServerEnabled
set to true,/metrics
endpoint stops sending acontent-type
header (this uses theMetricsService
, see code here https://github.com/apache/bookkeeper/blob/28dee8464764b0edceeb31ce24424f0947b5789b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/MetricsService.java).With the
httpServerEnabled=false
thePrometheusServlet
is used, and it does set a content-type header (https://github.com/apache/bookkeeper/blob/28dee8464764b0edceeb31ce24424f0947b5789b/bookkeeper-stats-providers/prometheus-metrics-provider/src/main/java/org/apache/bookkeeper/stats/prometheus/PrometheusServlet.java#L44)The content-type header is expected by some prometheus tools to differentiate between plaintext and protobuf formatted metrics and no content-type is considered an error.
To Reproduce
Steps to reproduce the behavior:
httpServerEnabled=false
and enable prometheus reportercurl localhost:8000/metrics
and notice that a content-type header is sethttpServerEnabled=true
and enable prometheus reportercurl localhost:8000/metrics -v
notice that there is no content-type header setExpected behavior
I expect a content-type header
It seems like the statsProvider interface should have a method for allowing to set headers on the response. Default to a given content type might cause problems with other providers.
The text was updated successfully, but these errors were encountered: