About Prometheus API,how to filter targets?

Viewed 73

I can use API http://host/api/v1/targets to search all targets in my Prometheus.

E.G.

"activeTargets": [{
            "discoveredLabels": {
                "__address__": "192.168.x.x:9906",
                "__metrics_path__": "/metrics",
                "__scheme__": "http",
                "job": "mysql1"
            },
            "labels": {
                "instance": "192.168.x.x:9906",
                "job": "mysql1"
            },
            .....
        },{
            "discoveredLabels": {
                "__address__": "192.168.x.x:9100",
                "__metrics_path__": "/metrics",
                "__scheme__": "http",
                "job": "node1"
            },
            "labels": {
                "instance": "192.168.x.x:9100",
                "job": "node1"
            },
            ......
        }]

Now,I just want to filter all MySQL targets,how I can do that?

0 Answers
Related