You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove accessors for deprecated status code, fix receiver logic
The previous logic was to ignore deprecated if received non unset for new status code,
but if downstream a service is not upgraded it should see the deprecated status set correctly.
This change is to be consistent with `SetCode`.
Signed-off-by: Bogdan Drutu <[email protected]>
Copy file name to clipboardExpand all lines: cmd/pdatagen/internal/trace_structs.go
-8Lines changed: 0 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -196,14 +196,6 @@ var spanStatus = &messageValueStruct{
196
196
// to OTLP spec https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L231
// According to OTLP spec we also need to set the deprecated_code field.
170
-
// See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L231
171
-
//
172
-
// if code==STATUS_CODE_UNSET then `deprecated_code` MUST be
173
-
// set to DEPRECATED_STATUS_CODE_OK.
174
-
//
175
-
// if code==STATUS_CODE_OK then `deprecated_code` MUST be
176
-
// set to DEPRECATED_STATUS_CODE_OK.
177
-
//
178
-
// if code==STATUS_CODE_ERROR then `deprecated_code` MUST be
179
-
// set to DEPRECATED_STATUS_CODE_UNKNOWN_ERROR.
140
+
// According to OTLP spec we also need to set the deprecated_code field as we are a new sender:
141
+
// See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L239
// Perform backward compatibility conversion of Span Status code according to
58
-
// OTLP specification.
59
-
// See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L231
60
-
//
61
-
// If code==STATUS_CODE_UNSET then the value of `deprecated_code` is the
62
-
// carrier of the overall status according to these rules:
63
-
//
64
-
// if deprecated_code==DEPRECATED_STATUS_CODE_OK then the receiver MUST interpret
65
-
// the overall status to be STATUS_CODE_UNSET.
66
-
//
67
-
// if deprecated_code!=DEPRECATED_STATUS_CODE_OK then the receiver MUST interpret
68
-
// the overall status to be STATUS_CODE_ERROR.
69
-
//
70
-
// If code!=STATUS_CODE_UNSET then the value of `deprecated_code` MUST be
71
-
// ignored, the `code` field is the sole carrier of the status.
58
+
// OTLP specification as we are a new receiver and sender (we are pushing data to the pipelines):
59
+
// See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L239
60
+
// See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L253
0 commit comments