-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(observability): OpenTelemetry logs #13291
Conversation
724a84a
to
a775404
Compare
5e5257d
to
3621b8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also I suggest not rebase commits when applying reviewing suggestions, we can use the following command for better view for the reviewer.
git commit --fixup <commit_id>
yes absolutely. I wasn't planning to rebase (for now), which will make syncing (via cherry-pick) with the existing EE PR easier as well. |
b0ab33b
to
b5c2ece
Compare
b5c2ece
to
ad0b93c
Compare
fc44de7
to
be23116
Compare
2cd7338
to
6f94ca4
Compare
Spans were not set as "active" during their lifetime. This commit addresses the issue by setting each span as the current "active" span in instrumentations. This is necessary in order to have the correct span_id information in the OTel-formatted log entries.
7e5d680
to
f17eb6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please rebase commits before the merge.
d4d9110
to
1ff59b7
Compare
When a disabled and non-request scoped hook was called outside of a request scope, it was producing an error while trying to index ngx.ctx This commit adds a check to early return from is_group_enabled when outside of the request scope This allows for hooks to still work when used in other contexts where they can be enabled via the always_enable() function This commit also adds support for disabling hooks.
This commit adds OpenTelemetry formatted logs as a new signal supported by the OpenTelemetry plugin. It patches the ngx.log function to collect the logged line and enrich it with additional context info: * severity * introspection details * timestamp And for request-scoped logs also: * Request ID * Trace ID * Span ID * Trace flags The log entries are protobuf-serialized and sent to the endpoint configured in the OpenTelemetry plugin's config.logs_endpoint field. feat(opentelemetry): add traceflags to otel logs This commit collects an additional tracing information (trace flags) in the internal context and adds it to produced OTel-formatted log entries.
This commit moves the tracing and logging core code in the observability folder.
This commit adds unit and integration tests for the OTel-formatted logs feature.
a06b405
to
c1f99a9
Compare
Cherry-pick failed for Please cherry-pick the changes locally. git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-13291-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-13291-to-master-to-upstream
git checkout -b cherry-pick-13291-to-master-to-upstream
ancref=$(git merge-base 8f9b82d870985cdd5fb417d589ad2f7ddec967e4 c1f99a9ff2a5986dbd72e85d9897167df2124b77)
git cherry-pick -x $ancref..c1f99a9ff2a5986dbd72e85d9897167df2124b77 |
docs for Kong/kong#13291 Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: Hans Hübner <hans.huebner@gmail.com>
* feat(OpenTelemetry): support opentelemetry logs docs for Kong/kong#13291 Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: Hans Hübner <hans.huebner@gmail.com> * Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com> * Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com> * Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com> * Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com> * Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com> * Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com> * Update app/_hub/kong-inc/opentelemetry/overview/_index.md Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com> --------- Co-authored-by: Hans Hübner <hans.huebner@gmail.com> Co-authored-by: lena-larionova <54370747+lena-larionova@users.noreply.github.com>
Note for reviewers: commits are split and commented appropriately, I would recommend checking them one by one.
Summary
This PR adds OpenTelemetry formatted logs as a new
signal supported by the OpenTelemetry plugin.
It patches the
ngx.log
function (and adapts kong PDK log) to collect the logged lines andenrich them with additional context info:
And for request-scoped logs also:
The log entries are protobuf-serialized and sent to the endpoint
configured in the OpenTelemetry plugin's
config.logs_endpoint
field.Checklist
CHANGELOG/unreleased/kong
or addingskip-changelog
label on PR if unnecessary. README.mdIssue reference
KAG-4712