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

Querying the metrics API with nullable values and Inf resolution

mtfurlan-lq
Newcomer

I'm using flagger for canary deployments, which always makes queries with infinite resolution, in order to resolve the entire query to one number.

I'm trying to make a query that returns the failure rate of a service, based on the outcome dimension of a metric of request length.

 

 

My problem is that the metric I'm querying is sometimes null, so I have to use :default(0, always), otherwise:

The metric expression yielded no data points and/or matching dimension tuples for the query timeframe. Consider appending the default transformation (for example, `:default(0)`) to the operands.

 

But this is incompatible with a resolution of Inf:

Illegal transform operator: Usage of default operator is only supported for resolutions other than `Inf`

I'm not able to change flagger to not use the Inf resolution.

 

My full query:

(
    http.server.requests
    :filter(
        and(
            eq("k8s.namespace.name","namespace"),
            eq("k8s.workload.name","deployment name"),
            ne("outcome","SUCCESS")
        )
    )
    :count
    :splitby("k8s.pod.name")
    :default(0, always)
/
    http.server.requests
    :filter(
        and(
            eq("k8s.namespace.name","namespace"),
            eq("k8s.workload.name","deployment name")
        )
    )
    :count
    :splitby("k8s.pod.name")
)

So how else could I approach this query to get a rate for http.server.requests failures?

0 REPLIES 0

Featured Posts