Replies: 1 comment 4 replies
-
Reading the docs, I wonder if it would be sufficient for us to start the span with |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are working on instrumenting DurableTask Framework and have a unique use case for a specific span. We need to create and destroy this span multiple times, but only have it recorded on the last time. We know this is counter-intuitive to how spans are supposed to work, but it gives the best experience with DurableTask Orchestrations. A single "end to end" invocation of a DurableTask Orchestration involves going back and forth from the queue multiple times. We call these 'replays'. We do not want to show each replay individually as a span (at least not right now), because while it is more "accurate" it is not very useful. Instead, we want to be creating a span, storing the spanId with the orchestration, then re-hydrating that same span on each replay, with the span only being recorded at the very end of the orchestration.
We thought we could accomplish this by creating the
Activity
then manually swapping outActivity.Current
when we are done and never disposing/stopping the initial activity (until the very end that is). However, we found this relevant text from OTel spec:This means our approach could lead to memory leaks as we were intending to do just that - create a span but never end it.
The question is, how can we accomplish our goal here? How can we stop the span, but have it not be recorded by the SDK?
Beta Was this translation helpful? Give feedback.
All reactions