Check for OpenTelemetry support through handshake

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • 4
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Each new connection should include `$traceCtx` in hellos (when OTEL is supported) to validate support on the remote node.

      The mongodb hello command is permissive : it allows (and ignore) unexpected fields. This is not generally true for all commands (i.e. if we add $traceCtx to find and the remote node does not support OTEL it will fail the command). We want to ensure :

      • Whenever possible we forward traceCtx to have the most complete traces possible in multiversion clusters.
      • Only send $traceCtx in the first hello and to node that support $traceCtx.

      Therefore, the suggested protocol is :

      1. If the local node supports OpenTelemetry, always include $traceCtx (generate a new trace context if needed) in the hanshake hello
      2. If the remote node supports OpenTelemetry, return {tracingSupport: true}. If the remote node does not support OTEL, it ignores the $traceCtx field and does not return tracingSupport.
      1. On the local node, mark the remote node as "supportOTEL" if it returns {tracingSupport: true}

       

      Acceptance criteria:

      • In handshake hello, include a field (doesn't have to be $traceCtx) to signify we are trying to determine if the other node has OTEL enabled. This will require input from N&O team for the best place to do this. Reference point where we could do this.
      • On response add to set of connection->OTEL enabled. Again this will require input from N&O around where it would be safest to do this.
      • On any outgoing subsequent request (SERVER-100127), use this set to determine if we should add $traceCtx.
      • Update applicable unit tests.

            Assignee:
            Unassigned
            Reporter:
            Didier Nadeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: