Replies: 1 comment
-
Sorry this code is working, an error was being thrown before this code was called so that is why I wasn't seeing it. Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm adding AddAspNetCoreInstrumentation() to auto instrument incoming requests and I was wondering how I could enrich or add to the trace with a custom trace tag for specific requests. So I'm not trying to add anything globally, but just enrich specific traces with a custom tag. Since I'm auto-instrumenting inbound HTTP requests, is there a way to create a new tag for specific requests? I have an example below of what I've tried with
Activity.Current?.SetTag("user.cartid", id);
but doesn't seem to work.[HttpPost("{id}")]
public async Task<string> Create(Guid id, int portalId, int userId, IEnumerable<CartItemEntity>? cartItems)
{
var result = await _cartService.CreateCart(id, portalId, userId, cartItems);
Activity.Current?.SetTag("user.cartid", id);
return result.ToString();
}
Beta Was this translation helpful? Give feedback.
All reactions