-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for span links to Jaeger export. #1251
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,33 @@ void JaegerRecordable::SetInstrumentationLibrary( | |
void JaegerRecordable::AddLink(const trace::SpanContext &span_context, | ||
const common::KeyValueIterable &attributes) noexcept | ||
{ | ||
// TODO: convert link to SpanRefernece | ||
// Note: "The Link’s attributes cannot be represented in Jaeger explicitly." | ||
// -- https://opentelemetry.io/docs/reference/specification/trace/sdk_exporters/jaeger/#links | ||
// | ||
// This implementation does not (currently) implement the optional conversion to span logs. | ||
|
||
thrift::SpanRef reference; | ||
|
||
reference.__set_refType(thrift::SpanRefType::FOLLOWS_FROM); | ||
|
||
// IDs should be converted to big endian before transmission. | ||
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk_exporters/jaeger.md#ids | ||
#if JAEGER_IS_LITTLE_ENDIAN == 1 | ||
reference.__set_traceIdHigh( | ||
otel_bswap_64(*(reinterpret_cast<const int64_t *>(span_context.trace_id().Id().data())))); | ||
reference.__set_traceIdLow( | ||
otel_bswap_64(*(reinterpret_cast<const int64_t *>(span_context.trace_id().Id().data()) + 1))); | ||
reference.__set_spanId( | ||
otel_bswap_64(*(reinterpret_cast<const int64_t *>(span_context.span_id().Id().data())))); | ||
#else | ||
reference.__set_traceIdLow( | ||
*(reinterpret_cast<const int64_t *>(span_context.trace_id().Id().data()))); | ||
reference.__set_traceIdHigh( | ||
*(reinterpret_cast<const int64_t *>(span_context.trace_id().Id().data()) + 1)); | ||
reference.__set_spanId(*(reinterpret_cast<const int64_t *>(span_context.span_id().Id().data()))); | ||
#endif | ||
lalitb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
references_.push_back(reference); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how will this list of links get exported to the backend? Does some code need to be added in ThriftSender::Append() to do that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! I missed a line when I pulled the changes over. Added: https://github.com/open-telemetry/opentelemetry-cpp/pull/1251/files#diff-3fc4e4d4cb58766986df79016e29275bf3712c2fdcda74c598152f42598bf546R43 |
||
} | ||
|
||
void JaegerRecordable::SetStatus(trace::StatusCode code, nostd::string_view description) noexcept | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems
SpanRef
s are not attached tojaeger_span
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! I goofed and missed bringing over a line. Added: https://github.com/open-telemetry/opentelemetry-cpp/pull/1251/files#diff-3fc4e4d4cb58766986df79016e29275bf3712c2fdcda74c598152f42598bf546R43
(and made sure nothing else is missing)