Skip to content

Commit

Permalink
avoid needing to change deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Garbett1 committed Jan 10, 2025
1 parent 93c25de commit a1b1e85
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions processor/loghouseprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/maps"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -153,10 +152,23 @@ func promoteResourceAttrs(l *plog.LogRecord, rlogs *plog.ResourceLogs) {
if !ok {
return
}
merged := maps.MergeRawMaps(rlogs.Resource().Attributes().AsRaw(), attributes.Map().AsRaw())
merged := MergeRawMaps(rlogs.Resource().Attributes().AsRaw(), attributes.Map().AsRaw())
rlogs.Resource().Attributes().FromRaw(merged)
}

// MergeRawMaps merges n maps with a later map's keys overriding earlier maps. (copied to avoid dep hell)
func MergeRawMaps(maps ...map[string]any) map[string]any {
ret := map[string]any{}

for _, m := range maps {
for k, v := range m {
ret[k] = v
}
}

return ret
}

// Both funcs copied from: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/contexts/internal/ids.go#L25

func ParseSpanID(spanIDStr string) (pcommon.SpanID, error) {
Expand Down

0 comments on commit a1b1e85

Please sign in to comment.