Error: text format parsing error in line 1: invalid metric name

3,345 views
Skip to first unread message

sushan...@gmail.com

unread,
Nov 7, 2017, 11:53:40 AM11/7/17
to Prometheus Users

My configuration:

global:
  scrape_interval:     15s
  evaluation_interval: 15s
  external_labels:
      monitor: "gatewaymonitor"

scrape_configs:
  - job_name: "gateway"
    metrics_path: "/public/metrics"

    static_configs:
      - targets: ["10.8.110.83:18888"]

I'm using spring cloud zuul/hystrix/ribbon all the netflix oss.
I'm able to see the hystrix metrics here>> http://10.8.110.83:18888/public/metrics

I'm not able to see any issue with my prometheus.yml.
The error I'm getting: https://ibb.co/hDXR5w
Please help.

Conor Broderick

unread,
Nov 7, 2017, 12:05:01 PM11/7/17
to sushan...@gmail.com, Prometheus Users
Enable verbose logging and check the name of the problematic metric. 

Prometheus metrics and label names must adhere to certain rules outlined here in the documentation, namely the metric name must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*.

Hope that helps,

Conor

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/44a10b1b-f84b-437f-9f24-31ad2c1391cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

sushan...@gmail.com

unread,
Nov 7, 2017, 12:21:32 PM11/7/17
to Prometheus Users
Can you please pin point exact issue in they ml file ? as I'm not able to see any violation of metric naming rules !


On Tuesday, 7 November 2017 22:35:01 UTC+5:30, Conor Broderick wrote:
Enable verbose logging and check the name of the problematic metric. 

Prometheus metrics and label names must adhere to certain rules outlined here in the documentation, namely the metric name must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*.

Hope that helps,

Conor
On 7 November 2017 at 16:53, <sushan...@gmail.com> wrote:

My configuration:

global:
  scrape_interval:     15s
  evaluation_interval: 15s
  external_labels:
      monitor: "gatewaymonitor"

scrape_configs:
  - job_name: "gateway"
    metrics_path: "/public/metrics"

    static_configs:
      - targets: ["10.8.110.83:18888"]

I'm using spring cloud zuul/hystrix/ribbon all the netflix oss.
I'm able to see the hystrix metrics here>> http://10.8.110.83:18888/public/metrics

I'm not able to see any issue with my prometheus.yml.
The error I'm getting: https://ibb.co/hDXR5w
Please help.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--

Nicholas Capo

unread,
Nov 7, 2017, 1:53:28 PM11/7/17
to sushan...@gmail.com, Prometheus Users

The error is not in your Prometheus.yaml, it's in the data (metrics) coming from your target at 10.8.110.83:18888/public/metrics

Try curling that address and see what it gives you.

Nicholas


sushan...@gmail.com

unread,
Nov 8, 2017, 11:07:59 AM11/8/17
to Prometheus Users
This is data I received after hitting /metrics >> http://jsoneditoronline.org/?id=26dbc05242d6f12bba63df3f31ece107
is this the correct prometheus metrics data ?

Nicholas Capo

unread,
Nov 8, 2017, 10:14:40 PM11/8/17
to sushan...@gmail.com, Prometheus Users

That data is json, not the Prometheus text format [0].
I have a feeling you are not using a Prometheus client library [1].

Nicholas

[0] https://prometheus.io/docs/instrumenting/exposition_formats/#text-format-details
[1] https://prometheus.io/docs/instrumenting/clientlibs/


sushan...@gmail.com

unread,
Nov 9, 2017, 7:16:46 AM11/9/17
to Prometheus Users
I'm was hitting incorrect endpoint , now after hitting http://10.8.110.83:18888/public/hystrix.stream I'm getting correct hystrix data but the formatting is still an issue. Data that I'm getting >>(http://jsoneditoronline.org/?id=2f71c34ed76155ddb92d94743793cbac)
And the error is >> " text format parsing error in line 1: invalid label name for metric "data:" "

Currently I'm only using this library >>
<dependency>
<groupId>de.ahus1.prometheus.hystrix</groupId>
<artifactId>prometheus-hystrix</artifactId>
<version>3.3.1</version>
</dependency>

sushan...@gmail.com

unread,
Nov 10, 2017, 7:46:01 AM11/10/17
to Prometheus Users
Today I integrated spring_boot_client and changed the endpoint to /prometheus so now after hitting http://localhost:18888/public/prometheus I'm getting this data >> http://jsoneditoronline.org/?id=5d1a431c7cd9c72fa07d16eb075f4267 but after adding this into prometheus getting this error >> text format parsing error in line 109: second HELP line for metric name "counter_servo_eurekaclient_transport_request".
can you please help ?

Nicholas Capo

unread,
Nov 10, 2017, 8:55:10 AM11/10/17
to sushan...@gmail.com, Prometheus Users

That error means you have an extra help line for that metric.
You are only allowed one `HELP` line above the first occurrence of a metric.

Allowed:
# HELP metric_name
metric_name{label="exampleA"} 1
metric_name{label="exampleB"} 1
[...]

Not Allowed:
# HELP metric_name
metric_name{label="exampleA"} 1
# HELP metric_name
metric_name{label="exampleB"} 1
[...]

Nicholas


sushan...@gmail.com

unread,
Nov 11, 2017, 9:13:52 AM11/11/17
to Prometheus Users
I'll explain in detail what I've done: 
I've this code >> http://jsoneditoronline.org/?id=44919d5633d2613e0931753e35e51af5 
which is exposing spring boot metrics(I guess) to prometheus endpoint. 
Then before actually starting the spring application I add this line >> 
HystrixPrometheusMetricsPublisher.register("Gateway"); 
For these to work I've prometheus-hystrix library added + simpleclient_spring_boot library 

Now I can see some data without any error on /prometheus endpoint but I'm not sure whether this is actually hystrix data. here>> http://jsoneditoronline.org/?id=44919d5633d2613e0931753e35e62e7e 

When I point my prometheus.yml file >> 

global: 
  scrape_interval:     15s 
  evaluation_interval: 15s 
scrape_configs: 
  - job_name: 'gateway' 
    scrape_interval: 90s 
    scrape_timeout: 90s 
    metrics_path: '/prometheus' 
    static_configs: 
      - targets: ['localhost:18888'] 

like above then I get status as UP but in graph section it says no data points found. 
Reply all
Reply to author
Forward
0 new messages