Skip to content
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

[WIP] Enabling nested spans for trace mode OpenTelemetry #222

Closed
wants to merge 5 commits into from

Conversation

oandreeva-nv
Copy link
Contributor

@oandreeva-nv oandreeva-nv commented Jun 9, 2023

This PR enables nested spans for trace mode OpenTelemetry. Major changes are:

  • I moved InferenceTraceMode from server to core as TRITONSERVER_InferenceTraceMode
  • Added TRITONSERVER_InferenceTraceWithModeNew, to create a trace instance with provided mode + refactored TRITONSERVER_InferenceTraceTensorNew and TRITONSERVER_InferenceTraceNew to remove repeated code.
  • TRITONSERVER_InferenceTraceSetOpenTelemetryTracer and TRITONSERVER_InferenceTraceSetOpenTelemetryContext to pass OpenTelemetry's tracer and context to core's trace instance. These 2 objects are necessary for span creation (tracer) and storing info about currently active span and time_offset (created on the server side).
  • I tritonserver.h ran through cclang, so it has a lot of cclang related changes

Current logic : on the core side I create 2 spans: Request span, which has the same name as the model, this request is sent to, and compute span, which holds compute related timestamps and events and represents the amount of time compute took:

How it looks:
image
image

Note: this PR should be merged with server's PR: triton-inference-server/server#5928

@@ -50,6 +50,12 @@
#include "triton/common/triton_json.h"
#include "tritonserver_apis.h"

#ifndef _WIN32
#include "opentelemetry/sdk/trace/tracer.h"
namespace otel_trace_api = opentelemetry::trace;
Copy link
Contributor

@rmccorm4 rmccorm4 Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oandreeva-nv in your screenshot examples, why are they labeled "unknown_service"? Is there some label we can put in the source to have these say "Triton" or something in the collector/UI view if there is no label already set?

(i.e. if supporting passing existing span/context in the future, maybe that would have some label associated with it, I'm not sure how those APIs look)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's due to the jaeger. I was planning to investigate if we can do something with this on our side, or if it is something, that need to be addressed on the collector's side

@oandreeva-nv oandreeva-nv changed the title Enabling nested spans for trace mode OpenTelemetry [WIP] Enabling nested spans for trace mode OpenTelemetry Jun 12, 2023
@oandreeva-nv
Copy link
Contributor Author

Working on the doc for discussions

@oandreeva-nv
Copy link
Contributor Author

Closing: moved this logic to server side

@oandreeva-nv oandreeva-nv deleted the oandreeva_otel_nested_spans branch February 12, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants