New Relic · Arazzo Workflow

New Relic Ingest Metrics And Logs

Version 1.0.0

Send a metric batch then send a correlated log batch in one flow.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub AnalysisAnalyticsAPMDevOpsInfrastructureMonitoringObservabilityPerformancePlatformArazzoWorkflows

Provider

new-relic

Workflows

ingest-metrics-and-logs
Send a metric batch followed by a correlated log batch.
Sends dimensional metrics to the Metric API, captures the request id, and then sends correlated logs to the Log API sharing the same service and host attributes.
2 steps inputs: hostName, logMessage, metricName, metricValue, serviceName outputs: logRequestId, metricRequestId
1
sendMetricBatch
sendMetrics
Send a dimensional metric batch tagged with the shared service and host attributes; the Metric API accepts the batch and queues it for processing.
2
sendLogBatch
sendLogs
Send a correlated log batch sharing the same service and host attributes so the logs can be joined with the metrics in NRDB.

Source API Descriptions

Arazzo Workflow Specification

new-relic-ingest-metrics-and-logs-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: New Relic Ingest Metrics And Logs
  summary: Send a metric batch then send a correlated log batch in one flow.
  description: >-
    A dual telemetry ingestion pattern. The workflow sends a batch of dimensional
    metrics to the Metric API and then sends a correlated batch of logs to the
    Log API, sharing common attributes so the two signals can be joined in NRDB.
    Every step spells out its request inline so the flow can be read and executed
    without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: newRelicMetricApi
  url: ../openapi/new-relic-metric-api-openapi.yml
  type: openapi
- name: newRelicLogApi
  url: ../openapi/new-relic-log-api-openapi.yml
  type: openapi
workflows:
- workflowId: ingest-metrics-and-logs
  summary: Send a metric batch followed by a correlated log batch.
  description: >-
    Sends dimensional metrics to the Metric API, captures the request id, and
    then sends correlated logs to the Log API sharing the same service and host
    attributes.
  inputs:
    type: object
    required:
    - serviceName
    - hostName
    - metricName
    - metricValue
    - logMessage
    properties:
      serviceName:
        type: string
        description: The service.name attribute shared by the metrics and logs.
      hostName:
        type: string
        description: The host.name attribute shared by the metrics and logs.
      metricName:
        type: string
        description: The name of the metric to send.
      metricValue:
        type: number
        description: The gauge value of the metric.
      logMessage:
        type: string
        description: The log message to send.
  steps:
  - stepId: sendMetricBatch
    description: >-
      Send a dimensional metric batch tagged with the shared service and host
      attributes; the Metric API accepts the batch and queues it for processing.
    operationId: sendMetrics
    parameters:
    - name: Content-Type
      in: header
      value: application/json
    requestBody:
      contentType: application/json
      payload:
      - common:
          attributes:
            service.name: $inputs.serviceName
            host.name: $inputs.hostName
        metrics:
        - name: $inputs.metricName
          type: gauge
          value: $inputs.metricValue
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      metricRequestId: $response.body#/requestId
  - stepId: sendLogBatch
    description: >-
      Send a correlated log batch sharing the same service and host attributes so
      the logs can be joined with the metrics in NRDB.
    operationId: sendLogs
    parameters:
    - name: Content-Type
      in: header
      value: application/json
    requestBody:
      contentType: application/json
      payload:
      - common:
          attributes:
            service.name: $inputs.serviceName
            host.name: $inputs.hostName
        logs:
        - message: $inputs.logMessage
          level: INFO
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      logRequestId: $response.body#/requestId
  outputs:
    metricRequestId: $steps.sendMetricBatch.outputs.metricRequestId
    logRequestId: $steps.sendLogBatch.outputs.logRequestId