Skip to content

Add traceStateValue parameter to DistributedTracingData.TryDeserializ… #2607

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

otemnov
Copy link

@otemnov otemnov commented Jun 4, 2025

We pass the 'traceparent' value in our asynchronous message communication.
We follow the instructions at https://www.elastic.co/guide/en/apm/get-started/7.10/distributed-tracing.html#_manual_distributed_tracing.
However, it is not possible to restore the 'tracestate' as it is for the Go agent implementation.

In pair 'restart_external' TraceContinuationStrategy, it is not possible to search the logs across services using the original traceid, as each message handling generates anew traceid due to the absence of a tracestate.

The PR suggests a possible solution.

Copy link

cla-checker-service bot commented Jun 4, 2025

💚 CLA has been signed

Copy link

github-actions bot commented Jun 4, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link

github-actions bot commented Jun 4, 2025

👋 @otemnov Thanks a lot for your contribution!

It may take some time before we review a PR, so even if you don’t see activity for some time, it does not mean that we have forgotten about it.

Every once in a while we go through a process of prioritization, after which we are focussing on the tasks that were planned for the upcoming milestone. The prioritization status is typically reflected through the PR labels. It could be pending triage, a candidate for a future milestone, or have a target milestone set to it.

@otemnov
Copy link
Author

otemnov commented Jun 4, 2025

❌ Author of the following commits did not sign a Contributor Agreement: 6ca0563

Please, read and sign the above mentioned agreement if you want to contribute to this project

Signed

@stevejgordon
Copy link
Contributor

Thanks, @otemnov. This looks reasonable, and we should add this. I'd prefer to add a new method rather than amend the existing one. The existing methods are badly named, so I think we could opt to add a better-named factory method for this scenario. Would you mind tweaking the PR to add a method with this signature? We'll leave the original method for backwards compatibility of the existing functionality.

public static DistributedTracingData Create(string traceParent, string traceState)

@otemnov
Copy link
Author

otemnov commented Jun 11, 2025

@stevejgordon thanks!
I've added the Create method, but I've also realised that there is no way to retrieve the tracestate string.
Therefore, I need to add a new method. The name is odd, but it follows the existing convention of SerializeToString()

public string SerializeTraceStateToString() => TraceState?.ToTextHeader();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants