Skip to content

Commit f6de494

Browse files
committed
Format
1 parent 9de118e commit f6de494

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_exporter_metrics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def __init__(
7777
elif endpoint.scheme == "http":
7878
port = 80
7979

80-
component_type = (component_type or OtelComponentTypeValues("unknown_otlp_exporter")).value
80+
component_type = (
81+
component_type or OtelComponentTypeValues("unknown_otlp_exporter")
82+
).value
8183
count = _component_counter[component_type]
8284
_component_counter[component_type] = count + 1
8385
self._standard_attrs: dict[str, AttributeValue] = {

exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
SpanExporter,
6363
SpanExportResult,
6464
)
65+
from opentelemetry.semconv._incubating.attributes.otel_attributes import (
66+
OtelComponentTypeValues,
67+
)
6568
from opentelemetry.test.mock_test_classes import IterEntryPoint
6669

6770
logger = getLogger(__name__)
@@ -83,8 +86,8 @@ def __init__(self, **kwargs):
8386
super().__init__(
8487
TraceServiceStub,
8588
SpanExportResult,
86-
component_type="test_span_exporter",
87-
signal="span",
89+
component_type=OtelComponentTypeValues.OTLP_GRPC_SPAN_EXPORTER,
90+
signal="traces",
8891
meter_provider=kwargs.pop("meter_provider", None),
8992
**kwargs,
9093
)
@@ -706,10 +709,12 @@ def test_unavailable_reconnects(self):
706709

707710
def assert_standard_metric_attrs(self, attributes):
708711
self.assertEqual(
709-
attributes["otel.component.type"], "test_span_exporter"
712+
attributes["otel.component.type"], "otlp_grpc_span_exporter"
710713
)
711714
self.assertTrue(
712-
attributes["otel.component.name"].startswith("test_span_exporter/")
715+
attributes["otel.component.name"].startswith(
716+
"otlp_grpc_span_exporter/"
717+
)
713718
)
714719
self.assertEqual(attributes["server.address"], "localhost")
715720
self.assertEqual(attributes["server.port"], 4317)

0 commit comments

Comments
 (0)