27 Nov 2025 11:58 AM - edited 27 Nov 2025 12:04 PM
Hi Everyone
i have a custom metric and each data point represents the duration of a single activity/phase within a workflow. A workflow consists of multiple phases.
Example:
Workflow 1 phases: 1 ms, 2 ms, 30 ms, 10 s → total workflow duration = 10,033 ms
Workflow 2 phases: 2 ms, 3 ms, 15 ms, 10 s → total workflow duration = 10,020 ms
I want to calculate the median of total workflow durations (p50).
That is, first sum all phases for each workflow, then take the median across workflows.
I can currently get the sum of phases per workflow using:
tenant.workflow.phases.latency.count
:filter(eq("operation", "ONBOARD"))
:splitBy("workflow_id")
:fold(sum)
This gives me workflow_id + total duration.
Is there a way to apply percentile (e.g., p50) on this folded result using Metric Selector syntax(because DQL is not available on my dynatrace instance probably) , essentially doing a double aggregation (sum → percentile) in a single metric selector?
I’ve tried things like:
:fold(sum):percentile(50)
but it results in a syntax error
Illegal transform operator: Found unsupported aggregation :percentile(50)
would like to know if what i am trying to do is possible using metric selector query ? any suggestions would be appreciated