question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prometheus fails to scrape Helidon metrics

See original GitHub issue

Environment Details

  • Helidon Version: 0.10.1
  • Helidon SE
  • JDK version: 1.8.0_162
  • OS: MacOS

Problem Description

Prometheus 2.2.1 and 2.4.3 fail to scrape Helidon metrics. Prometheus reports the error no token found. This error is typically reported by Prometheus when it can’t parse the scrapped metrics data.

Steps to reproduce

  1. Build and run this Helidon app: https://github.com/barchetta/helidon-se-codeone-2018
  2. Download and run Prometheus 2.2.1 (https://github.com/prometheus/prometheus/releases/tag/v2.2.1)
  3. Add a scrape_configs to prometheus.yml like this:
  - job_name: 'helidon'

    metrics_path: '/metrics/'
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ['localhost:8080']

You’ll see prometheus report:

level=warn ts=2018-10-16T01:35:44.714172501Z caller=scrape.go:697 component="scrape manager" scrape_pool=helidon target=http://localhost:8080/metrics/ msg="append failed" err="no token found"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
barchettacommented, Oct 17, 2018

We have confirmation from MicroProfile that the spec is misleading: https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!topic/microprofile/t4YgzPpmOsA

"I’m part of the metrics community and I agree that what’s specified in section 2.3, related to the Accept header isn’t as specific as it ought to be. The way it’s worded in the spec right now isn’t right, as illustrated by Joe’s example.

The way we’d intended for it to be interpreted was that if the incoming request accepts text/plain with a higher priority than application/json, then you should use Prometheus format. If the incoming request accepts application/json with a higher priority than text/plain, then use JSON format. If the incoming request doesn’t accept either of those, then return a 406 status code."

There is now an issue to clarify this in the spec: eclipse/microprofile-metrics#291

1reaction
spericascommented, Oct 16, 2018

Interesting, I agree. Take a look at HashRequestHeaders::bestAccepted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prometheus fails to scrape Helidon metrics · Issue #111 - GitHub
Prometheus 2.2.1 and 2.4.3 fail to scrape Helidon metrics. Prometheus reports the error no token found . This error is typically reported by ......
Read more >
Prometheus is failing to scrape a target pod, but able to "wget ...
Prometheus can successfully scrape all its targets (defined via ServiceMonitors), every target but 3/4 that it fails to scrape.
Read more >
Module io.helidon.metrics.prometheus
declaration: module: io.helidon.metrics.prometheus.
Read more >
Helidon Basics - Luna Labs | Oracle
Use Prometheus to monitor metrics​​ Prometheus is an open-source systems monitoring and alerting toolkit. Its main feature is the multi- ...
Read more >
Cloud Native - Monitoring with Prometheus
This module shows how to install the data capture tool Prometheus and how to configure your microservices to be "scraped" by it. We...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found