Data Source for an API that requires POSTing the query and then GETting the query results based on a token?

  • What Grafana version and what operating system are you using?
  • What are you trying to achieve?
    Trying to get data from the newer Dynatrace Business Analytics API using their new DQL query language.

So, their new DQL language can be accessed through their Business Analytics API (documentation here). The problem with it is that you have to POST your query to the API which then gives you a Request token that you then use to GET the results of the query.

I’m familiar with the method of getting an authentication token with variables and I guess I could do something like that here, but man what a pain to do, especially on a dashboard that may have tons of different panels and thus queries. I’ll have to keep the variables matched up to the panels that use them…

I’m hoping there’s a better way, probably using the Infinity plugin. I know the normal Dynatrace Plugin doesn’t have this capability. So does anyone know of a way to do something like this, other than using dashboard variables?

token refresh authentication is on the roadmap

Hi, thanks for the reply, but this isn’t authentication. This is essentially a job ID token. So, what I would need is for one call to POST the query and get the Request Token (which is essentially like a job ID), then another call to use that Request Token to go fetch the results.

While yes, this is very similar to an authentication token, it’s not the same. Especially considering this API uses Oauth2 which means we already have to go fetch the Bearer Token using the OAuth2 Client Credentials. This means that, with this stupid method Dynatrace is implementing, running one query requires 3 API calls (1 OAuth2 call to get Bearer Token, a POST to send the query, and a GET to retrieve the results of that query)… Ridiculous.

So, with that in mind, does anyone have any ideas of a way to do this (besides using dashboard variables of course)?

Dynatrace is enterprise plugin = you have also support from Grafana labs. So you can contact your support and ask for this feature. I’ll recommend to do that.

Splunk datasource has already this approach implemented.