I'm updating the Db Query plug-in (from the fastpacks/plug-ins area) to accept a list of arbitrary database column names, instead of a single metric called 'Column Value'. My understanding is that to do this involves creating dynamic measures. However, after building out the changes and generating the new dynamic measures, the dynatrace dashboarding capabilities don't do what I would have expected. Support suggested we utilize the forums.The image below is what the dynamic measure matrix is displaying. In this dynamic measure case, we know what the columns will actually be for the specified queries.
Here are my questions. How do you create charts to display the collected values over a period of time (i.e. samples, max_packages_per_minute)? And for the dynamic measure matrix, I thought that the values where supposed to be represented as columns. I have 4 different queries, each with the same columns, and we'd expected that we'd have gotten a grid of values.
The code that builds out the dynamic measures is below:
if ((measures = env.getMonitorMeasures(METRIC_GROUP, MSR_VALUE)) != null) { double cValues[] = cValue(); String measureNames[] = getMeasureNames(); if (cValues != null) { for (MonitorMeasure measure : measures) { measure.setValue(cValues[0]); int i = 0; for (String measureName : measureNames) { if (measureName != null && measureName.trim().length() > 0) { log.finer("Setting dynamic measure " + measureNames[i] + " with value "+ cValues[i]); dynamicMeasure = env.createDynamicMeasure(measure, "Name", measureNames[i]); dynamicMeasure.setValue(cValues[i]); } i++; } } } }
Answer by Andreas G. ·
Hi James. I forwarded your question to an internal resource who created several monitoring plugins in the past. He will have a look at this and will respond later this week. Andi
Answer by Eugene T. ·
Hi Jim,
For each of the four queries, please use unique name in the second parameter of the com.dynatrace.diagnostics.pdk.MonitorEnvironment.createDynamicMeasure method, e.g. instead of "Name" use "Query1" for the measures of the first query, "Query2" for the measures of the second query, etc. You should be able to have grid then. Please let Andi or me know if you still have problem.
Eugene.
Answer by James M. ·
Thanks, Eugene. I added in that new field to the plugin, and that makes the dynamic measure matrix dashlet work as expected.
The last two questions, which are still outstanding, include:
1) how do I graph the dynamic values, so we can see how these column values change over time?
2) How can I create a measure that is specific to the monitor instance and dynamic value (i.e. column name) and then put thresholds on that value. Our ultimate goal is to associate incidents against those new measures.
Answer by James M. ·
Ah, I missed the splitting drop-down; I only noticed the usual 'split' cast of characters. Thanks, David!
Would you mind sharing your modified db plugin? I was just about to update the existing one to add this functionality.
Answer by James M. ·
I'm still a bit confused on how to set thresholds on one of these child measures. In our specific use case, he Db Query is create a dynamic measure called Db Query->Column Value->Approvals->Max Packages. Approvals is the query, Max Packages is the column name we're monitoring.
I'd like to create a measure on this value and ultimately alert when the value breaks our thresholds.
Many I'm missing something, but the UI seems to stop at the 'Column Value' dimension, so I can't figure out how to do the above Any pointers to doc I may have missed? Thanks in advance,Jim
Hi Jim,
I'm not sure if you can setup incidents based on the dynamic measures. I'll double check it. However, when incident is triggered you will know which dynamic measure triggered it, i.e. the ${ VIOLATED_MEASURE_SPLITTINGS} will have a dynamic measure name and ${ VIOLATED_MEASURE_VALUE} will have its value. If this doesn't work for you, the Monitor Metric Group plugins should work. We can take use of Monitor Metric Group plugins offline if you'd like to use them.
Eugene.
Answer by James M. ·
Let me take a look at that.
One, hopefully last question that I can't find in the PDK javadoc. How do I get the profile name associated with the monitor? I'd like to log it along with the other data, so if there are issues there is the option of scraping the log and generating alerts from that to the group that owns the profile.
Answer by Eugene T. ·
Hi Jim,
We've received confirmation from the Lab that a dynamic measure cannot be used to configure an incident rule, only measure subscriptions stored in the system profile can be used for incident rule configurations.
In terms of the profile name: the com.dynatrace.diagnostics.pdk.ActionEnvironment.getSystemProfileName() method returns profile name.
Eugene.
JANUARY 15, 3:00 PM GMT / 10:00 AM ET