Metric format is not as as exp6by Prometheus. Promtool can validate the
metric format.
Follow the steps in this link
https://www.robustperception.io/invalid-is-not-a-valid-start-token-and-other-scrape-errors

On Sun, Mar 1, 2020, 8:57 PM Tasleem Halai <[email protected]> wrote:

> 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
> <http://10.128.193.221: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
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/f5fccada-59fd-49eb-9ad8-430043f1963e%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/f5fccada-59fd-49eb-9ad8-430043f1963e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAKimyZtbJNK-4EjiWeKEJSJeK%3D20h%2BLwjSgotyUThQzYdwm3Gw%40mail.gmail.com.

Reply via email to