Skip to content
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

2.0.0-rc.1 & 2.0.0-rc.2 Metrics are not scraped if a UTF-8 BOM character exists in the begining of the metrics #3364

Closed
sammy opened this Issue Oct 27, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@sammy
Copy link

sammy commented Oct 27, 2017

What did you do?
Upgraded to prometheus 2.0.0-rc.1 and my metrics are not scraped anymore.
Same happens if i upgrade to v2.0.0-rc.2

What did you expect to see?
Expected metrics to be scraped, as they were in v1.8.1 and v1.7.1

What did you see instead? Under which circumstances?
On the prometheus targets page, my target reports as DOWN with the error "No token found"
Upon investigation it appears that the client library I am using includes a UTF-8 BOM character at the beginning of the metrics which breaks scraping on v2.0.0
The client library is: https://github.com/phnx47/Prometheus.Client
If I run a proxy in front of the application that removes the first line of the metrics, and have prometheus scrape the proxy then the metrics are scraped fine

Example of the first line of metrics as returned if I crawl the /metrics endpoint with Ruby RestClient

metrics = RestClient.get "http://172.17.0.1:5000/metrics"
metrics.body
\xEF\xBB\xBF# HELP dotnet_collection_errors_total Total number of errors that occured during collections[...]

Environment

  • System information:

    Linux 4.8.0-59-generic x86_64

  • Prometheus version:

prometheus, version 2.0.0-rc.2 (branch: HEAD, revision: ce63a5a)
build user: root@a6d2e4a7b8da
build date: 20171025-18:42:54
go version: go1.9.1

prometheus, version 2.0.0-rc.1 (branch: HEAD, revision: 5ab8834)
build user: root@1f56dd8b6f7b
build date: 20171017-12:34:15
go version: go1.9.1

  • Prometheus configuration file:
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
 
  external_labels:
      monitor: 'codelab-monitor'

rule_files:
  # - "first.rules"
  # - "second.rules"

scrape_configs:

  - job_name: 'prometheus'

    static_configs:
      - targets: ['localhost:9090']
 
  - job_name: 'myapp'
 
    static_configs:
      - targets: ['172.17.0.1:5000']

  • Logs:
level=warn ts=2017-10-27T14:49:27.819107595Z caller=scrape.go:674 component="target manager" scrape_pool=myapp target=http://172.17.0.1:5000/metrics msg="append failed" err="no token found"

@swimtver

This comment has been minimized.

Copy link

swimtver commented Nov 9, 2017

+1

@coding4food

This comment has been minimized.

Copy link

coding4food commented Nov 9, 2017

+1

The issue still exists in 2.0 and documentation on exposition formats says nothing about BOM.

@coding4food

This comment has been minimized.

Copy link

coding4food commented Nov 9, 2017

@sammy this issue has been fixed in the Prometheus.Client PrometheusClientNet/Prometheus.Client#4

@Vista-Group

This comment has been minimized.

Copy link

Vista-Group commented Nov 30, 2017

+1

@gouthamve

This comment has been minimized.

Copy link
Member

gouthamve commented Nov 30, 2017

Hi, I think the consensus here is to close this as a wont-fix as the clients are technically broken. If you have a good reason as to why we need to support UTF-BOMs, please feel free to comment or re-open this issue.

@gouthamve gouthamve closed this Nov 30, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.