Invalid token error while scraping a target

62 views
Skip to first unread message

Tasleem Halai

unread,
Mar 1, 2020, 9:57:35 PM3/1/20
to Prometheus Users
I am using Prometheus : 2.8.1

prometheus config:

scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

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

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

  - job_name: 'grafana'
    static_configs:
    - targets: ['localhost:3000']

  - job_name: 'TestApp'
    metrics_path: '/actuator/prometheus'
    static_configs:
    - targets: ['localhost:8080']

http://localhost:8080/actuator/prometheus gives following metrics like:

# HELP jvm_buffer_memory_used_bytes An estimate of the memory that the Java virtual machine is using for this buffer pool
# TYPE jvm_buffer_memory_used_bytes gauge
jvm_buffer_memory_used_bytes{id="mapped",} 0.0
jvm_buffer_memory_used_bytes{id="direct",} 81920.0
# HELP hikaricp_connections Total connections
# TYPE hikaricp_connections gauge
hikaricp_connections{pool="HikariPool-1",} 10.0
# HELP cache_size The number of entries in this cache. This may be an approximation, depending on the type of cache.
# TYPE cache_size gauge
cache_size{cache="addressTypesCache",cacheManager="cachceManager",name="addressTypesCache",} 0.0
cache_size{cache="feeTypesCache",cacheManager="cachceManager",name="feeTypesCache",} 0.0

But when prometheus tries to scrape it, it gives below error:
"INVALID" is not a valid start token
Its not clear from the logs or from this error as to whats wrong and how to fix it.
The spring boot app has security enabled & is protected by username and password.

I tried prometheus with few other versions and specifying basic auth in config but that dint work either.

Can someone please help me understand what could be missing here?


--
Thanks,
Tasleem
prom.png

Murali Krishna Kanagala

unread,
Mar 1, 2020, 11:09:51 PM3/1/20
to Tasleem Halai, Prometheus Users
Metric format is not as as exp6by Prometheus. Promtool can validate the metric format.
Follow the steps in this link

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f5fccada-59fd-49eb-9ad8-430043f1963e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages