rpm_query: Query New Relic Application Metricdata.

Description Usage Arguments Details Value See Also Examples

Description

This function is a facade on the New Relic public REST API for getting application metric data. You can use it to get any value of any metric over a given time range. The results are always returned as a time series of numeric values.

Usage

1
2
3
4
rpm_query(account_id, api_key, app_id, duration = 60 * 60,
  end_time = Sys.time(), period = NULL, metrics = "HttpDispatcher",
  verbose = F, values = "average_response_time", cache = T,
  host = "api.newrelic.com", progress_callback = NULL, ...)

Arguments

account_id

your New Relic account ID

api_key

your New Relic APM REST API key

app_id

the application id. Use a value of -1 to generate a fake response for tests.

duration

length of time in seconds of the time window of the metric data

end_time

the end of the time window

period

duration of each timeslice as lubridate::Duration or scalar value in seconds, minimum of 60

metrics

a character vector of metric names

verbose

show extra information about the calls

values

a character vector of metric values (calls_per_minute, average_response_time, etc)

cache

TRUE if the query results should be cached to local disk and reused when subsequent calls have matching parameters

host

use to proxy requests through an intermediate host you can override the default host of api.newrelic.com.

progress_callback

is a caller supplied function that takes two arguments: the iteration number and the total number of iterations.

...

arguments passed on to progress_callback if provided.

Details

This executes HTTP queries using the underlying Metric Data REST API at api.newrelic.com. Depending on the duration and period the data may be fetched in successive batches due to the limitations on the amount of data that can be retrieved.

Value

a data table with observations as timeslices and the timeslice start time, metric name, and values in the variables

See Also

New Relic REST API Documentation

How to get API keys

Examples

1
2
3
    rpm_query(account_id=12345, api_key='your_api_license_key_here',
              app_id=-1, duration=3600, period=300, end_time=as.POSIXct('2016-01-28 09:15:00'),
              metrics='HttpDispatcher', values='calls_per_minute')

bkayser/NewRelicR documentation built on May 12, 2019, 9:27 p.m.