Skip to content

Commit 574561e

Browse files
authored
otel: Fix minor bugs (#5969)
1 parent f483932 commit 574561e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/normalizer/otel.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ func (n *labelNames) addOtelAttributes(attrs []*v1.KeyValue) {
8383
}
8484
}
8585

86-
func (n *labelNames) addOtelAttributesFromTable(attrs []*v1.KeyValue, idxs []int32) {
86+
func (n *labelNames) addOtelAttributesFromTable(stringTable []string, attrs []*otelprofilingpb.KeyValueAndUnit, idxs []int32) {
8787
for _, idx := range idxs {
8888
attr := attrs[idx]
8989
if strings.TrimSpace(attr.Value.GetStringValue()) != "" {
90-
n.addLabel(attr.Key)
90+
n.addLabel(stringTable[attr.KeyStrindex])
9191
}
9292
}
9393
}
@@ -141,10 +141,10 @@ func getAllLabelNames(req *otelgrpcprofilingpb.ExportProfilesServiceRequest) []s
141141
allLabelNames.addOtelAttributes(sp.Scope.Attributes)
142142

143143
for _, p := range sp.Profiles {
144-
allLabelNames.addOtelAttributesFromTable(sp.Scope.Attributes, p.AttributeIndices)
144+
allLabelNames.addOtelAttributesFromTable(req.Dictionary.StringTable, req.Dictionary.AttributeTable, p.AttributeIndices)
145145

146146
for _, sample := range p.Sample {
147-
allLabelNames.addOtelAttributesFromTable(sp.Scope.Attributes, sample.AttributeIndices)
147+
allLabelNames.addOtelAttributesFromTable(req.Dictionary.StringTable, req.Dictionary.AttributeTable, sample.AttributeIndices)
148148
}
149149
}
150150
}

0 commit comments

Comments
 (0)