-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Have a ForwardPropagator for istio #877
Comments
@romil-punetha Which language are you using for your Otel implementation? |
I think Istio is in GO so moved there, if that is not the case please let me know. |
From our triage session today, this issue seems like it would be more suitable for opentelemetry golang sig which is why it was moved. |
The default tracer is a No-Op tracer, it should implement the behavior you are describing. @romil-punetha are you registering a non-No-Op tracer in your code? Do you have a link to the service code you are displaying above, or maybe an example case that displays the issue? |
I'm not sure that I understand the request here. If, however, what you're looking for is an instrumentation that does not participate in the trace but merely forwards the trace context information then that is perhaps best achieved at an application level by selecting the trace headers to forward at the time a request is received, storing them in a context, and adding them to outbound requests unmodified. I don't believe the default W3C It seems odd to me that we would want to create and maintain a system that expects users to configure an OTel SDK in a manner that takes equivalent effort to actually instrumenting an application and participating in a trace but does not and merely forwards trace context information. Absent a requirement from the specification, I would be opposed to taking on that maintenance overhead when the better course of action is to ensure developers are able to instrument their applications in a way that makes them full participants in the distributed trace. |
Might be a duplicate of #765 |
The Istio control plane is written in Go, but the data plane including Envoy is in C++. This is not the first time I've heard an ask like this regarding Istio. I believe the "distributed tracing via the Service Mesh" is often one of the selling points of Istio, i.e. just auto-inject this Envoy sidecar proxy into every k8s pod, and it will handle distributed tracing for you. What sometimes isn't realized until further investigation is that in order for any of the Envoy-generated spans to participate in the same trace, it is the application's responsibility to at least copy incoming trace headers to the outgoing request. Even without any internal application span generation, I do think there's some value for Istio-based deployments to benefit from a full "service-to-service" trace managed by the Envoy sidecars, which they would do if there were some sort of "forwarding-only" propagator. One possible hacky solution to this which I don't think is explicitly outlawed by the spec, but may need some sort of configuration opt-in, is to change For example, if the existing span context extraction were changed to sc := SpanFromContext(ctx).SpanContext()
if !sc.IsValid() {
sc = RemoteSpanContextFromContext(ctx)
if !sc.IsValid() {
return
}
} I think this would effectively operate as a "passthrough headers" mechanism assuming the propagators were configured correctly. Currently that would likely be the B3 propagator for Istio as there is not an OpenTelemetry tracing addon for Envoy at this point in time. |
I question whether providing a "passthrough headers" mechanism for Istio is something this project should concern itself with. I believe that the effort required to configure any passthrough mechanism would be equivalent to the minimal effort required to actively participate in the trace. The user would need to configure a propagator to be invoked on every incoming request or use an integration such as |
Yes, that's fair enough. It does seem like maintenance effort for something that most devs would end up just switching eventually to the span creation + trace exporter approach. It may seem more daunting due to the still nascent documentation, so perhaps a blog post on OpenTelemetry in Istio would help explain that the increased amount of effort to get full internal span generation is minimal compared to trying to use OpenTelemetry to propagate just the headers. @romil-punetha Do you have more context on issues that may exist in instantiating a span exporter that sends the internally generated traces to the same collector that the Istio Envoy sidecars do? |
With no response from original poster, I suggest we close this issue as Won't Do. |
A super quick observation:
|
For anyone that was interested in this use-case, it is now possible to pass through context without writing spans. See https://github.com/open-telemetry/opentelemetry-go/tree/main/example/passthrough for an example, and explanation. |
When using Otel with istio, the following seems to break the traces:
A --> envoyA(sets headers) --> envoyB(checks and forwards headers) --> B -> Otel(updates spanId and parentSpanID) --> envoyB(checks and updates headers) --> envoyC(checks and forwards headers) -->C
When Otel performs substitution in headers, envoy does it too for all outgoing requests, and sets the parentSpanId to the spanId created by Otel, which was never exported. For every subsequent span, theres an error that parentSpanId doesn't exist as shown in the image.
Having a ForwardPropagator that only forwards the headers in outgoing requests solves this problem.
The text was updated successfully, but these errors were encountered: