You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the scenario where OpenTelemetry tracing is being using in .Net9 (console environment), and that in turn is performing interop (to Rust) via code generated P/Invoke, that in turn is also using Rust's OpenTelemetry implementation, I'm unsure how to hook things together.
The plan is to have both .Net and Rust are fire up OTEL exporters (as hosted from Aspire) - to the same endpoint (given the requisite Environment Variables).
What is the recommendation/format and when doing get it, for passing the activity context over the p/Invoke boundary, such that any tracking in the Rust code will align correctly in the context of the .Net code (with the OTEL collector - and displayed in Aspire), as sub activities until the interop calls to Rust return.
It's assumed that there is also a way to inject the requisite values into the Context the Rust side of things.
I ran into this, but note sure if there is any guidance on what is the correct approach.
The theroreical assumption as it stands is to use the TextPropagator on each end, and Extract the hash map from .Net, send that though the P/Invoke, to Rust and have Rust Inject the hash map into it's propagator.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the scenario where OpenTelemetry tracing is being using in .Net9 (console environment), and that in turn is performing interop (to Rust) via code generated P/Invoke, that in turn is also using Rust's OpenTelemetry implementation, I'm unsure how to hook things together.
The plan is to have both .Net and Rust are fire up OTEL exporters (as hosted from Aspire) - to the same endpoint (given the requisite Environment Variables).
What is the recommendation/format and when doing get it, for passing the activity context over the p/Invoke boundary, such that any tracking in the Rust code will align correctly in the context of the .Net code (with the OTEL collector - and displayed in Aspire), as sub activities until the interop calls to Rust return.
It's assumed that there is also a way to inject the requisite values into the Context the Rust side of things.
I ran into this, but note sure if there is any guidance on what is the correct approach.
The theroreical assumption as it stands is to use the
TextPropagator
on each end, andExtract
the hash map from .Net, send that though the P/Invoke, to Rust and have RustInject
the hash map into it's propagator.Beta Was this translation helpful? Give feedback.
All reactions