Closed anurag-appperfect closed 1 year ago
You can define a metric named metric9
and use name
as a label. It depends on what you need to do.
Thank you for your suggestion and do I need to pass separate parameters for each value of name ?
it depends on your query
query8:
interval: 5
databases: [db1]
metrics: [metric8]
sql: select count(*) AS metric8, :param AS study from study_db WHERE type_study = :param group by study_db order by COUNT(*) desc;
parameters:
- param: "OP"
- param: "OT"
- param: "XC"
- param: "OPT"
- param: "OP\\OPT"
- param: "XC\\OPT"
- param: "XC\\OT"
- param: " "
- param: "SC"
- param: "XC\\OT\\OP"
- param: "OT\\OP"
Here is the code sample, what should I do to avoid passing each value of param ?
If I understand your db schema correctly you could just have a query like:
select count(*) AS metric8, type_study as study from study_db group by type_study
with metric8
having a study
label defined.
I want to injest database query results to prometheus. I am executing a query and getting the result in table 11 rows in set (0.006 sec)`
How to insert this data to prometheus using Prometheus