Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix README and links for release #16146

Merged
merged 4 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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**
Expand Down
20 changes: 6 additions & 14 deletions sdk/monitor/azure-opentelemetry-exporter-azuremonitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]
Expand Down Expand Up @@ -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].

Expand All @@ -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
Expand Down Expand Up @@ -162,26 +156,24 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio

<!-- LINKS -->
[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
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "1.0.0b2"
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down