Skip to main content
The OpenTelemetry source takes in logs, metrics, and traces, and has a separate output for each: Logs, Metrics, and Traces. It replaces three deprecated sources: OpenTelemetry Logs, OpenTelemetry Metrics, and OpenTelemetry Traces. The events the new source emits are shaped differently from those of the deprecated sources:
  • The deprecated sources convert each OpenTelemetry record into a Mezmo-specific event. The main payload (log body, metric, or span) goes in message, and the OpenTelemetry context (resource, scope, attributes) goes in metadata.
  • The OpenTelemetry source passes each record through in its original OpenTelemetry JSON form. Everything, including the resource and scope, is inside message.
Processors and destinations built for the deprecated sources won’t work with the OpenTelemetry source’s outputs unless you update their field paths or remap the events first.

At a glance

The OpenTelemetry source envelope

All three outputs share the same envelope. message.type is log, metric, or trace, and message.record holds the signal-specific fields:
  • annotations.app is set from the service.name resource attribute, or k8s.container.name if that isn’t set.
  • annotations.host is set from the k8s.pod.name resource attribute, or host.name if that isn’t set.
  • timestamp is set from the record’s time:

Logs

In the deprecated Logs source, metadata.resource holds resource attributes directly. In the deprecated Metrics and Traces sources, they’re nested under metadata.resource.attributes. In the OpenTelemetry source, they’re always at message.resource.attributes.

Log Records With an Empty Body

Some OpenTelemetry exporters, such as Codex, put all of a log record’s data in its attributes and send no body. The OpenTelemetry source keeps these records and sets message.record.body to an empty string (""). If your processors match on the log body, also check message.record.attributes so these records aren’t skipped. The source drops a log record only when it has both an empty body and no attributes.

Metrics

Which fields appear in dataPoint depends on the metric type. The example above is a gauge. Sums, histograms, and summaries can carry other fields.

Sending OpenTelemetry Metrics to Metric Destinations

You can connect the Metrics output directly to a metric destination such as New Relic or Datadog Metrics. The pipeline converts each OpenTelemetry metric to the Mezmo metric format before the destination sends it, so you don’t need to remap the fields yourself. The conversion works like this:
  • Gauge, sum, histogram, exponential histogram, and summary data points are converted. Exponential histograms are approximated as regular histograms.
  • Resource attributes and data point attributes become metric tags.
  • Metric names and tag keys keep their original OpenTelemetry form. For example, k8s.pod.memory.major_page_faults keeps its dots and gets no _total suffix.
  • If a required field is missing or invalid, the event is dropped and the error names the field, for example record.metric.name.
To learn what each destination does with counters, histograms, and summaries, see New Relic and Datadog Metrics.

Traces

Migrating from the deprecated sources

When you replace the deprecated sources with the OpenTelemetry source:
  1. Add one OpenTelemetry source, and connect each downstream processor to its Logs, Metrics, or Traces output.
  2. Update the field paths your processors use, following the tables above. For example:
    • Logs: message becomes message.record.body
    • Metrics: message.name becomes message.record.metric.name
    • Traces: message.trace_id becomes message.record.traceId
    • All signals: metadata.resource… becomes message.resource.attributes…
  3. Convert values before doing math or numeric comparisons: metric values, *UnixNano times, and many attribute values arrive as strings.
  4. Check for anything that relies on fields the new source doesn’t set, such as annotations.level on logs or metadata.level on traces.
  5. Check dashboards and alerts that query metrics by name or tag. Metrics from the OpenTelemetry source keep their original names and attribute keys, while the deprecated source normalized them. See Sending OpenTelemetry Metrics to Metric Destinations.