-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instrumentation for Azure Service Bus #1225
Merged
Merged
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
6d6aba3
Instrument send
russcam 3667cc5
Move ConnectionString parsing into environment class
russcam 60b340d
Source azure credentials from file or environment variables
russcam 3e74b48
Integration tests and IgnoreMessageQueues configuration value
russcam 7c627e0
Microsoft.Azure.ServiceBus integration
russcam 09e4382
Rename to Elastic.Apm.Azure.ServiceBus
russcam 61b9848
Use PropertyFetcher to get properties
russcam 34edd2f
Add packaging information
russcam 06feaf8
test with minimally supported versions
russcam bf4b7de
Add documentation
russcam 5f1d28f
add example credential file
russcam 1626540
Use DiagnosticListenerBase
russcam aa66bd8
Create and reuse same Service instance for message transactions
russcam bb29131
Run terraform locally with authenticated az account
russcam d9981b9
delete example credentials file
russcam f003524
add table terminator
russcam af7d1a2
Load credentials in CI from .credentials.json
russcam 1fb40df
Add Azure Service Bus sample application
russcam 1cfac4e
Extract service bus related values out to constants
russcam 995f266
Add Azure Service Bus to NetCoreAll
russcam 608db10
Fix rebase
russcam bed17d7
Install terraform for CI
russcam a4aadd9
install docker first
russcam 5afeb85
Address PR feedback
russcam 52fad70
Address PR feedback round 2
russcam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "=2.46.0" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
# configuration is sourced from the following environment variables: | ||
# ARM_CLIENT_ID | ||
# ARM_CLIENT_SECRET | ||
# ARM_SUBSCRIPTION_ID | ||
# ARM_TENANT_ID | ||
# | ||
# See https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret | ||
# for creating a Service Principal and Client Secret | ||
data "azurerm_client_config" "current" { | ||
} | ||
|
||
resource "random_uuid" "variables" { | ||
} | ||
|
||
variable "resource_group" { | ||
type = string | ||
description = "The name of the resource group to create" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "The Azure location in which to deploy resources" | ||
default = "westus" | ||
} | ||
|
||
variable "servicebus_namespace" { | ||
type = string | ||
description = "The name of the servicebus namespace to create" | ||
} | ||
|
||
resource "azurerm_resource_group" "servicebus_resource_group" { | ||
name = var.resource_group | ||
location = var.location | ||
} | ||
|
||
resource "azurerm_servicebus_namespace" "servicebus_namespace" { | ||
location = azurerm_resource_group.servicebus_resource_group.location | ||
name = var.servicebus_namespace | ||
resource_group_name = azurerm_resource_group.servicebus_resource_group.name | ||
sku = "Standard" | ||
depends_on = [azurerm_resource_group.servicebus_resource_group] | ||
} | ||
|
||
# random name to generate for the contributor role assignment | ||
resource "random_uuid" "contributor_role" { | ||
keepers = { | ||
client_id = data.azurerm_client_config.current.client_id | ||
} | ||
} | ||
|
||
resource "azurerm_role_assignment" "contributor_role" { | ||
name = random_uuid.contributor_role.result | ||
principal_id = data.azurerm_client_config.current.object_id | ||
role_definition_name = "Contributor" | ||
scope = azurerm_resource_group.servicebus_resource_group.id | ||
depends_on = [azurerm_servicebus_namespace.servicebus_namespace] | ||
} | ||
|
||
# random name to generate for the contributor role assignment | ||
resource "random_uuid" "data_owner_role" { | ||
keepers = { | ||
client_id = data.azurerm_client_config.current.client_id | ||
} | ||
} | ||
|
||
resource "azurerm_role_assignment" "servicebus_data_owner_role" { | ||
name = random_uuid.data_owner_role.result | ||
principal_id = data.azurerm_client_config.current.object_id | ||
role_definition_name = "Azure Service Bus Data Owner" | ||
scope = azurerm_resource_group.servicebus_resource_group.id | ||
depends_on = [azurerm_servicebus_namespace.servicebus_namespace] | ||
} | ||
|
||
# following role assignment, there can be a delay of up to ~1 minute | ||
# for the assignments to propagate in Azure. You may need to introduce | ||
# a wait before using the Azure resources created. | ||
|
||
output "connection_string" { | ||
value = azurerm_servicebus_namespace.servicebus_namespace.default_primary_connection_string | ||
description = "The service bus primary connection string" | ||
sensitive = true | ||
} | ||
|
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
17 changes: 17 additions & 0 deletions
17
sample/Elastic.Apm.Azure.ServiceBus.Sample/Elastic.Apm.Azure.ServiceBus.Sample.csproj
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,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net5.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="3.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Elastic.Apm.Azure.ServiceBus\Elastic.Apm.Azure.ServiceBus.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.