-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into loggingBasicConfig
- Loading branch information
Showing
17 changed files
with
728 additions
and
149 deletions.
There are no files selected for viewing
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,121 @@ | ||
name: Lint tests | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'release/*' | ||
pull_request: | ||
env: | ||
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2 | ||
|
||
jobs: | ||
lint-3_11: | ||
strategy: | ||
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails | ||
matrix: | ||
package: | ||
- "distro" | ||
- "exporter-prometheus-remote-write" | ||
- "exporter-richconsole" | ||
- "instrumentation-aio-pika" | ||
- "instrumentation-aiohttp-client" | ||
- "instrumentation-aiohttp-server" | ||
- "instrumentation-aiopg" | ||
- "instrumentation-asgi" | ||
- "instrumentation-asyncio" | ||
- "instrumentation-asyncpg" | ||
- "instrumentation-aws-lambda" | ||
- "instrumentation-boto" | ||
- "instrumentation-boto3sqs" | ||
- "instrumentation-botocore" | ||
- "instrumentation-cassandra" | ||
- "instrumentation-celery" | ||
- "instrumentation-confluent-kafka" | ||
- "instrumentation-dbapi" | ||
- "instrumentation-django" | ||
- "instrumentation-elasticsearch" | ||
- "instrumentation-falcon" | ||
- "instrumentation-fastapi" | ||
- "instrumentation-flask" | ||
- "instrumentation-grpc" | ||
- "instrumentation-httpx" | ||
- "instrumentation-jinja2" | ||
- "instrumentation-kafka-python" | ||
- "instrumentation-logging" | ||
- "instrumentation-mysql" | ||
- "instrumentation-mysqlclient" | ||
- "instrumentation-psycopg" | ||
- "instrumentation-psycopg2" | ||
- "instrumentation-pymemcache" | ||
- "instrumentation-pymongo" | ||
- "instrumentation-pymysql" | ||
- "instrumentation-pyramid" | ||
- "instrumentation-redis" | ||
- "instrumentation-remoulade" | ||
- "instrumentation-requests" | ||
- "instrumentation-sio-pika" | ||
- "instrumentation-sqlalchemy" | ||
- "instrumentation-sqlite3" | ||
- "instrumentation-starlette" | ||
- "instrumentation-system-metrics" | ||
- "instrumentation-threading" | ||
- "instrumentation-tornado" | ||
- "instrumentation-tortoiseorm" | ||
- "instrumentation-urllib" | ||
- "instrumentation-urllib3" | ||
- "instrumentation-wsgi" | ||
- "opentelemetry-instrumentation" | ||
- "processor-baggage" | ||
- "propagator-aws-xray" | ||
- "propagator-ot-trace" | ||
- "resource-detector-container" | ||
- "sdk-extension-aws" | ||
os: [ubuntu-20.04] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }} | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
- name: Install tox | ||
run: pip install tox | ||
- name: Cache tox environment | ||
# Preserves .tox directory between runs for faster installs | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
.tox | ||
~/.cache/pip | ||
key: v7-build-tox-cache-${{ matrix.package }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }} | ||
- name: run tox | ||
run: tox -e lint-${{ matrix.package }} | ||
|
||
lint-3_8: | ||
strategy: | ||
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails | ||
matrix: | ||
package: | ||
- "instrumentation-sklearn" | ||
os: [ubuntu-20.04] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }} | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
- name: Install tox | ||
run: pip install tox | ||
- name: Cache tox environment | ||
# Preserves .tox directory between runs for faster installs | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
.tox | ||
~/.cache/pip | ||
key: v7-build-tox-cache-${{ matrix.package }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }} | ||
- name: run tox | ||
run: tox -e lint-${{ matrix.package }} |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
-c dev-requirements.txt | ||
astor==0.8.1 | ||
jinja2~=2.7 | ||
jinja2==3.1.3 | ||
markupsafe==2.0.1 | ||
isort | ||
black | ||
|
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
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
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
25 changes: 25 additions & 0 deletions
25
...entelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/__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,25 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# pylint: disable=import-error | ||
|
||
from .app_service import AzureAppServiceResourceDetector | ||
from .version import __version__ | ||
from .vm import AzureVMResourceDetector | ||
|
||
__all__ = [ | ||
"AzureAppServiceResourceDetector", | ||
"AzureVMResourceDetector", | ||
"__version__", | ||
] |
68 changes: 68 additions & 0 deletions
68
...telemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/_constants.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,68 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from opentelemetry.semconv.resource import ResourceAttributes | ||
|
||
# cSpell:disable | ||
|
||
# Azure Kubernetes | ||
|
||
_AKS_ARM_NAMESPACE_ID = "AKS_ARM_NAMESPACE_ID" | ||
|
||
# AppService | ||
|
||
_AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE = "azure.app.service.stamp" | ||
_REGION_NAME = "REGION_NAME" | ||
_WEBSITE_HOME_STAMPNAME = "WEBSITE_HOME_STAMPNAME" | ||
_WEBSITE_HOSTNAME = "WEBSITE_HOSTNAME" | ||
_WEBSITE_INSTANCE_ID = "WEBSITE_INSTANCE_ID" | ||
_WEBSITE_OWNER_NAME = "WEBSITE_OWNER_NAME" | ||
_WEBSITE_RESOURCE_GROUP = "WEBSITE_RESOURCE_GROUP" | ||
_WEBSITE_SITE_NAME = "WEBSITE_SITE_NAME" | ||
_WEBSITE_SLOT_NAME = "WEBSITE_SLOT_NAME" | ||
|
||
_APP_SERVICE_ATTRIBUTE_ENV_VARS = { | ||
ResourceAttributes.CLOUD_REGION: _REGION_NAME, | ||
ResourceAttributes.DEPLOYMENT_ENVIRONMENT: _WEBSITE_SLOT_NAME, | ||
ResourceAttributes.HOST_ID: _WEBSITE_HOSTNAME, | ||
ResourceAttributes.SERVICE_INSTANCE_ID: _WEBSITE_INSTANCE_ID, | ||
_AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE: _WEBSITE_HOME_STAMPNAME, | ||
} | ||
|
||
# Functions | ||
|
||
_FUNCTIONS_WORKER_RUNTIME = "FUNCTIONS_WORKER_RUNTIME" | ||
|
||
# Vm | ||
|
||
_AZURE_VM_METADATA_ENDPOINT = "http://169.254.169.254/metadata/instance/compute?api-version=2021-12-13&format=json" | ||
_AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = "azure.vm.scaleset.name" | ||
_AZURE_VM_SKU_ATTRIBUTE = "azure.vm.sku" | ||
|
||
_EXPECTED_AZURE_AMS_ATTRIBUTES = [ | ||
_AZURE_VM_SCALE_SET_NAME_ATTRIBUTE, | ||
_AZURE_VM_SKU_ATTRIBUTE, | ||
ResourceAttributes.CLOUD_PLATFORM, | ||
ResourceAttributes.CLOUD_PROVIDER, | ||
ResourceAttributes.CLOUD_REGION, | ||
ResourceAttributes.CLOUD_RESOURCE_ID, | ||
ResourceAttributes.HOST_ID, | ||
ResourceAttributes.HOST_NAME, | ||
ResourceAttributes.HOST_TYPE, | ||
ResourceAttributes.OS_TYPE, | ||
ResourceAttributes.OS_VERSION, | ||
ResourceAttributes.SERVICE_INSTANCE_ID, | ||
] | ||
|
||
# cSpell:enable |
Oops, something went wrong.