Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-30789

Enable trace and logs correlation with Datadog tracing

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2021.16
    • Component/s: Monitoring
    • Release Notes Summary:
      Datadog automatic tracing instrumentation supports log correlation
    • Tags:
    • Team:
      PLATFORM
    • Sprint:
      nxplatform #53, nxplatform #54
    • Story Points:
      2

      Description

      To have log events and trace correlation on Datadog when using the automatic instrumentation provided by the DD agent,
      it requires setting a log4j context like:

      import org.apache.logging.log4j.ThreadContext;
      import datadog.trace.api.CorrelationIdentifier;
      
      // There must be spans started and active before this block.
      try {
          ThreadContext.put("dd.trace_id", CorrelationIdentifier.getTraceId());
          ThreadContext.put("dd.span_id", CorrelationIdentifier.getSpanId());
      

      This can be done on our TracingWebFilter.

      References:

      Note, that the correlation is only available on the thread that is executing the HTTP request and is not available on any async processing related to the query.
      This is ok since the automatic instrumentation is not able to trace any async processing.

      In order to trace with the Nuxeo tracing instrumentation that includes the async processing the Nuxeo DD reporter needs to be activated, since NXP-30788 the trace identifiers are propagated to the log.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: