For OpenTelemetry exporters.
In general, generating New Relic spans from OpenTelemetry spans is quite straightforward. Here is the process:
- For the
"collector.name"
attribute, use"newrelic-opentelemetry-exporter"
- For
"instrumentation.provider"
, use"opentelemetry"
- Assign the span name, span id, parent span id (if present) and trace id to the New Relic span.
- Take all OpenTelemetry span attributes, and map them directly over to New Relic span attributes.
- The OpenTelemetry span status is comprised of a status code and optional description. The status
code is
Unset
,Ok
, orError
. If the status code is notUnset
, then add anotel.status_code
attribute and set it to the value of the status code. If the status code is notUnset
and the status has a description then add anotel.status_description
attribute and set it to the value of the description. - If there is a Resource associated with the Span, take all of the Resource's labels and add them as span attributes.
- If there is instrumentation library information associated with the span,
add the corresponding
"instrumentation.name"
and"instrumentation.version"
attributes to the span, if non-empty.