You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
Fix instrumentation lib version in spanDataToThrift (#1037)
* Fix instrumentation lib version in spanDataToThrift * Update CHANGELOG.md * Use test value for lib version in accordance with the spec Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||
### Fixed
|
||||
|
||||
- The `semconv.HTTPServerMetricAttributesFromHTTPRequest()` function no longer generates the high-cardinality `http.request.content.length` label. (#1031)
|
||||
- Correct instrumentation version tag in Jaeger exporter. (#1037)
|
||||
|
||||
## [0.10.0] - 2020-07-29
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ func spanDataToThrift(data *export.SpanData) *gen.Span {
|
||||
if il := data.InstrumentationLibrary; il.Name != "" {
|
||||
tags = append(tags, getStringTag("instrumentation.name", il.Name))
|
||||
if il.Version != "" {
|
||||
tags = append(tags, getStringTag("instrumentation.version", il.Name))
|
||||
tags = append(tags, getStringTag("instrumentation.version", il.Version))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
gen "go.opentelemetry.io/otel/exporters/trace/jaeger/internal/gen-go/jaeger"
|
||||
ottest "go.opentelemetry.io/otel/internal/testing"
|
||||
export "go.opentelemetry.io/otel/sdk/export/trace"
|
||||
"go.opentelemetry.io/otel/sdk/instrumentation"
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
@@ -373,6 +374,8 @@ func Test_spanDataToThrift(t *testing.T) {
|
||||
spanKind := "client"
|
||||
rv1 := "rv11"
|
||||
rv2 := int64(5)
|
||||
instrLibName := "instrumentation-library"
|
||||
instrLibVersion := "semver:1.0.0"
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -410,6 +413,10 @@ func Test_spanDataToThrift(t *testing.T) {
|
||||
StatusMessage: statusMessage,
|
||||
SpanKind: apitrace.SpanKindClient,
|
||||
Resource: resource.New(kv.String("rk1", rv1), kv.Int64("rk2", rv2)),
|
||||
InstrumentationLibrary: instrumentation.Library{
|
||||
Name: instrLibName,
|
||||
Version: instrLibVersion,
|
||||
},
|
||||
},
|
||||
want: &gen.Span{
|
||||
TraceIdLow: 651345242494996240,
|
||||
@@ -423,6 +430,8 @@ func Test_spanDataToThrift(t *testing.T) {
|
||||
{Key: "key", VType: gen.TagType_STRING, VStr: &keyValue},
|
||||
{Key: "uint", VType: gen.TagType_LONG, VLong: &uintValue},
|
||||
{Key: "error", VType: gen.TagType_BOOL, VBool: &boolTrue},
|
||||
{Key: "instrumentation.name", VType: gen.TagType_STRING, VStr: &instrLibName},
|
||||
{Key: "instrumentation.version", VType: gen.TagType_STRING, VStr: &instrLibVersion},
|
||||
{Key: "status.code", VType: gen.TagType_LONG, VLong: &statusCodeValue},
|
||||
{Key: "status.message", VType: gen.TagType_STRING, VStr: &statusMessage},
|
||||
{Key: "span.kind", VType: gen.TagType_STRING, VStr: &spanKind},
|
||||
|
||||
Reference in New Issue
Block a user