Reputation: 923
I have multiple Azure Cognitive Search services, distributed among different subscriptions. I would like to monitor the usage of each service, what should include:
as I can access them through Overview/Usage pane in Azure portal or through Management RestAPI.
I would like to push this data to Grafana monitoring but I have some problems around that:
Since it's possible to access the usage data through RestAPI I was thinking about creating Function App, that will ping each search service to collect the data and then push it to Log Analytics, which I can then use in Grafana. Maybe I can have one function app per subscription and use RBAC to grant access to search services, but still I don't like to have one app that have access to multiple search services.
How can I push the data from RestAPI to Log Analytics/Grafana other than using a function app?
Upvotes: 1
Views: 369
Reputation: 199
Use the Grafana JSON API data source pointed at the search service resource.
Use the following settings. Leave everything else at the default.
Setting | Value |
---|---|
URL | https://[resource name].search.windows.net/servicestats |
Header name | api-key |
Header value | [Admin key from the search service] |
Query string | api-version=2024-03-01-Preview |
You can then get the values you want from the returned JSON.
E.g. the field to use for the total number of indexes is $.counters.indexesCount.usage
Upvotes: 1
Reputation: 36
As of now, it looks like there is no other option other than pushing this data via additional function to your destination.
Upvotes: 1