prometheus Targets Error "expected text in TYPE" ?

43 views
Skip to first unread message

kang shen

unread,
Dec 28, 2023, 4:08:57 PM12/28/23
to Prometheus Users
Handsome guys, help me,Where is the problem?Version mismatch?
prometheus.png
endpoint.png


prometheus_version: 2.48.1

springboot_verson:2.7.18

prometheus_config:
scrape_configs:
config.
  - job_name: "app"
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    metrics_path: "/actuator/prometheus"
    static_configs:
      - targets: ['localhost:8080']





Brian Candler

unread,
Dec 29, 2023, 3:51:48 AM12/29/23
to Prometheus Users
Try piping the metrics to "promtool check metrics", e.g.

    curl localhost:8080/actuator/prometheus | /path/to/promtool check metrics

You may get a better description of the error.  If that doesn't help, then load the metrics to a file and do a binary chop.
i.e. run the first half through promtool check metrics, then the second half, and see which half has an error; repeat with ever smaller pieces.

Note also that metric names are not allowed to contain dots. See:

/opt/prometheus/promtool check metrics <<EOS
# HELP custom_jvm.threads.states The current number of threads
# TYPE custom_jvm.threads.states gauge
custom_jvm.threads.states{region="us-east-1",state="timed-waiting",} 2.0
EOS
error while linting: text format parsing error in line 1: invalid metric name in comment
Reply all
Reply to author
Forward
0 new messages