Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Zipkin attribute names for the ot to otel #1201

Merged
merged 2 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
`go.opentelemetry.io/otel/api/metric.ConfigureMeter` to `NewMeterConfig`.
- Move the `go.opentelemetry.io/otel/api/unit` package to `go.opentelemetry.io/otel/unit`. (#1185)
- Renamed `SamplingDecision` values to comply with OpenTelemetry specification change. (#1192)
- Renamed Zipkin attribute names from `ot.status_code & ot.status_description` to `otel.status_code & otel.status_description`. (#1201)

### Removed

Expand Down
8 changes: 4 additions & 4 deletions exporters/trace/zipkin/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func attributesToJSONMapString(attributes []label.KeyValue) string {

// extraZipkinTags are those that may be added to every outgoing span
var extraZipkinTags = []string{
"ot.status_code",
"ot.status_description",
"otel.status_code",
"otel.status_description",
keyInstrumentationLibraryName,
keyInstrumentationLibraryVersion,
}
Expand All @@ -153,8 +153,8 @@ func toZipkinTags(data *export.SpanData) map[string]string {
if v, ok := m["error"]; ok && v == "false" {
delete(m, "error")
}
m["ot.status_code"] = data.StatusCode.String()
m["ot.status_description"] = data.StatusMessage
m["otel.status_code"] = data.StatusCode.String()
m["otel.status_description"] = data.StatusMessage

if il := data.InstrumentationLibrary; il.Name != "" {
m[keyInstrumentationLibraryName] = il.Name
Expand Down
108 changes: 54 additions & 54 deletions exporters/trace/zipkin/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data with no parent
Expand Down Expand Up @@ -383,10 +383,10 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data of unspecified kind
Expand Down Expand Up @@ -422,10 +422,10 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data of internal kind
Expand Down Expand Up @@ -461,10 +461,10 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data of client kind
Expand Down Expand Up @@ -500,10 +500,10 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data of producer kind
Expand Down Expand Up @@ -539,10 +539,10 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data of consumer kind
Expand Down Expand Up @@ -578,10 +578,10 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data with no events
Expand All @@ -608,10 +608,10 @@ func TestModelConversion(t *testing.T) {
RemoteEndpoint: nil,
Annotations: nil,
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"attr1": "42",
"attr2": "bar",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model for span data with an "error" attribute set to "false"
Expand Down Expand Up @@ -647,8 +647,8 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
}
Expand Down Expand Up @@ -685,20 +685,20 @@ func Test_toZipkinTags(t *testing.T) {
},
},
want: map[string]string{
"double": fmt.Sprint(doubleValue),
"key": keyValue,
"ok": "true",
"uint": strconv.FormatInt(uintValue, 10),
"ot.status_code": codes.OK.String(),
"ot.status_description": "",
"double": fmt.Sprint(doubleValue),
"key": keyValue,
"ok": "true",
"uint": strconv.FormatInt(uintValue, 10),
"otel.status_code": codes.OK.String(),
"otel.status_description": "",
},
},
{
name: "no attributes",
data: &export.SpanData{},
want: map[string]string{
"ot.status_code": codes.OK.String(),
"ot.status_description": "",
"otel.status_code": codes.OK.String(),
"otel.status_description": "",
},
},
{
Expand All @@ -709,8 +709,8 @@ func Test_toZipkinTags(t *testing.T) {
},
},
want: map[string]string{
"ot.status_code": codes.OK.String(),
"ot.status_description": "",
"otel.status_code": codes.OK.String(),
"otel.status_description": "",
},
},
{
Expand All @@ -724,10 +724,10 @@ func Test_toZipkinTags(t *testing.T) {
StatusMessage: statusMessage,
},
want: map[string]string{
"error": "true",
"key": keyValue,
"ot.status_code": codes.Unknown.String(),
"ot.status_description": statusMessage,
"error": "true",
"key": keyValue,
"otel.status_code": codes.Unknown.String(),
"otel.status_description": statusMessage,
},
},
{
Expand All @@ -736,8 +736,8 @@ func Test_toZipkinTags(t *testing.T) {
InstrumentationLibrary: instrumentation.Library{},
},
want: map[string]string{
"ot.status_code": codes.OK.String(),
"ot.status_description": "",
"otel.status_code": codes.OK.String(),
"otel.status_description": "",
},
},
{
Expand All @@ -750,8 +750,8 @@ func Test_toZipkinTags(t *testing.T) {
},
want: map[string]string{
"otel.instrumentation_library.name": instrLibName,
"ot.status_code": codes.OK.String(),
"ot.status_description": "",
"otel.status_code": codes.OK.String(),
"otel.status_description": "",
},
},
{
Expand All @@ -766,8 +766,8 @@ func Test_toZipkinTags(t *testing.T) {
want: map[string]string{
"otel.instrumentation_library.name": instrLibName,
"otel.instrumentation_library.version": instrLibVersion,
"ot.status_code": codes.OK.String(),
"ot.status_description": "",
"otel.status_code": codes.OK.String(),
"otel.status_description": "",
},
},
}
Expand Down
8 changes: 4 additions & 4 deletions exporters/trace/zipkin/zipkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ func TestExportSpans(t *testing.T) {
RemoteEndpoint: nil,
Annotations: nil,
Tags: map[string]string{
"ot.status_code": "NotFound",
"ot.status_description": "404, file not found",
"otel.status_code": "NotFound",
"otel.status_description": "404, file not found",
},
},
// model of child
Expand All @@ -325,8 +325,8 @@ func TestExportSpans(t *testing.T) {
RemoteEndpoint: nil,
Annotations: nil,
Tags: map[string]string{
"ot.status_code": "PermissionDenied",
"ot.status_description": "403, forbidden",
"otel.status_code": "PermissionDenied",
"otel.status_description": "403, forbidden",
},
},
}
Expand Down