Closed ntkach closed 3 years ago
Hi @ntkach, you bring up a valid point. We've compiled a list of helpful NRQL queries in hopes of facilitating this adjustment. Please see the extensive list below for more information. And please feel free to share additional query if you have any that seem useful to you.
# Throughput (requests per minute)
SELECT rate(count(*), 1 minute) FROM Transaction WHERE appName = 'application'
# Response time
SELECT average(duration) FROM Transaction WHERE appName = 'application'
# Response time (95th percentile)
SELECT percentile(duration, 95) FROM Transaction WHERE appName = 'application'
# Error rate (errors per minute)
SELECT rate(count(*), 1 minute) FROM Transaction WHERE error IS true AND appName = 'application'
# Browser response time
SELECT average(duration) from PageView WHERE appName = 'application'
# Mobile crashes
SELECT count(*) from MobileCrash where appName = 'application'
# JVM heap utilization
SELECT average(newrelic.timeslice.value) from Metric where appName = 'application' and metricTimesliceName = 'Memory/Heap/Utilization' timeseries
# CPU usage
SELECT average(cpuPercent) FROM SystemSample WHERE host = 'hostname'
# Free memory
SELECT average(memoryFreePercent) FROM SystemSample where host = 'chi-prod-entity-store-dgxlhk2.nr-ops.net'
# RDS CPU usage (requires a configured AWS cloud integration)
SELECT average(provider.cpuUtilization.Average) from DatastoreSample where dataSourceName = 'RDS' and aws.arn = 'arn:aws:rds:...'
# Redis keypace misses per second (requires the Redis infra integration)
SELECT average(db.keyspaceMissesPerSecond) from RedisSample where entityName = 'entity'
# Postgresql connection count (requires the Postgres infra integration)
SELECT average(db.connections) from PostgresqlDatabaseSample where entityGuid = 'entity'
# Synthetics check duration
SELECT average(duration) FROM SyntheticCheck where monitorName = 'monitor'
# Synthetics errors
SELECT * FROM SyntheticCheck where monitorName = 'monitor' and error IS NOT NULL
# Multi-location synthetics errors
SELECT uniqueCount(location) FROM SyntheticCheck where monitorName = 'monitor' and error IS NOT NULL timeseries
In the meantime, we'll see what we can come up with regard to official documentation for changing newrelic_alert_condition
to an equivalent newrelic_nrql_alert_condition
. 😎
@sanderblue Thanks for responding to this, could this be a guide on the developer site? Or it make a great discuss.newrelic.com post if it's not guide-worthy. I'm happy to post it to Discuss if you feel it will help the community.
@ctrombley let me know what you think of my question if you have a free moment.
@sanderblue Thanks! That's an excellent example of what I was looking for!
@ntkach do you think this would make a useful Discuss post? I'm happy to post there if you feel others could benefit from this info.
@ntkach do you think this would make a useful Discuss post? I'm happy to post there if you feel others could benefit from this info.
Yes it would!
These suggestions work except that EXTRAPOLATE
needs to be added on the end for high throughput applications. https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions/#extrapolate
When we create APM alert conditions with newrelic_nrql_alert_condition instead of newrelic_alert_condition they do not appear in the "Alert conditions" section in the APM GUI. Can we make them appear there somehow? Or do we need to use the deprecated newrelic_alert_condition to make that happen?
Feature Description
I see in the documentation for the terraform module you mention that basically the newrelic_alert_condition is being deprecated:
We really need some kind of documentation for converting something like the "Response Time (web) High" out of the box alerts into their equivalent in NRQL.
Describe Alternatives
I can't seem to find anything where NewRelic (or community) has provided something like this. The only alternative I can think of would be sticking with the "non-preferred" version indefinitely.
Additional context
I think people would be fine with converting their newrelic_alert_condition over to newrelic_nrql_alert_condition. However you need to give them some guidance. Surely the plain vanilla alert conditions that have existed for ages should be simple to replicate as NRQL versions.