Open Closed

Passing Trace ID in Headers from Event Handlers to App Services in ABP #9285


User avatar
0
ElifKaya created

Hi,

In our project, we aim to include traceId in all logs. Therefore, when sending requests from Event Handler classes to app services, we need to pass traceId in the header. Although adding traceId as a parameter to the input object would be a straightforward solution, we prefer not to modify the input object. Is there a way to send traceId in the header for requests from the Handler to the app service in ABP? When I debug, I notice that _httpContextAccessor is null in the app service.

I could potentially add TraceParent as an extra property in PublishInput, or create a separate method like PublishAsyncWithTrace. However, if there's a better way in ABP to pass traceId between the handler and app service, I'd prefer to use that.

Check the docs before asking a question: https://abp.io/docs/latest Check the samples to see the basic tasks: https://abp.io/docs/latest/samples The exact solution to your question may have been answered before, and please first use the search on the homepage.

Provide us with the following info: 🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.

  • Exception message and full stack trace:
  • Steps to reproduce the issue:

No answer yet!
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37