-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Codegen fro Azure Monitor * codeowner * commit 2 * Update sdk/monitor/opentelemetry-exporter-azuremonitor/README.md * doc setings * Update eng/.docsettings.yml * Update eng/.docsettings.yml * Update sdk/monitor/opentelemetry-exporter-azuremonitor/README.md * Update eng/.docsettings.yml * version * oops * comments * Update sdk/monitor/opentelemetry-exporter-azuremonitor/LICENSE.txt Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
- Loading branch information
1 parent
ddece48
commit 167351f
Showing
31 changed files
with
2,670 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
sdk/monitor/opentelemetry-exporter-azuremonitor/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Release History | ||
|
||
## Unreleased | ||
|
||
## 0.5b.0 | ||
Released 2020-09-24 | ||
|
||
- Change epoch for live metrics | ||
([#115](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/115)) | ||
- Dropping support for Python 3.4 | ||
([#117](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/117)) | ||
|
||
## 0.4b.0 | ||
Released 2020-06-29 | ||
|
||
- Added live metrics | ||
([#96](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/96)) | ||
- Remove dependency metrics from auto-collection | ||
([#92](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/92)) | ||
- Change default local storage directory | ||
([#100](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/100)) | ||
- Implement proxies in exporter configuration | ||
([#101](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/101)) | ||
- Remove request failed per second metrics from auto-collection | ||
([#102](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/102)) | ||
|
||
## 0.3b.1 | ||
Released 2020-05-21 | ||
|
||
- Fix metrics exporter serialization bug | ||
([#92](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/92)) | ||
|
||
## 0.3b.0 | ||
Released 2020-05-19 | ||
|
||
- Implement max size logic for local storage | ||
([#74](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/74)) | ||
- Remove label sets + add is_remote to spancontext | ||
([#75](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/75)) | ||
- Adding live metrics manager | ||
([#78](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/78)) | ||
- Handle status 439 - Too Many Requests over extended time | ||
([#80](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/80)) | ||
- Fix breaking changes from OT release 0.7b.0 | ||
([#86](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/86)) | ||
|
||
## 0.2b.0 | ||
Released 2020-03-31 | ||
|
||
- Initial beta release | ||
|
||
## 0.1a.0 | ||
Released 2019-11-06 | ||
|
||
- Initial alpha release |
21 changes: 21 additions & 0 deletions
21
sdk/monitor/opentelemetry-exporter-azuremonitor/LICENSE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) Microsoft Corporation. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include *.md | ||
include opentelemetry/__init__.py | ||
include opentelemetry/exporter/__init__.py | ||
include LICENSE.txt | ||
recursive-include tests *.py | ||
recursive-include samples *.py *.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Azure Opentelemetry Exporter for Monitor | ||
|
||
## Getting started | ||
|
||
## Key concepts | ||
|
||
## Examples | ||
|
||
## Troubleshooting | ||
|
||
## Next steps | ||
|
||
## Contributing |
6 changes: 6 additions & 0 deletions
6
sdk/monitor/opentelemetry-exporter-azuremonitor/dev_requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-e ../../../tools/azure-devtools | ||
-e ../../../tools/azure-sdk-tools | ||
../../core/azure-core | ||
-e ../../identity/azure-identity | ||
aiohttp>=3.0; python_version >= '3.5' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[mypy] | ||
python_version = 3.6 | ||
warn_return_any = True | ||
warn_unused_configs = True | ||
ignore_missing_imports = True | ||
|
||
# Per-module options: | ||
|
||
[mypy-opentelemetry.exporter.azuremonitor._generated.*] | ||
ignore_errors = True | ||
|
||
[mypy-azure.core.*] | ||
ignore_errors = True | ||
|
1 change: 1 addition & 0 deletions
1
sdk/monitor/opentelemetry-exporter-azuremonitor/opentelemetry/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
1 change: 1 addition & 0 deletions
1
sdk/monitor/opentelemetry-exporter-azuremonitor/opentelemetry/exporter/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
11 changes: 11 additions & 0 deletions
11
...nitor/opentelemetry-exporter-azuremonitor/opentelemetry/exporter/azuremonitor/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._generated._azure_monitor_exporter import AzureMonitorExporter | ||
from ._version import VERSION | ||
|
||
__all__ = ['AzureMonitorExporter'] | ||
__version__ = VERSION |
16 changes: 16 additions & 0 deletions
16
...elemetry-exporter-azuremonitor/opentelemetry/exporter/azuremonitor/_generated/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._azure_monitor_exporter import AzureMonitorExporter | ||
__all__ = ['AzureMonitorExporter'] | ||
|
||
try: | ||
from ._patch import patch_sdk # type: ignore | ||
patch_sdk() | ||
except ImportError: | ||
pass |
56 changes: 56 additions & 0 deletions
56
...er-azuremonitor/opentelemetry/exporter/azuremonitor/_generated/_azure_monitor_exporter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from azure.core import PipelineClient | ||
from msrest import Deserializer, Serializer | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any | ||
|
||
from ._configuration import AzureMonitorExporterConfiguration | ||
from .operations import AzureMonitorExporterOperationsMixin | ||
from . import models | ||
|
||
|
||
class AzureMonitorExporter(AzureMonitorExporterOperationsMixin): | ||
"""Opentelemetry Exporter for Azure Monitor. | ||
:param host: Breeze endpoint: https://dc.services.visualstudio.com. | ||
:type host: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
host="https://dc.services.visualstudio.com", # type: str | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
base_url = '{Host}/v2' | ||
self._config = AzureMonitorExporterConfiguration(host, **kwargs) | ||
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
|
||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
self._serialize = Serializer(client_models) | ||
self._deserialize = Deserializer(client_models) | ||
|
||
|
||
def close(self): | ||
# type: () -> None | ||
self._client.close() | ||
|
||
def __enter__(self): | ||
# type: () -> AzureMonitorExporter | ||
self._client.__enter__() | ||
return self | ||
|
||
def __exit__(self, *exc_details): | ||
# type: (Any) -> None | ||
self._client.__exit__(*exc_details) |
57 changes: 57 additions & 0 deletions
57
...ry-exporter-azuremonitor/opentelemetry/exporter/azuremonitor/_generated/_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from azure.core.configuration import Configuration | ||
from azure.core.pipeline import policies | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any | ||
|
||
VERSION = "unknown" | ||
|
||
class AzureMonitorExporterConfiguration(Configuration): | ||
"""Configuration for AzureMonitorExporter. | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param host: Breeze endpoint: https://dc.services.visualstudio.com. | ||
:type host: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
host="https://dc.services.visualstudio.com", # type: str | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
if host is None: | ||
raise ValueError("Parameter 'host' must not be None.") | ||
super(AzureMonitorExporterConfiguration, self).__init__(**kwargs) | ||
|
||
self.host = host | ||
kwargs.setdefault('sdk_moniker', 'azuremonitorexporter/{}'.format(VERSION)) | ||
self._configure(**kwargs) | ||
|
||
def _configure( | ||
self, | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) | ||
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) | ||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) | ||
self.authentication_policy = kwargs.get('authentication_policy') |
10 changes: 10 additions & 0 deletions
10
...etry-exporter-azuremonitor/opentelemetry/exporter/azuremonitor/_generated/aio/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._azure_monitor_exporter_async import AzureMonitorExporter | ||
__all__ = ['AzureMonitorExporter'] |
48 changes: 48 additions & 0 deletions
48
...nitor/opentelemetry/exporter/azuremonitor/_generated/aio/_azure_monitor_exporter_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from typing import Any | ||
|
||
from azure.core import AsyncPipelineClient | ||
from msrest import Deserializer, Serializer | ||
|
||
from ._configuration_async import AzureMonitorExporterConfiguration | ||
from .operations_async import AzureMonitorExporterOperationsMixin | ||
from .. import models | ||
|
||
|
||
class AzureMonitorExporter(AzureMonitorExporterOperationsMixin): | ||
"""Opentelemetry Exporter for Azure Monitor. | ||
:param host: Breeze endpoint: https://dc.services.visualstudio.com. | ||
:type host: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
host: str = "https://dc.services.visualstudio.com", | ||
**kwargs: Any | ||
) -> None: | ||
base_url = '{Host}/v2' | ||
self._config = AzureMonitorExporterConfiguration(host, **kwargs) | ||
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
|
||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
self._serialize = Serializer(client_models) | ||
self._deserialize = Deserializer(client_models) | ||
|
||
|
||
async def close(self) -> None: | ||
await self._client.close() | ||
|
||
async def __aenter__(self) -> "AzureMonitorExporter": | ||
await self._client.__aenter__() | ||
return self | ||
|
||
async def __aexit__(self, *exc_details) -> None: | ||
await self._client.__aexit__(*exc_details) |
Oops, something went wrong.