Sends metric data points to New Relic.
For prerequisites, see New Relic Ingest actions.
Send metrics to New Relic
The action identifier is newrelic.ingest.sendMetrics.
Sends metrics to New Relic.
The following table describes all available input fields for this action.
Input | Type | Description | Example |
|---|---|---|---|
metrics | List | Required. List of metric data points. See Required key-value pairs in the |
|
attributes | Map | Optional. Common attributes to apply across all metrics. See Share attributes across metrics with |
|
licenseKey | String | Optional. The New Relic Account License Key specifies the target account for your events. If not provided, the system uses the default license key from the account executing the workflow. Read more about our API keys to create and manage your New Relic Account License Key. Do not input credentials in plain text. Use the secrets syntax shown in the example. |
|
selectors | List | Optional. The selectors to get only the specified parameters as output. |
|
Required key-value pairs in the metrics
Each metric data point map in the metrics list uses the following key-value structure:
Attribute | Type | Description |
|---|---|---|
name | String | Required. The name of the metric. The value must be less than 255 characters. |
value | Number or Map | Required. The value varies depending on the metric type. For |
timestamp | Long | Optional. The metric's start time in Unix time. The default uses UTC time zone. This field also supports seconds, microseconds, and nanoseconds. However, the data will be converted to milliseconds for storage and query. Metrics are dropped if they have a timestamp more than 48 hours in the past or more than 24 hours in the future from the time they are reported. |
interval.ms | Positive long | Required for |
type | String | Recommended. Supports only |
attributes | Strings, JSON numbers, or Booleans | Recommended. A map of key-value pairs associated with this specific metric. Values can be strings, JSON numbers, or booleans. Keys are case-sensitive and must be less than 255 characters. |
Importante
The metrics API mandates a timestamp. Within the action, the timestamp is optional, defaulting to the current time if not supplied prior to metrics ingestion.
Share attributes across metrics with common
If you want to include a set of attributes on multiple metrics (and not add the same attributes for each metric), you can use the common block. This is an optional map that specifies information that applies to all associated metric data points. Values in the common section will be overridden if the same key exists on a metric data point.
The block can include:
Attribute | Type | Description |
|---|---|---|
timestamp | Long | The metric's start time in Unix time. This defaults to the current time in the UTC time zone. This field also supports seconds, microseconds, and nanoseconds. However, the data will be converted to milliseconds for storage and later querying. |
interval.ms | Positive long | Required for |
attributes | Strings, JSON numbers, or Booleans | A map of key-value pairs associated with this specific metric. Values can be strings, JSON numbers, or booleans. |
The following table describes all output fields returned by this action.
Output | Type | Description |
|---|---|---|
requestId | String | The request identifier assigned by the metrics API. Example: |
success | Boolean |
|
errorMessage | String | Failure reason as message. |
The following example sends two metric data points — a count and a gauge — with timestamps and status-code attributes.
Workflow example |
|---|
|