-
Notifications
You must be signed in to change notification settings - Fork 3
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
Values not showing up at /metrics endpoint #6
Comments
I just want to add that there is not necessarily any need to resolve this specific problem. It would be equally or more useful with some hints as to how I should go about writing my configuration to get the best results. I've already tested this and it currently is running as expected on Kubernetes, however, I cant seem to completely understand some of these queries not working.. so yeah thats why I created this issue. |
is it possible to post the whole config file or is that anything? do you specify a timerange? you're specifing the workspace in the app arguments, right? |
Hi, thanks for replying @mblaschke 🚀 for the local test I am passing the workspace in the command when running the binary like such:
This is the entire config (the first two queries work fine and give me the result I want, the heartbeat one fetches four results but shows no metrics at the /metrics endpoint):
So the last query is the one I'm struggling with. I have tried specifying the timespan as well, with no luck, in addition to adding multiple fields. Not sure what is required to make this visible. Just to summarize quickly: It's working great - but I'm having issues with specific queries and I'm a bit clueless as to why 🙈 |
you have to specify either the timeframe for the query or as part of the query, i'm not sure what azure is doing without timeframe 🤔 |
@mblaschke I see.. So when I'm using this particular query:
The exporter debug flag is giving me the following:
So supposedly its fetching four results. If I check log analytics in the Azure Portal it's showing four results, so this is correct. But when I navigate to http://localhost:8080/probe to check the results, the results for that particular azure_metrics_loganalytics_exporter_missing_heartbeat query is not listed.. the others are there as expected. So I'm getting four results, but no metrics. |
Could you post the result from LogAnalytics query execution with timeframe "set in query" via Azure portal? can you try:
|
Well, it seems the value: 1 solves my issue. Would you care to explain how that is? Thanks a lot for your super fast and great help @mblaschke - amazing! |
you cannot publish metrics without values as these wouldn't make sense. but i guess i have to add an error message somewhere so it's obvious. if you want to use a value from the query you have to define one field as value field |
I see. I tried that though, but as there is no obvious value for something like a heartbeat, I used _ResourceId etc. Must the value be integers for it to work? Because using _ResourceId, which I suspect is a string, did not work. |
Prometheus (and so the prometheus client) is expecting a float64 value so integer is also working fine here. For "info" metrics you can specify a fixed value for the query (also used eg in azure-resourcegraph-exporter if you want to export resource information). |
I see! I've learned something new today as well. Again, thanks for helping out 🚀 |
Hey guys,
I am testing your log analytics exporter (great job by the way). I am running some queries locally with the debug and trace flags and I see that my queries are fetching the right amount of results when I compare and run the same query in Log Analytics. However, these results are not shown on the /probe endpoint.
The stack trace showing that the query fetched results:
EBU[0004]/home/runner/work/azure-loganalytics-exporter/azure-loganalytics-exporter/loganalytics/prober.go:358 loganalytics.(*LogAnalyticsProber).executeQueries fetched 4 results metric=azure_metrics_loganalytics_exporter_missing_heartbeat module= results=4
The following config reproduces this issue:
Do you guys have any idea as to why this is happening? Is it because of a missing type: value field? Could not find any documentation on this so its mostly been trial and error, but I have managed to get it to work with multiple other queries.
Every pointer in the right direction is appreciated. Thanks.
The text was updated successfully, but these errors were encountered: