lib/opentelemetry/exporter/jaeger/encoder.rb in opentelemetry-exporter-jaeger-0.6.0 vs lib/opentelemetry/exporter/jaeger/encoder.rb in opentelemetry-exporter-jaeger-0.7.0

- old
+ new

@@ -117,19 +117,26 @@ ) end end def encoded_status(status) - # TODO: OpenTracing doesn't specify how to report non-HTTP (i.e. generic) status. - EMPTY_ARRAY + return EMPTY_ARRAY unless status&.canonical_code == OpenTelemetry::Trace::Status::ERROR + + Array( + Thrift::Tag.new( + KEY => 'error', + TYPE => Thrift::TagType::BOOL, + BOOL => true + ) + ) end def encoded_instrumentation_library(instrumentation_library) return EMPTY_ARRAY unless instrumentation_library tags = [] - tags << encoded_tag('otel.instrumentation_library.name', instrumentation_library.name) if instrumentation_library.name - tags << encoded_tag('otel.instrumentation_library.version', instrumentation_library.version) if instrumentation_library.version + tags << encoded_tag('otel.library.name', instrumentation_library.name) if instrumentation_library.name + tags << encoded_tag('otel.library.version', instrumentation_library.version) if instrumentation_library.version tags end def int64(byte_string) int = byte_string.unpack1('Q>')