libdd_trace_utils/otlp_encoder/mod.rs
1// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
2// SPDX-License-Identifier: Apache-2.0
3
4//! OTLP HTTP/JSON encoder: maps Datadog spans to ExportTraceServiceRequest.
5
6pub mod json_types;
7pub mod mapper;
8
9pub use mapper::map_traces_to_otlp;
10
11/// Tracer-level attributes used to populate the OTLP Resource on export.
12///
13/// These are the fields from the tracer's configuration that map to OTLP Resource attributes
14/// (service.name, deployment.environment.name, service.version, telemetry.sdk.*, runtime-id).
15/// Callers should build this from their own tracer metadata struct.
16#[derive(Clone, Debug, Default)]
17#[non_exhaustive]
18pub struct OtlpResourceInfo {
19 pub service: String,
20 pub env: String,
21 pub app_version: String,
22 pub language: String,
23 pub tracer_version: String,
24 pub runtime_id: String,
25}