diff --git a/exporters/fluentd/src/trace/recordable.cc b/exporters/fluentd/src/trace/recordable.cc index 7b5c9b61c..010c02d4e 100644 --- a/exporters/fluentd/src/trace/recordable.cc +++ b/exporters/fluentd/src/trace/recordable.cc @@ -25,12 +25,13 @@ template static inline json create_message(T ts, json body) { } // constexpr needs keys to be constexpr, const is next best to use. -static const std::map +static const std::map kSpanKindMap = { - {opentelemetry::trace::SpanKind::kClient, "CLIENT"}, - {opentelemetry::trace::SpanKind::kServer, "SERVER"}, - {opentelemetry::trace::SpanKind::kConsumer, "CONSUMER"}, - {opentelemetry::trace::SpanKind::kProducer, "PRODUCER"}, + {opentelemetry::trace::SpanKind::kInternal, 0}, + {opentelemetry::trace::SpanKind::kServer, 1}, + {opentelemetry::trace::SpanKind::kClient, 2}, + {opentelemetry::trace::SpanKind::kProducer, 3}, + {opentelemetry::trace::SpanKind::kConsumer, 4}, }; // @@ -91,10 +92,11 @@ void Recordable::AddLink( void Recordable::SetStatus(opentelemetry::trace::StatusCode code, nostd::string_view description) noexcept { + options_[FLUENT_FIELD_SUCCESS] = code != opentelemetry::trace::StatusCode::kError; if (code != opentelemetry::trace::StatusCode::kUnset) { options_["tags"]["otel.status_code"] = code; if (code == opentelemetry::trace::StatusCode::kError) { - options_["tags"]["error"] = description; + options_[FLUENT_FIELD_STATUSMESSAGE] = description; } } }