-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[pkg/ottl] Add client metadata access to OTTL contexts #41879
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
Changes from 9 commits
426762d
ea6a092
1115d20
b8b2a2a
42cdcc7
8591ad6
e97d305
8b57e4e
7d76b9f
a43ceb3
7193778
c163bdc
1f4539a
db6790b
b2a6240
3e1b8d3
3810065
af0a75f
35a9a74
6e7f6d8
18c6ed3
8931e8b
7d17bf9
d0d7c8d
2a57fd8
5660a83
2dee54e
4f74486
1a75ab8
95cee5e
f08006f
9004c08
c59813b
381d7de
4718508
a0e9b49
2b0cc37
b3e64e7
c28a73d
0fd6a07
31c7c14
c3ebf9a
54956a1
b3620fe
d51ac0e
0035ff0
760e8d7
9069073
2a15616
71b93f3
3685ffa
50be0be
cdeb370
51767b6
6ce11da
2249f33
aa6ff4b
d12427f
0cb2a84
c2f96b4
7834169
163b798
6a02fd5
fc2fc3d
1751526
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: enhancement | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
| component: pkg/ottl | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Added metadata access path to all OTTL contexts for accessing client request metadata | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| issues: [33288] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: | ||
|
|
||
| # If your change doesn't affect end users or the exported elements of any package, | ||
| # you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Context Context (OTTL) | ||
|
|
||
| The Context Context exposes request-related data from the Go `context.Context` passed through the Collector, such as client information and incoming gRPC metadata. Use these paths via the top-level `context` segment, optionally followed by sub-segments. | ||
|
|
||
| ## Paths | ||
|
|
||
| The following paths are supported. | ||
|
|
||
| | path | field accessed | type | | ||
| |------------------------------------|------------------------------------------------------------------------------------------------------------|-------------------| | ||
| | context.client.addr | the remote address string from the client info | string | | ||
| | context.client.metadata | client metadata attached to the request via `go.opentelemetry.io/collector/client` | client.Metadata | | ||
| | context.client.metadata[""] | the first value for a specific metadata key. Returns nil if key missing or has 0 or more than 1 values | string or nil | | ||
| | context.client.auth.attributes | map of all auth attributes extracted from `client.Info.Auth` with values stringified (JSON for non-string) | map[string]string | | ||
| | context.client.auth.attributes[""] | specific auth attribute value as a string (JSON for non-string values). Missing keys return empty string | string | | ||
| | context.grpc.metadata | incoming gRPC metadata from the context (if present) | metadata.MD | | ||
| | context.grpc.metadata[""] | values slice for a specific incoming gRPC metadata key. Returns nil if not present | []string or nil | | ||
|
|
||
| All setters for these paths return an error; the context is read-only within OTTL expressions. | ||
|
|
||
|
|
Uh oh!
There was an error while loading. Please reload this page.