Skip to content

Commit 5e510cc

Browse files
committed
Readme and commented code
1 parent c7d34f0 commit 5e510cc

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

resource/opentelemetry-resource-detector-azure-app-service/README.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ OpenTelemetry Resource detectors for Azure App Services
88

99

1010
This library provides custom resource detector for Azure App Services. OpenTelemetry Python has an experimental feature whereby Resource Detectors can be injected to Resource Attributes. This package includes a resource detector for Azure App Service. This detector fills out the following Resource Attributes:
11-
* `service.name`
12-
* `cloud.provider`
13-
* `cloud.platform`
14-
* `cloud.resource_id`
15-
* `cloud.region`
16-
* `deployment.environment`
17-
* `host.id`
18-
* `service.instance.id`
19-
* `azure.app.service.stamp`
11+
* `service.name` set to the value of the WEBSITE_SITE_NAME environment variable.
12+
* `cloud.provider` set to the value of the "azure".
13+
* `cloud.platform` set to the value of the "azure_app_service".
14+
* `cloud.resource_id` set using the WEBSITE_RESOURCE_GROUP WEBSITE_OWNER_NAME and WEBSITE_SITE_NAME environment variables.
15+
* `cloud.region` set to the value of the REGION_NAME environment variable.
16+
* `deployment.environment` set to the value of the WEBSITE_SLOT_NAME environment variable.
17+
* `host.id` set to the value of the WEBSITE_HOSTNAME environment variable.
18+
* `service.instance.id` set to the value of the WEBSITE_INSTANCE_ID environment variable.
19+
* `azure.app.service.stamp` set to the value of the WEBSITE_HOME_STAMPNAME environment variable.
20+
21+
ResourceAttributes.CLOUD_REGION: _REGION_NAME,
22+
ResourceAttributes.DEPLOYMENT_ENVIRONMENT: _WEBSITE_SLOT_NAME,
23+
ResourceAttributes.HOST_ID: _WEBSITE_HOSTNAME,
24+
ResourceAttributes.SERVICE_INSTANCE_ID: _WEBSITE_INSTANCE_ID,
25+
_AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE: _WEBSITE_HOME_STAMPNAME,
2026

2127
For more information, see the Semantic Conventions for Cloud Resource Attributes.
2228

resource/opentelemetry-resource-detector-azure-app-service/tests/test_app_service_resource_detector.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ class TestAzureAppServiceResourceDetector(unittest.TestCase):
3131
def test_on_app_service(self):
3232
resource = AzureAppServiceResourceDetector().detect()
3333
attributes = resource.attributes
34-
# self.assertEqual(attributes {
35-
# "service.name": TEST_WEBSITE_SITE_NAME,
36-
# "cloud.provider": ,
37-
# "cloud.platform": ,
38-
# "cloud.resource_id": ,
39-
# "cloud.region": ,
40-
# "deployment.environment": ,
41-
# "deployment.environment": ,
42-
# })
4334
self.assertEqual(attributes["service.name"], TEST_WEBSITE_SITE_NAME)
4435
self.assertEqual(attributes["cloud.provider"], "azure")
4536
self.assertEqual(attributes["cloud.platform"], "azure_app_service")

0 commit comments

Comments
 (0)