diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py index e5fb43f98ddd..16b202dc6159 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py @@ -79,7 +79,7 @@ install_requires=[ "azure-core<2.0.0,>=1.6.0", "msrest>=0.6.10", - "opentelemetry-api == 0.17b0", - "opentelemetry-sdk == 0.17b0" + "opentelemetry-api == 1.0.0rc1", + "opentelemetry-sdk == 1.0.0rc1" ], ) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py index 8da3f4b1ca11..6aefe486a9d5 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py @@ -9,7 +9,6 @@ from datetime import datetime import requests -from opentelemetry.sdk.metrics.export import MetricsExportResult from opentelemetry.sdk.trace.export import SpanExportResult from azure.core.exceptions import HttpResponseError, ServiceRequestError diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py index d3013da4a3f7..c7608e2abeac 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py @@ -180,7 +180,8 @@ def test_span_to_envelope_tags(self): envelope = exporter._span_to_envelope(test_span) self.assertIsNotNone(envelope.tags) - self.assertIsNone(envelope.tags.get("ai.cloud.role")) + self.assertIsNotNone(envelope.tags.get("ai.cloud.role")) + self.assertEqual(envelope.tags.get("ai.cloud.role"), "unknown_service") self.assertIsNone(envelope.tags.get("ai.cloud.roleInstance")) self.assertIsNotNone(envelope.tags.get("ai.device.id")) self.assertIsNotNone(envelope.tags.get("ai.device.locale")) @@ -188,7 +189,7 @@ def test_span_to_envelope_tags(self): self.assertIsNotNone(envelope.tags.get("ai.device.type")) self.assertIsNotNone(envelope.tags.get("ai.internal.sdkVersion")) - test_span.resource = resources.Resource( + test_span._resource = resources.Resource( {"service.name": "testServiceName", "service.namespace": "testServiceNamespace", "service.instance.id": "testServiceInstanceId"}) @@ -235,7 +236,7 @@ def test_span_to_envelope(self): ) span.start(start_time=start_time) span.end(end_time=end_time) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) envelope = exporter._span_to_envelope(span) self.assertEqual(envelope.instrumentation_key, "12345678-1234-5678-abcd-12345678abcd") @@ -265,7 +266,7 @@ def test_span_to_envelope(self): ) self.assertEqual(envelope.data.base_data.result_code, "200") - span.attributes = { + span._attributes = { "component": "http", "http.method": "GET", "net.peer.port": 1234, @@ -275,7 +276,7 @@ def test_span_to_envelope(self): envelope = exporter._span_to_envelope(span) self.assertEqual(envelope.data.base_data.target, "testhost:1234") - span.attributes = { + span._attributes = { "component": "http", "http.method": "GET", "net.peer.port": 1234, @@ -308,7 +309,7 @@ def test_span_to_envelope(self): ) span.start(start_time=start_time) span.end(end_time=end_time) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) envelope = exporter._span_to_envelope(span) self.assertTrue(envelope.data.base_data.success) self.assertEqual(envelope.data.base_data.type, "sql") @@ -337,7 +338,7 @@ def test_span_to_envelope(self): ) span.start(start_time=start_time) span.end(end_time=end_time) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) envelope = exporter._span_to_envelope(span) self.assertTrue(envelope.data.base_data.success) self.assertEqual(envelope.data.base_data.type, "rpc.system") @@ -366,7 +367,7 @@ def test_span_to_envelope(self): ) span.start(start_time=start_time) span.end(end_time=end_time) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) envelope = exporter._span_to_envelope(span) self.assertTrue(envelope.data.base_data.success) self.assertEqual(envelope.data.base_data.type, @@ -396,7 +397,7 @@ def test_span_to_envelope(self): ) span.start(start_time=start_time) span.end(end_time=end_time) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) envelope = exporter._span_to_envelope(span) self.assertTrue(envelope.data.base_data.success) self.assertEqual(envelope.data.base_data.type, "InProc") @@ -424,7 +425,7 @@ def test_span_to_envelope(self): links=[], kind=SpanKind.SERVER, ) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) span.start(start_time=start_time) span.end(end_time=end_time) envelope = exporter._span_to_envelope(span) @@ -480,7 +481,7 @@ def test_span_to_envelope(self): links=[], kind=SpanKind.SERVER, ) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) span.start(start_time=start_time) span.end(end_time=end_time) envelope = exporter._span_to_envelope(span) @@ -513,7 +514,7 @@ def test_span_to_envelope(self): links=[], kind=SpanKind.CLIENT, ) - span.status = Status(status_code=StatusCode.ERROR) + span._status = Status(status_code=StatusCode.ERROR) span.start(start_time=start_time) span.end(end_time=end_time) envelope = exporter._span_to_envelope(span) @@ -541,7 +542,7 @@ def test_span_to_envelope(self): links=[], kind=SpanKind.CLIENT, ) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) span.start(start_time=start_time) span.end(end_time=end_time) envelope = exporter._span_to_envelope(span) @@ -579,7 +580,7 @@ def test_span_to_envelope(self): links=links, kind=SpanKind.CLIENT, ) - span.status = Status(status_code=StatusCode.OK) + span._status = Status(status_code=StatusCode.OK) span.start(start_time=start_time) span.end(end_time=end_time) envelope = exporter._span_to_envelope(span) diff --git a/shared_requirements.txt b/shared_requirements.txt index 03d2819c522e..37e9dbf4621d 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -190,6 +190,8 @@ opentelemetry-sdk==0.17b0 #override azure-ai-metricsadvisor msrest>=0.6.12 #override azure-monitor-opentelemetry-exporter azure-core<2.0.0,>=1.6.0 #override azure-monitor-opentelemetry-exporter msrest>=0.6.10 +#override azure-monitor-opentelemetry-exporter opentelemetry-api==1.0.0rc1 +#override azure-monitor-opentelemetry-exporter opentelemetry-sdk==1.0.0rc1 #override azure-core-tracing-opentelemetry opentelemetry-api==0.17b0 #override azure-identity six>=1.12.0 #override azure-ai-formrecognizer