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

AddLink to CurrentTransaction #2477

Open
javiaa opened this issue Nov 5, 2024 · 0 comments
Open

AddLink to CurrentTransaction #2477

javiaa opened this issue Nov 5, 2024 · 0 comments
Labels

Comments

@javiaa
Copy link

javiaa commented Nov 5, 2024

Hi,

We would like to add an span link to the current transaction so the root span has a link to another transaction.
We have not find a good way of doing so.
We have seen that the CurrentTransaction has a inaccessible 'Links' property with a list of links.
In fact using reflection we have been able to add a link, but of course this is not a solution for production.

var links = Agent.Tracer.CurrentTransaction.GetType().GetProperty("Links");
links?.SetValue(Agent.Tracer.CurrentTransaction, new List<SpanLink>
  { new (parentContext.SpanId.ToString(), parentContext.TraceId.ToString()) });

For the moment we are relying on capturing a child span and we are adding the link there, but we would like to have an AddLink function on the CurrentTransaciton to be able to add the link from there.

Thanks!

@javiaa javiaa added the enhancement New feature or request label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant