Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADDED] Distributed Message Tracing #5014

Merged
merged 7 commits into from
Feb 8, 2024
Merged

[ADDED] Distributed Message Tracing #5014

merged 7 commits into from
Feb 8, 2024

Commits on Feb 5, 2024

  1. [ADDED] Distributed Message Tracing

    When an incoming message contains the header `Nats-Trace-Dest` set
    to a valid subject, the server will send there messages representing
    events happening in each server where the message is processed.
    
    The events will give details about ingress, subject mapping, stream
    export and service imports, jetstream and egress to subscriptions
    and/or routes, leafnodes and gateways. Except for a standalone server
    it is expected to receive multiple trace messages for a given inbound
    message.
    
    The header `Nats-Trace-Only`, if set to `true`, will produce the
    same tracing events than without that header, except that the message
    will not be delivered to subscriptions or inserted in the JetStream
    stream. This is usefull to see the path that a message would take
    but without affecting running applications.
    
    Note that in a mixed environment where not all servers would be
    running at 2.11+, when a message is supposed to be traced only and
    the remote does not understand message tracing, the message will
    not be forwared and the Egress event for that remote will indicate
    the reason.
    
    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    c3e5cbc View commit details
    Browse the repository at this point in the history
  2. Move unmarshal into server code and add Link to MsgTraceEgress

    Moving the unmarshal to server code helps with the library importing
    the server code and be able to reuse that code.
    Added a Link field to a MsgTraceEgress that the server does not
    do anything with, but library will be able to link trace events
    together.
    
    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    2a822fd View commit details
    Browse the repository at this point in the history
  3. Adding Timestamp to MsgTraceBase

    This way, each event has a timestamp and this can help checking
    latency between an egress in one server and ingress in another.
    
    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    25bc267 View commit details
    Browse the repository at this point in the history
  4. Updates based on code review (without service/stream changes)

    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    085b39b View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Add allow_trace to service exports and stream imports and update tests

    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    7c1341e View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2024

  1. Use protocol version for server connection msg tracing capability

    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    33a5155 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2024

  1. Update copyright

    Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
    kozlovic committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    b2778aa View commit details
    Browse the repository at this point in the history