Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCustom Collector with timestamp producing exposition prometheus cannot parse #4911
Comments
This comment has been minimized.
This comment has been minimized.
|
This is a bug on the Prometheus side, it's not negotiating openmetrics correctly if gzip is not in use. |
brian-brazil
transferred this issue from prometheus/client_python
Nov 26, 2018
brian-brazil
added
kind/bug
component/scraping
labels
Nov 26, 2018
brian-brazil
added a commit
that referenced
this issue
Nov 26, 2018
brian-brazil
referenced this issue
Nov 26, 2018
Merged
Pass through content-type for non-compressed output. #4912
simonpasquier
added this to the v2.6.0 milestone
Nov 26, 2018
brian-brazil
closed this
in
#4912
Nov 26, 2018
brian-brazil
added a commit
that referenced
this issue
Nov 26, 2018
simonpasquier
removed this from the v2.6.0 milestone
Nov 27, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sedan07 commentedNov 25, 2018
I have an external system which doesn't directly expose metrics in prometheus format. To get these metrics into prometheus I'm attempting to write a custom collector in Python which scrapes the external system and publishes them in prometheus format. However the metrics from the external system are delayed by 30 minutes. Looking at the source code for the
GaugeMetricFamilyclass it's possible to pass a timestamp. This also matches the docs on the exposition format.However passing a timestamp causes the Prometheus server (v2.5.0) not to be able to read the metrics and gives the error: 'expected next entry after timestamp, got "MNAME"'. The following code shows the issue:
Using v0.4.2 of the python client and Python 3.7
Viewing the output of
localhost:8000appears to show the metrics in the correct format matching the exposition format and doesn't show any extra values which might cause it. Am I simply using this wrong? or is this a bug somehow?