You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a newbie with Prometheus_client.
I would like to ask if it is possible to customize the label.
The example is as follows metrics_one = prometheus_client.Gauge("mysql_data", "mysql_data", ["label1", "label2", "label3", "label4", "label5", "label6"]) metrics_two = prometheus_client.Gauge("mysql_data", "mysql_data", ["label1", "label2", ]) metrics_three = prometheus_client.Gauge("mysql_data", "mysql_data", ["label1", "label3", ]) metrics_four = prometheus_client.Gauge("mysql_data", "mysql_data", ["label1", "label2", "label4" ])
But I have a lot of labels, I only need to use a few of them when I insert data,
Do I have to write all the metrics like this? Is there another way to do it?
And in the end, I finally hope to use flask to respond to the latest data of all labels of metrics. @app.route('/metrics') def metrics(): set_data_to_prometheus() return Response(prometheus_client.generate_latest(metrics), mimetype="text/plain")
If so, I can only pass out the data of one metric.
Looking forward for your reply, thank you
Activity