Skip to content

Commit

Permalink
Reintroduce the InstrumentationLibrary to Scope translation for logs
Browse files Browse the repository at this point in the history
partially reverts d7b097c
  • Loading branch information
krdln authored and kwapik committed Oct 14, 2022
1 parent 9cf80fc commit b82d435
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pdata/internal/otlp/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ import (

// MigrateLogs implements any translation needed due to deprecation in OTLP logs protocol.
// Any plog.Unmarshaler implementation from OTLP (proto/json) MUST call this, and the gRPC Server implementation.
func MigrateLogs(_ []*otlplogs.ResourceLogs) {}
func MigrateLogs(rls []*otlplogs.ResourceLogs) {
for _, rl := range rls {
if len(rl.ScopeLogs) == 0 {
rl.ScopeLogs = rl.InstrumentationLibraryLogs
rl.InstrumentationLibraryLogs = nil
}
}
}

0 comments on commit b82d435

Please sign in to comment.