Connecting logs with traces
See original GitHub issueFirst of all, I’d like to apologise for asking a question in an issue tracker.
I have what I think is a very simple use case, but I can’t find a way to do it. I have a fetch()
call that, if it fails, should log the trace id, so that when searching for the trace id in Datadog, I am able to see both the request to https://my-domain.com and the error log:
fetch('https://my-domain.com')
.catch(error => {
logger.error('Request failed. Your error id is ${trace_id here}');
});
How can I get the current trace id and inject it into the log? Do you think I shouldn’t be using trace ids for this?
Thanks.
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Connect Logs and Traces - Datadog Docs
Before correlating traces with logs, ensure your logs are either sent as JSON, or parsed by the proper language level log processor. Your...
Read more >Connecting log data to traces | Dynatrace Docs
Automatically connecting log data to traces works for all log data, no matter how the log data was ingested by Dynatrace. You can...
Read more >Correlate logs and traces - Logz.io Docs
Correlating Logs and Traces ... To manage log index patterns, click Index patterns and go to your default index pattern settings. ... Search...
Read more >Viewing Logs and Traces - SAP Help Portal
The Trace Logs Details window appears with log messages and trace information. Click Download to download a text file of the trace information...
Read more >How to easily correlate logs and APM traces for better ... - Elastic
Click on "Show trace logs". Et voila: Now you can see the logs associated with the trace in Elastic APM. These messages are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see. For now, this is the only way to get the trace_id but having another API to handle your use case could be considered at some point.
For the initial question, https://github.com/DataDog/browser-sdk/issues/1061#issuecomment-1363086661 would be the recommended approach.
@hipitihop your topic seems a bit different, please open a separate issue if you still need assistance.