|
| 1 | +# Copyright The OpenTelemetry Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +from opentelemetry.semconv.resource import ResourceAttributes |
| 16 | + |
| 17 | +# cSpell:disable |
| 18 | + |
| 19 | +# Azure Kubernetes |
| 20 | + |
| 21 | +_AKS_ARM_NAMESPACE_ID = "AKS_ARM_NAMESPACE_ID" |
| 22 | + |
| 23 | +# AppService |
| 24 | + |
| 25 | +_AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE = "azure.app.service.stamp" |
| 26 | +_REGION_NAME = "REGION_NAME" |
| 27 | +_WEBSITE_HOME_STAMPNAME = "WEBSITE_HOME_STAMPNAME" |
| 28 | +_WEBSITE_HOSTNAME = "WEBSITE_HOSTNAME" |
| 29 | +_WEBSITE_INSTANCE_ID = "WEBSITE_INSTANCE_ID" |
| 30 | +_WEBSITE_OWNER_NAME = "WEBSITE_OWNER_NAME" |
| 31 | +_WEBSITE_RESOURCE_GROUP = "WEBSITE_RESOURCE_GROUP" |
| 32 | +_WEBSITE_SITE_NAME = "WEBSITE_SITE_NAME" |
| 33 | +_WEBSITE_SLOT_NAME = "WEBSITE_SLOT_NAME" |
| 34 | + |
| 35 | +_APP_SERVICE_ATTRIBUTE_ENV_VARS = { |
| 36 | + ResourceAttributes.CLOUD_REGION: _REGION_NAME, |
| 37 | + ResourceAttributes.DEPLOYMENT_ENVIRONMENT: _WEBSITE_SLOT_NAME, |
| 38 | + ResourceAttributes.HOST_ID: _WEBSITE_HOSTNAME, |
| 39 | + ResourceAttributes.SERVICE_INSTANCE_ID: _WEBSITE_INSTANCE_ID, |
| 40 | + _AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE: _WEBSITE_HOME_STAMPNAME, |
| 41 | +} |
| 42 | + |
| 43 | +# Functions |
| 44 | + |
| 45 | +_FUNCTIONS_WORKER_RUNTIME = "FUNCTIONS_WORKER_RUNTIME" |
| 46 | + |
| 47 | +# Vm |
| 48 | + |
| 49 | +_AZURE_VM_METADATA_ENDPOINT = "http://169.254.169.254/metadata/instance/compute?api-version=2021-12-13&format=json" |
| 50 | +_AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = "azure.vm.scaleset.name" |
| 51 | +_AZURE_VM_SKU_ATTRIBUTE = "azure.vm.sku" |
| 52 | + |
| 53 | +_EXPECTED_AZURE_AMS_ATTRIBUTES = [ |
| 54 | + _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE, |
| 55 | + _AZURE_VM_SKU_ATTRIBUTE, |
| 56 | + ResourceAttributes.CLOUD_PLATFORM, |
| 57 | + ResourceAttributes.CLOUD_PROVIDER, |
| 58 | + ResourceAttributes.CLOUD_REGION, |
| 59 | + ResourceAttributes.CLOUD_RESOURCE_ID, |
| 60 | + ResourceAttributes.HOST_ID, |
| 61 | + ResourceAttributes.HOST_NAME, |
| 62 | + ResourceAttributes.HOST_TYPE, |
| 63 | + ResourceAttributes.OS_TYPE, |
| 64 | + ResourceAttributes.OS_VERSION, |
| 65 | + ResourceAttributes.SERVICE_INSTANCE_ID, |
| 66 | +] |
| 67 | + |
| 68 | +# cSpell:enable |
0 commit comments