We have a custom instrumentation built that I am able to find in the metrics for Alerting. However, the name to build an alert needs to be based on a wildcard value. The name the engineers used has TextHostnameText. So, The hostname is specific to each node and I need to be able to build it for ‘all’ instances, like Text%Text. And, I need to report on each separate instance individually.
WHERE hostname like 'Text%Text'
You can find more information on this, here: https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/nrql-syntax-components-functions#sel-where
Hope that helps
The problem is it isn’t the hostname. The actual java Instrument/Counter name is variable with the hostname. And, I can’t even figure out how to query instrumented counters
Here is the ‘example’ IP provided for this specific counter that I can’t even figure out how to query in any way.
PlatformServices - Instrument/Counter/storage/com.corp.foundation.storage.content..avglatency
Hi @tim.davis - If this is a custom event, you should be able to formulate a NRQL query in order to find commonality in the variable. The metric explorer might be helpful for this.
I was able to find it for a single specific version of teh avgLatency. I am trying to figure out how to use NRQL for that same item, so I can then wild card it.
@tim.davis - Do you have a link to the metric explorer where you’ve found that metric’s avg latency?
CAMMPlatformServices - Instrument/Counter/cps-storage/com.cerner.mmf.cps.storage.content.cpss1lsapp.cernerworksshared.com.avglatency
Hey @tim.davis, As I understand, you’re looking to query metric data.
APM data in the Metric Explorer are metric charts and do not have any associated NRQL queries, even if imported into Insights. NRQL queries can only be run on events. Metrics don’t have meta-data that is accessible in Insights using NRQL.
I haven’t looked too closely at what you’re trying to accomplish here so please forgive me if I’m off base.
As I believe you know, we don’t supporting wildcards in metric timeslices alerts conditions. This means that as long as each metric ends in a unique (or at least non-universal) segment, you will need to create a condition to monitor each one, which is cumbersome and hard to maintain.
At first glance, a couple solutions occur to me. If you are not using the segments for any analytics, you could remove it from the metric name when you’re recording it. Since the agent just takes a string for the metric name, this should be relatively straight forward (says my naive guess without knowing what your code is doing in that place).
Another option would be to switch from recording custom metrics to recording custom events. If you’re doing anything like what I often do, you should be able to switch from calling
NewRelic.addCustomParameter. This will change the data type from timeslice metrics to events, which will allow you to use NRQL syntax, including the wildcard.
Caveats include things like, if this is a very high throughput transaction, we do have event count limitations imposed by the agent so it’s possible that you might run into that, although we don’t see it that often.
So, from one host/jvm, we are measuring the latency to ‘multiple’ hosts/jvms we communicate with. This is why there are name unique values.
That’s really helpful, thank you! So, if I understand correctly, you’d like to know when the latency for any of these exceeds a certain threshold and it is important to know which of the connections is experiencing latency. If so, then this is a great candidate for NRQL alerting because you’ll be able to use the
FACET keyword. If you were to use events to collect this information then you can create a NRQL condition that is something like
SELECT latency FROM myHostLatencyEvent FACET hostName where the latency is a number that is an attribute of the myHostLatency event, and hostName is another attribute of that event. This would enable you to get a violation created based on any host.
Does that all help/make sense?