Associating Traces with Logs
Application Scope
Common log frameworks, such as Logback and Log4j.
Example
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS}} | gtraceid: %X{apm-gtraceid} | traceid: %X{apm-traceid} | spanId: %X{apm-spanid}">
</property>
Trace Parameters
- apm-traceid: unique ID of a trace collected by APM.
Figure 1 Unique ID of a trace
- apm-gtraceid: unique ID of a trace which is not sampled.
APM has a certain sampling ratio. The apm-gtrace-id parameter is used to uniquely identify a trace that is not sampled.
- apm-spanid: ID of a microservice called in a trace. Example:
Figure 2 Calls between microservices
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot