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
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!
The text was updated successfully, but these errors were encountered:
Hi, @javiaa. Thanks for the suggestion. We can review and discuss this within the APM Agent team. The current behaviour is based on the OTel spec when this feature was initially implemented. The OTel spec now supports adding links after creation; we may opt to align with that.
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.
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!
The text was updated successfully, but these errors were encountered: