Before I go down the rabbit hole of trying to do this from scratch, I’m hoping someone out there has already done this (Dynatrace really needs a sharing site where users can share their custom creations…).
What I need is relatively simple. I have a DQL Query that spits out some timeseries metrics. I’d like to take those and create a new custom metric in Dynatrace using the metrics ingest API.
I’m really hoping someone has done this already and can share their code with us?
(I also wish Dynatrace would create an integration for that, just like they have integrations for creating/editing ownership, SRG, and Davis Anomaly Detectors)
Really great stuff @christian_kreuz ! Exactly what I was looking for! I still contend that Dynatrace should provide an integration (like Owners and Anomaly Detection) for creating custom metrics (and even integrations for setting maintenance periods on entities and other common stuff that people will use Workflows for within Dynatrace. Or, at least setup a sharing site where users can post and share creations they’ve made with each other).
I agree, built-in actions that make certain-uses cases easier, essentially a no-code solution for the end-user, would be a great addition. I will forward this feedback internally!
I mean, it can be anything. The what isn’t that important. I’m just looking for something similar to calculated service metrics, for example.
I do have a specific use case where I want to be able to query the first time a log entry that has a certain id value in one of its columns occurs and then the last time an entry with that same id value occurs, then get the difference as a duration (effectively getting the total time taken for each user). Then average up the result of all of those calculations into a single value that we can then use to create a metric.
This isn’t possible in OpenPipeline because OP can’t look at other log records since it is processing logs as they flow in. The only way to create this metric is with a DQL query and then creating a metric out of that query.
But that’s just one example. I want to be able to do that with the result of any DQL query, no matter what it is.
Say, if the metric response_time_95 would be breakdown by numerous dimension, in the DQL of the first task (i.e the task named ‘get_data’) in the workflow. How can I make sure I ingest those dimension/breakdown into Dynatrace using the second-and-last task (i.e the task named ‘ingest_data’)?
Imagine the output of the DQL in second task is like below: