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

log: Add ValueFromAttribute and KeyValueFromAttribute #6180

Merged
merged 19 commits into from
Jan 22, 2025

Conversation

pellared
Copy link
Member

@pellared pellared commented Jan 20, 2025

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

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.2%. Comparing base (538e869) to head (cf3329c).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #6180   +/-   ##
=====================================
  Coverage   82.2%   82.2%           
=====================================
  Files        273     273           
  Lines      23674   23720   +46     
=====================================
+ Hits       19478   19521   +43     
- Misses      3849    3852    +3     
  Partials     347     347           

see 2 files with indirect coverage changes

log/keyvalue.go Outdated Show resolved Hide resolved
log/keyvalue.go Outdated Show resolved Hide resolved
log/keyvalue.go Outdated Show resolved Hide resolved
log/keyvalue.go Outdated Show resolved Hide resolved
log/keyvalue.go Outdated Show resolved Hide resolved
@pellared pellared requested a review from MrAlias January 21, 2025 16:42
@pellared pellared changed the title log: Add ConvertAttributeValue and ConvertAttributeKeyValue log: Add ValueFromAttribute and KeyValueFromAttribute Jan 21, 2025
log/keyvalue_bench_test.go Outdated Show resolved Hide resolved
@pellared pellared requested a review from MrAlias January 21, 2025 20:47
@pellared pellared merged commit d7ebb7a into open-telemetry:main Jan 22, 2025
31 checks passed
@pellared pellared deleted the logttr-conv branch January 22, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

log: Add a possibility to convert standard attributes to log attributes
4 participants