Custom metrics in prometheus

Problem/Question

I am trying to export both default and custom metrics to prometheus. I have followed the following guide:

And I am able to check the default metrics from prometheus just fine:

However, I can’t see my custom charts’ data at all. For example, I have a custom python chart, named ‘detection_span’. If I search ‘detection’ in the prometheus search bar, I can’t see anything.

How can I fix this?

Thank you for your time.

Hello @Inigo_Arribillaga,

Do you see your custom metrics under host:19999/api/v1/allmetrics?format=prometheus

Tasos.

Hello Tasos, thanks for your reply.

I think I can:

Hello,

Ok, If you see the metric there and most of the Netdata’s metrics are exported to the prometheus server, my best guess is that the name of your metric is exported (from Netdata → Prometheus) with a slightly different format/name than the one you anticipate.

Tasos.

2 Likes

Unfortunately I can’t find it.

Maybe there is something wrong with my collector?

I added the python code in /usr/libexec/python.d/
I added the config file in /etc/netdata/python.d/

I can see the charts just fine in both netdata cloud and local webpage.

EDIT: I found it!

Thanks for your help!

1 Like