From 369ac871ba67522b8fc3895b26baedcc29d47765 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Fri, 24 May 2024 01:30:22 -0700 Subject: [PATCH] [Geneva] Support TraceState mapping (#445) --- .../opentelemetry/exporters/fluentd/common/fluentd_fields.h | 2 ++ exporters/fluentd/src/trace/recordable.cc | 1 + 2 files changed, 3 insertions(+) diff --git a/exporters/fluentd/include/opentelemetry/exporters/fluentd/common/fluentd_fields.h b/exporters/fluentd/include/opentelemetry/exporters/fluentd/common/fluentd_fields.h index b4a600dbd..9ee8c30b4 100644 --- a/exporters/fluentd/include/opentelemetry/exporters/fluentd/common/fluentd_fields.h +++ b/exporters/fluentd/include/opentelemetry/exporters/fluentd/common/fluentd_fields.h @@ -34,6 +34,8 @@ # define FLUENT_FIELD_SPAN_KIND "kind" /* Span Kind */ # define FLUENT_FIELD_SPAN_LINKS "links" /* Span Links array */ +# define FLUENT_FIELD_TRACE_STATE "traceState" /* Trace State */ + # define FLUENT_FIELD_PROPERTIES "env_properties" /* Span option constants */ diff --git a/exporters/fluentd/src/trace/recordable.cc b/exporters/fluentd/src/trace/recordable.cc index 77527a8b3..528d28f53 100644 --- a/exporters/fluentd/src/trace/recordable.cc +++ b/exporters/fluentd/src/trace/recordable.cc @@ -53,6 +53,7 @@ void Recordable::SetIdentity( options_[FLUENT_FIELD_SPAN_PARENTID] = std::string(parent_span_id_lower_base16, 16); options_[FLUENT_FIELD_TRACE_ID] = std::string(trace_id_lower_base16, 32); + options_[FLUENT_FIELD_TRACE_STATE] = span_context.trace_state().ToHeader(); } void Recordable::SetAttribute(