New Relic · JSON Structure

New Relic Trace Span Batch Structure

A batch of spans with optional shared attributes

Type: object Properties: 2 Required: 1
AnalysisAnalyticsAPMDevOpsInfrastructureMonitoringObservabilityPerformancePlatform

SpanBatch is a JSON Structure definition published by New Relic, describing 2 properties, of which 1 is required. It conforms to the https://json-structure.org/draft/2020-12/schema meta-schema.

Properties

common spans

Meta-schema: https://json-structure.org/draft/2020-12/schema

JSON Structure

Raw ↑
{
  "type": "object",
  "description": "A batch of spans with optional shared attributes",
  "name": "SpanBatch",
  "properties": {
    "common": {
      "type": "object",
      "description": "Shared attributes applied to all spans in this batch",
      "properties": {
        "attributes": {
          "type": "object",
          "description": "Key-value attributes applied to every span in the batch"
        }
      }
    },
    "spans": {
      "type": "array",
      "description": "Array of individual span objects",
      "items": {
        "type": "object",
        "description": "A single distributed trace span in New Relic format",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for this span (16 hex characters)"
          },
          "trace.id": {
            "type": "string",
            "description": "Trace ID that groups all spans in a distributed trace"
          },
          "timestamp": {
            "type": "integer",
            "description": "Unix epoch timestamp in milliseconds when the span started"
          },
          "attributes": {
            "type": "object",
            "description": "Span attributes",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of the operation represented by this span"
              },
              "parent.id": {
                "type": "string",
                "description": "The span ID of the parent span"
              },
              "duration.ms": {
                "type": "number",
                "description": "Duration of the span in milliseconds"
              },
              "service.name": {
                "type": "string",
                "description": "Name of the service that generated this span"
              },
              "error": {
                "type": "boolean",
                "description": "Whether the span represents an error"
              },
              "db.statement": {
                "type": "string",
                "description": "Database query statement if applicable"
              },
              "http.url": {
                "type": "string",
                "description": "HTTP URL for outbound calls"
              },
              "http.method": {
                "type": "string",
                "description": "HTTP method for outbound calls"
              },
              "http.statusCode": {
                "type": "integer",
                "description": "HTTP response status code"
              }
            }
          }
        },
        "required": [
          "id",
          "trace.id"
        ]
      }
    }
  },
  "required": [
    "spans"
  ],
  "$schema": "https://json-structure.org/draft/2020-12/schema"
}