-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[META 388] Proposal for collecting Azure App Service cloud metadata (#…
…365) This commit updates the cloud metadata spec to propose collecting Azure App Service metadata. Azure App Services are a very popular PaaS offering on Azure. In contrast to Azure VMs, App Services do not have access to the internal metadata endpoint in order to retrieve metadata about the app instance. Instead, much of the metadata that is relevant to the purposes of APM are available in environment variables. The environment variables of interest are documented here.
- Loading branch information
Showing
2 changed files
with
177 additions
and
0 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
71 changes: 71 additions & 0 deletions
71
tests/agents/gherkin-specs/azure_app_service_metadata.feature
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,71 @@ | ||
Feature: Extracting Metadata for Azure App Service | ||
|
||
Background: | ||
Given an instrumented application is configured to collect cloud provider metadata for azure | ||
|
||
Scenario Outline: Azure App Service with all environment variables present in expected format | ||
Given the following environment variables are present | ||
| name | value | | ||
| WEBSITE_OWNER_NAME | <WEBSITE_OWNER_NAME> | | ||
| WEBSITE_RESOURCE_GROUP | resource_group | | ||
| WEBSITE_SITE_NAME | site_name | | ||
| WEBSITE_INSTANCE_ID | instance_id | | ||
When cloud metadata is collected | ||
Then cloud metadata is not null | ||
And cloud metadata 'account.id' is 'f5940f10-2e30-3e4d-a259-63451ba6dae4' | ||
And cloud metadata 'provider' is 'azure' | ||
And cloud metadata 'instance.id' is 'instance_id' | ||
And cloud metadata 'instance.name' is 'site_name' | ||
And cloud metadata 'project.name' is 'resource_group' | ||
And cloud metadata 'region' is 'AustraliaEast' | ||
Examples: | ||
| WEBSITE_OWNER_NAME | | ||
| f5940f10-2e30-3e4d-a259-63451ba6dae4+elastic-apm-AustraliaEastwebspace | | ||
| f5940f10-2e30-3e4d-a259-63451ba6dae4+appsvc_linux_australiaeast-AustraliaEastwebspace-Linux | | ||
|
||
# WEBSITE_OWNER_NAME is expected to include a + character | ||
Scenario: WEBSITE_OWNER_NAME environment variable not expected format | ||
Given the following environment variables are present | ||
| name | value | | ||
| WEBSITE_OWNER_NAME | f5940f10-2e30-3e4d-a259-63451ba6dae4-elastic-apm-AustraliaEastwebspace | | ||
| WEBSITE_RESOURCE_GROUP | resource_group | | ||
| WEBSITE_SITE_NAME | site_name | | ||
| WEBSITE_INSTANCE_ID | instance_id | | ||
When cloud metadata is collected | ||
Then cloud metadata is null | ||
|
||
Scenario: Missing WEBSITE_OWNER_NAME environment variable | ||
Given the following environment variables are present | ||
| name | value | | ||
| WEBSITE_RESOURCE_GROUP | resource_group | | ||
| WEBSITE_SITE_NAME | site_name | | ||
| WEBSITE_INSTANCE_ID | instance_id | | ||
When cloud metadata is collected | ||
Then cloud metadata is null | ||
|
||
Scenario: Missing WEBSITE_RESOURCE_GROUP environment variable | ||
Given the following environment variables are present | ||
| name | value | | ||
| WEBSITE_OWNER_NAME | f5940f10-2e30-3e4d-a259-63451ba6dae4+elastic-apm-AustraliaEastwebspace | | ||
| WEBSITE_SITE_NAME | site_name | | ||
| WEBSITE_INSTANCE_ID | instance_id | | ||
When cloud metadata is collected | ||
Then cloud metadata is null | ||
|
||
Scenario: Missing WEBSITE_SITE_NAME environment variable | ||
Given the following environment variables are present | ||
| name | value | | ||
| WEBSITE_OWNER_NAME | f5940f10-2e30-3e4d-a259-63451ba6dae4+elastic-apm-AustraliaEastwebspace | | ||
| WEBSITE_RESOURCE_GROUP | resource_group | | ||
| WEBSITE_INSTANCE_ID | instance_id | | ||
When cloud metadata is collected | ||
Then cloud metadata is null | ||
|
||
Scenario: Missing WEBSITE_INSTANCE_ID environment variable | ||
Given the following environment variables are present | ||
| name | value | | ||
| WEBSITE_OWNER_NAME | f5940f10-2e30-3e4d-a259-63451ba6dae4+elastic-apm-AustraliaEastwebspace | | ||
| WEBSITE_RESOURCE_GROUP | resource_group | | ||
| WEBSITE_SITE_NAME | site_name | | ||
When cloud metadata is collected | ||
Then cloud metadata is null |