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

Improved Logging and Header Propagation in Orka #339

Merged
merged 12 commits into from
Oct 4, 2023
Merged

Improved Logging and Header Propagation in Orka #339

merged 12 commits into from
Oct 4, 2023

Conversation

nikostoulas
Copy link
Contributor

@nikostoulas nikostoulas commented Oct 3, 2023

Description

The main focus is on improving logging and header propagation.
Non json logger is improved to log all propagated headers.
Messages in RabbitMQ by default now propagated all headers.
Configuration is updated and istioTraceContextHeaders is merged with headerPropagation into a new more generic property: propagatedHeaders
This is not backwards compatible so a major release will need to follow when merging this pr.

Best reviewed commit by commit.

Aoart from propagated headers 3 new headers are introduced:
x-depth -> increased by 1 every time headers are propagated (e.g. to a rabbitmq publish or http call)
x-parent-id -> is the previous traceHeaderName id. The new traceHeaderName id is a new random one and this happens every 2 hops
x-initiator-id -> when a x-parent-id id replaced the initial traceHeaderName is added in the context here so that we can search with the initial id and find all changes

Changes

  • Added and fixed tests for better coverage
  • Updated documentation to reflect the latest changes
  • Improved handling of non-json logs
  • Enhanced header propagation for RabbitMQ handlers
  • Introduced propagatedHeaders and utilities for managing them
  • Deprecated the usage of alsSupported
  • Installed the chalk library for better console outputs
  • Updated RabbitMQ example code to reflect new changes
  • Ensured user-provided headers are not overwritten in Riviere
  • Changed Orka's default requestIds for better traceability

Jira tickets

Before

Screenshot 2023-10-03 at 3 24 04 PM

Performance

Screenshot 2023-10-03 at 7 21 27 PM

After

Screenshot 2023-10-03 at 3 27 04 PM

Performance

Screenshot 2023-10-03 at 7 22 47 PM

Example tests were run:
npx nodemon examples/request-context-example/app.js

Way of running performance tests:
ab -k -n 100000 -c 1 -H 'x-orka-request-id: bar' localhost:2121/log

Performance impact is not insignificant but would be negligible part of an http endpoint that accesses IO operations (e.g. database/ network)

Copy link
Contributor

@manoskouvarakis manoskouvarakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@manoskouvarakis
Copy link
Contributor

@nikostoulas Should we maybe add the breaking changes on readme or it will be a part of another PR?

@nikostoulas
Copy link
Contributor Author

@nikostoulas Should we maybe add the breaking changes on readme or it will be a part of another PR?

You mean the orka's version changelog? Yes it will be part of another one

@nikostoulas nikostoulas merged commit fb6005e into master Oct 4, 2023
4 checks passed
@nikostoulas nikostoulas deleted the logs branch October 4, 2023 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants