mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-30 21:56:07 +08:00
Change status codes from grpc status codes, remove setting status in instrumentations except on ERROR (#1282)
This commit is contained in:
@ -23,7 +23,6 @@ from ddtrace.span import Span as DatadogSpan
|
||||
import opentelemetry.trace as trace_api
|
||||
from opentelemetry.sdk.trace import sampling
|
||||
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
|
||||
from opentelemetry.trace.status import StatusCanonicalCode
|
||||
|
||||
# pylint:disable=relative-beyond-top-level
|
||||
from .constants import (
|
||||
@ -145,7 +144,7 @@ class DatadogSpanExporter(SpanExporter):
|
||||
datadog_span.start_ns = span.start_time
|
||||
datadog_span.duration_ns = span.end_time - span.start_time
|
||||
|
||||
if span.status.canonical_code is not StatusCanonicalCode.OK:
|
||||
if not span.status.is_ok:
|
||||
datadog_span.error = 1
|
||||
if span.status.description:
|
||||
exc_type, exc_val = _get_exc_info(span)
|
||||
|
Reference in New Issue
Block a user