-
Notifications
You must be signed in to change notification settings - Fork 896
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
Logs API to have ergonomics for reusing Standard Attributes #4373
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Trask Stalnaker <[email protected]>
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. Left a nit comment/question, not a blocker.
Fixes #6158 Related spec PR: open-telemetry/opentelemetry-specification#4373 Benchmark results: ``` goos: linux goarch: amd64 pkg: go.opentelemetry.io/otel/log cpu: 13th Gen Intel(R) Core(TM) i7-13800H BenchmarkKeyValueFromAttribute/Empty-20 72029505 16.47 ns/op 0 B/op 0 allocs/op BenchmarkKeyValueFromAttribute/Bool-20 68560222 16.99 ns/op 0 B/op 0 allocs/op BenchmarkKeyValueFromAttribute/BoolSlice-20 14647401 76.21 ns/op 50 B/op 2 allocs/op BenchmarkKeyValueFromAttribute/Int64-20 70737378 16.92 ns/op 0 B/op 0 allocs/op BenchmarkKeyValueFromAttribute/Int64Slice-20 16780069 96.87 ns/op 64 B/op 2 allocs/op BenchmarkKeyValueFromAttribute/Float64-20 59299638 16.93 ns/op 0 B/op 0 allocs/op BenchmarkKeyValueFromAttribute/Float64Slice-20 12691222 106.2 ns/op 64 B/op 2 allocs/op BenchmarkKeyValueFromAttribute/String-20 63837711 16.97 ns/op 0 B/op 0 allocs/op BenchmarkKeyValueFromAttribute/StringSlice-20 9251001 114.7 ns/op 80 B/op 2 allocs/op PASS ok go.opentelemetry.io/otel/log 14.776s ```
The API SHOULD provide ergonomics so that the caller can use | ||
[Standard Attributes](../common/README.md#standard-attribute) | ||
along with [Log Attributes](./data-model.md#field-attributes) | ||
of [type `map<string, any>`](./data-model.md#type-mapstring-any). | ||
This allows the reuse of [Standard Attributes](../common/README.md#standard-attribute) | ||
across signals. | ||
This can be converting functions, method overloads, etc. |
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.
Ergonomics is the study of people's efficiency in their working environment. Can we be more explicit about what is being recommended here?
The API SHOULD provide ergonomics so that the caller can use | |
[Standard Attributes](../common/README.md#standard-attribute) | |
along with [Log Attributes](./data-model.md#field-attributes) | |
of [type `map<string, any>`](./data-model.md#type-mapstring-any). | |
This allows the reuse of [Standard Attributes](../common/README.md#standard-attribute) | |
across signals. | |
This can be converting functions, method overloads, etc. | |
The API SHOULD provide functionality for users to convert from | |
[Standard Attributes](../common/README.md#standard-attribute) | |
to [Log Attributes](./data-model.md#field-attributes) | |
of [type `map<string, any>`](./data-model.md#type-mapstring-any). | |
This allows the reuse of [Standard Attributes](../common/README.md#standard-attribute) | |
across signals. |
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.
TIL 👍
What do you think of
The API SHOULD provide ergonomics so that the caller can use | |
[Standard Attributes](../common/README.md#standard-attribute) | |
along with [Log Attributes](./data-model.md#field-attributes) | |
of [type `map<string, any>`](./data-model.md#type-mapstring-any). | |
This allows the reuse of [Standard Attributes](../common/README.md#standard-attribute) | |
across signals. | |
This can be converting functions, method overloads, etc. | |
The API SHOULD provide functionality so that the caller can use | |
[Standard Attributes](../common/README.md#standard-attribute) | |
along with [Log Attributes](./data-model.md#field-attributes) | |
of [type `map<string, any>`](./data-model.md#type-mapstring-any). | |
This allows the reuse of [Standard Attributes](../common/README.md#standard-attribute) | |
across signals. | |
This can be converting functions, method overloads, etc. |
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.
The last sentence is redundant. "Functionality" is used throughout the specification to imply what that sentence is saying.
Also, we do not plan for users to use standard attributes along with log attributes. We plan for them to convert standard attributes into log attributes and use those.
[1]: **Status**: [Development](../document-status.md) - | ||
The API SHOULD provide ergonomics so that the caller can use |
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.
Having a normative recommendation in a note makes this easy to miss. We should make it clear in its own paragraph.
[1]: **Status**: [Development](../document-status.md) - | |
The API SHOULD provide ergonomics so that the caller can use | |
[1]: **Status**: [Development](../document-status.md) | |
The API SHOULD provide ergonomics so that the caller can use |
Fixes #4201
Reference implementations:
Related Slack thread: https://cloud-native.slack.com/archives/C062HUREGUV/p1736545245331779