-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get string data from query results #189
Comments
You can use string values as labels for a metric, you just need to define the label and match the name with the one of the returned column. As for detatime, you can't use them directly as prometheus only supports numeric values as metrics. Therefore, you have to either convert them to float (e,.g. as epochs) or as strings if you need them as label values. |
Labels way seems like hard coding no? Transform datetime to string as well? Or transformation datetime from DB to unix time by query-exporter? |
I'm not quite sure I understand your need. If what you want (from your initial query output) is to be able to filter in the graphs by WRT datetime, I meant trasform them via the query to e.g. unix timestamps. |
Is it possible now to get string/float data in query by this exporter? For example I have table with columns: product_name; id; last_price; count
So the problem with id and product_name, I can't type some query which show me:
product_name | last_price | count |
foo | 0.0053 | 45031 |
bar | 234 | 500 |
Means some query which show results per 24 hours with product_name info about last_price (the value can be float) and sorting by descending order.
Or is it possible now? If no - it will be great to get this feature.
I also got an error when I tried to send a query and there is a datetime.datetime type.
The text was updated successfully, but these errors were encountered: