cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Querying metrics using DQL metrics.key and metrics selector API

Hey,

I am now deciding whether to use metrics API or DQL to query metrics.  But now, I am facing a problem that I can't find some metrics using DQL. (e.g. builtin:host.cpu.load15m)

Is that all metrics that can be queried by metrics selector can also be use DQL to query?

 

Thanks. 

9 REPLIES 9

chris_smerek
Dynatrace Participant
Dynatrace Participant

Hi Stephen - DQL is only used for querying logs and events with Grail: DQL Documentation.

 

For the metric selector, metric queries are handled differently, and do not use DQL. I'd recommend checking out the Data Explorer Advanced Mode to get a better idea of how metric queries are handled.

 

As of the late May / early June 2023 Dynatrace rollout, this is now possible via DQL. Please view MaciejNeumann reply for a link to the metrics covered with Grail.

I don't think that's true Chris, at least not anymore.  DQL can query metrics via the timeseries command:

DQL commands | Dynatrace Docs

You are correct, this was a new feature that was added after my original comment (MaciejNeumann reply is correct)

MaciejNeumann
Community Team
Community Team

Hello @StephenLHChan,

With the rollout of the latest Dynatrace, the DQL can also query metrics. Here you can find the documentation article with the list of all metrics supported by Grail:

Built-in metrics on Grail 

If you have any questions about the Community, you can contact me at maciej.neumann@dynatrace.com

Hello @MaciejNeumann 

A question about calculated metrics.., is there a way to query them?

 

thanks!

Jose A

fcourbon
Dynatrace Participant
Dynatrace Participant

Hello @JAR1 , calculated service metrics (metrics starting with calc:service) are not yet available on Grail.

@StephenLHChan , the Grail metric key is dt.host.cpu.load15m and documentation for querying metrics in DQL can be found here

Do you know when this will be available?  We are looking to do a workflow that has logic like:

If calc:service_metric1 + calc:service_metric2 > 20 

Then Enable Alerting Profile via api x

If not Disable Alerting Profile via api x

Is this possible since these are Calc:service metrics?  If not when is this functionality expected?

 

So is there a way to use DQL in API queries?  So far in all the docs, I don't see any mention of using DQL commands and queries in the API, only in the new web console.  Is this coming down the pipe? 

I ask because I find the Dynatrace API extremely complex and very limiting compared to many other API's I've used for similar tools. However, if we could use DQL queries in our API calls that would pretty much solve all of the issues I have with the Dynatrace API and make it extremely powerful.

Yes there is.

It's not that easy to find the documentation for it.

Endpoint: /storage/query/v1

I use this endpoint to fetch metrics data.

Featured Posts