Monitoring

OpenTelemetry

Push Spice Cloud metrics to any OpenTelemetry-compatible backend over OTLP

Spice Cloud can push metrics to any OpenTelemetry-compatible backend over OTLP, as an alternative to having a monitoring agent scrape the metrics endpoint.

Pushing is configured in the project's spicepod under runtime.telemetry.otel_exporter. No collector or agent is required — the runtime exports directly to the endpoint.

runtime:
  telemetry:
    otel_exporter:
      endpoint: https://otlp.example-org.com/v1/metrics
      headers:
        api-key: ${secrets:OTLP_API_KEY}

Push or scrape

Both paths expose the same runtime metrics. They differ in which side initiates the connection:

ScrapePush (OTLP)
Initiated byThe monitoring agentThe Spice runtime
Configured inThe agentThe project spicepod
ReachabilityAgent must reach the project endpointRuntime must reach the backend
TemporalityAlways cumulativedelta by default, configurable

Push suits backends that offer a hosted OTLP intake, and avoids running an agent that has network access to the project. Scrape suits an existing Prometheus-based stack. See Grafana & Prometheus and Datadog for the scrape path.

Configuration reference

runtime.telemetry

FieldTypeDefaultDescription
enabledbooleantrueWhether runtime telemetry is collected
propertiesmap{}Custom key/value pairs attached to every metric as OpenTelemetry resource attributes
metric_prefixstringnonePrefix prepended to every exported metric name
otel_exporterobjectnoneOTLP push configuration (below)

runtime.telemetry.otel_exporter

FieldTypeDefaultDescription
endpointstring—Required. For HTTP, the full URL. For gRPC, a hostname with optional port
enabledbooleantrueWhether the exporter is active
push_intervalstring60sHow often metrics are pushed
metricslistallWhitelist of metric names to export
headersmapnoneHeaders sent with each export. For gRPC these become metadata entries and keys must be lowercase
temporalitystringdeltaHow counters and histograms are encoded — see below

Temporality

temporality controls how counter and histogram values are encoded on the wire:

ValueBehaviorWhen to use
deltaEach export carries the change since the previous exportDefault. Required by Datadog's OTLP intake and recommended by New Relic, AWS CloudWatch, and most hosted OTLP backends
cumulativeEach export carries the running total since process startCollectors that feed Prometheus or other cumulative-native backends
low_memoryCounters cumulative, histograms deltaHistogram-heavy workloads, to reduce in-process state

Namespacing metrics

metric_prefix prepends a string to every exported metric name, which avoids collisions when several services report into one backend:

runtime:
  telemetry:
    metric_prefix: 'spiceai.'

The runtime metric query_duration_ms is then exported as spiceai.query_duration_ms.

Custom attributes

properties attaches key/value pairs to every metric as OpenTelemetry resource attributes, which backends surface as queryable dimensions:

runtime:
  telemetry:
    properties:
      environment: prod
      region: us-west-2
      team: data-platform

Full example

runtime:
  telemetry:
    metric_prefix: 'spiceai.'
    properties:
      environment: prod
      region: us-west-2
    otel_exporter:
      endpoint: https://otlp.example-org.com/v1/metrics
      push_interval: '30s'
      temporality: delta
      headers:
        api-key: ${secrets:OTLP_API_KEY}

Store credentials as secrets and reference them with ${secrets:NAME} rather than writing them into the spicepod.