1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-07 23:02:15 +02:00
opentelemetry-go/internal/shared/otlp/otlplog/transform
pree-dew 534ce5ab09
Fix duplicate logs across resources (#5803)
1. Create scope map with resource key to map the correct log record. 
2. Add test case with different resource and scope combination

Fixes #5782 

### Benchmarks

```
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/transform
               │   old.txt   │               new.txt               │
               │   sec/op    │   sec/op     vs base                │
ResourceLogs-8   3.266µ ± 3%   1.100µ ± 5%  -66.33% (p=0.000 n=10)

               │   old.txt    │               new.txt                │
               │     B/op     │     B/op      vs base                │
ResourceLogs-8   8.297Ki ± 0%   2.430Ki ± 0%  -70.72% (p=0.000 n=10)

               │   old.txt   │              new.txt               │
               │  allocs/op  │ allocs/op   vs base                │
ResourceLogs-8   178.00 ± 0%   52.00 ± 0%  -70.79% (p=0.000 n=10)
```

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-09-17 13:12:49 +02:00
..
attr_test.go.tmpl Generate internal/transform in otlploggrpc (#5553) 2024-06-28 10:15:35 +02:00
log_attr_test.go.tmpl Generate internal/transform in otlploggrpc (#5553) 2024-06-28 10:15:35 +02:00
log_test.go.tmpl Fix duplicate logs across resources (#5803) 2024-09-17 13:12:49 +02:00
log.go.tmpl Fix duplicate logs across resources (#5803) 2024-09-17 13:12:49 +02:00