Chore(deps): Bump go.opentelemetry.io/collector from 0.22.0 to 0.25.0 (#33365)
* Chore(deps): Bump go.opentelemetry.io/collector from 0.22.0 to 0.25.0 Bumps [go.opentelemetry.io/collector](https://github.com/open-telemetry/opentelemetry-collector) from 0.22.0 to 0.25.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-collector/compare/v0.22.0...v0.25.0) Signed-off-by: dependabot[bot] <support@github.com> * Apply changes to tempo code Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
co-authored by
Zoltán Bedi
parent
e8707944a3
commit
8dea72a763
@@ -72,8 +72,7 @@ func (e *tempoExecutor) DataQuery(ctx context.Context, dsInfo *models.DataSource
|
||||
}, nil
|
||||
}
|
||||
|
||||
otTrace := ot_pdata.NewTraces()
|
||||
err = otTrace.FromOtlpProtoBytes(body)
|
||||
otTrace, err := ot_pdata.TracesFromOtlpProtoBytes(body)
|
||||
|
||||
if err != nil {
|
||||
return plugins.DataResponse{}, fmt.Errorf("failed to convert tempo response to Otlp: %w", err)
|
||||
|
||||
@@ -113,7 +113,7 @@ func spanToSpanRow(span pdata.Span, libraryTags pdata.InstrumentationLibrary, re
|
||||
|
||||
// Should get error only if empty in which case we are ok with empty string
|
||||
parentSpanID, _ := spanIDToString(span.ParentSpanID())
|
||||
startTime := float64(span.StartTime()) / 1_000_000
|
||||
startTime := float64(span.StartTimestamp()) / 1_000_000
|
||||
serviceName, serviceTags := resourceToProcess(resource)
|
||||
|
||||
serviceTagsJson, err := json.Marshal(serviceTags)
|
||||
@@ -139,7 +139,7 @@ func spanToSpanRow(span pdata.Span, libraryTags pdata.InstrumentationLibrary, re
|
||||
serviceName,
|
||||
toJSONString(serviceTagsJson),
|
||||
startTime,
|
||||
float64(span.EndTime()-span.StartTime()) / 1_000_000,
|
||||
float64(span.EndTimestamp()-span.StartTimestamp()) / 1_000_000,
|
||||
toJSONString(logs),
|
||||
toJSONString(spanTags),
|
||||
}, nil
|
||||
@@ -178,11 +178,12 @@ func resourceToProcess(resource pdata.Resource) (string, []*KeyValue) {
|
||||
}
|
||||
|
||||
tags := make([]*KeyValue, 0, attrs.Len()-1)
|
||||
attrs.ForEach(func(key string, attr pdata.AttributeValue) {
|
||||
attrs.Range(func(key string, attr pdata.AttributeValue) bool {
|
||||
if key == conventions.AttributeServiceName {
|
||||
serviceName = attr.StringVal()
|
||||
}
|
||||
tags = append(tags, &KeyValue{Key: key, Value: getAttributeVal(attr)})
|
||||
return true
|
||||
})
|
||||
|
||||
return serviceName, tags
|
||||
@@ -212,8 +213,9 @@ func getSpanTags(span pdata.Span, instrumentationLibrary pdata.InstrumentationLi
|
||||
if libraryTags != nil {
|
||||
tags = append(tags, libraryTags...)
|
||||
}
|
||||
span.Attributes().ForEach(func(key string, attr pdata.AttributeValue) {
|
||||
span.Attributes().Range(func(key string, attr pdata.AttributeValue) bool {
|
||||
tags = append(tags, &KeyValue{Key: key, Value: getAttributeVal(attr)})
|
||||
return true
|
||||
})
|
||||
|
||||
status := span.Status()
|
||||
@@ -328,8 +330,9 @@ func spanEventsToLogs(events pdata.SpanEventSlice) []*TraceLog {
|
||||
Value: event.Name(),
|
||||
})
|
||||
}
|
||||
event.Attributes().ForEach(func(key string, attr pdata.AttributeValue) {
|
||||
event.Attributes().Range(func(key string, attr pdata.AttributeValue) bool {
|
||||
fields = append(fields, &KeyValue{Key: key, Value: getAttributeVal(attr)})
|
||||
return true
|
||||
})
|
||||
logs = append(logs, &TraceLog{
|
||||
Timestamp: float64(event.Timestamp()) / 1_000_000,
|
||||
|
||||
@@ -19,8 +19,7 @@ func TestTraceToFrame(t *testing.T) {
|
||||
proto, err := ioutil.ReadFile("testData/tempo_proto_response")
|
||||
require.NoError(t, err)
|
||||
|
||||
otTrace := ot_pdata.NewTraces()
|
||||
err = otTrace.FromOtlpProtoBytes(proto)
|
||||
otTrace, err := ot_pdata.TracesFromOtlpProtoBytes(proto)
|
||||
require.NoError(t, err)
|
||||
|
||||
frame, err := TraceToFrame(otTrace)
|
||||
|
||||
Reference in New Issue
Block a user