Skip to content

Commit

Permalink
add otel_export_enable to aws and azure (#727)
Browse files Browse the repository at this point in the history
add otel_export_enable to aws and azure
  • Loading branch information
kristofre authored Nov 6, 2024
1 parent 158aa64 commit ac0f4f6
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 1 deletion.
13 changes: 13 additions & 0 deletions terraform/aws/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ This terraform script supports the use of custom domains via Route53.
route53_zone_name = "" # Name of route53 zone (defaults to public zones)
```

## Send OpenTelemetry Traces to Dynatrace

It is possible to leverage the [Ansible OpenTelemetry callback plugin](https://docs.ansible.com/ansible/latest/collections/community/general/opentelemetry_callback.html) to send Traces to the Dynatraces API.

The following variable need to be set to enable it:

```hcl
otel_export_enable = true
```

> Note: The traces will be sent to the `dt_tenant/api/v2/otlp` endpoint
> Note: The api token specified in the `dt_api_token` variable needs to have the additional `openTelemetryTrace.ingest` scope

## Useful Terraform Commands

Command | Result
Expand Down
1 change: 1 addition & 0 deletions terraform/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ module "provisioner" {
extra_vars = var.extra_vars
dashboard_user = var.dashboard_user
dashboard_password = local.dashboard_password
otel_export_enable = var.otel_export_enable

depends_on = [
aws_instance.acebox
Expand Down
6 changes: 6 additions & 0 deletions terraform/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,9 @@ variable "vpc_enable_nat_gateway" {
type = bool
default = false
}

variable "otel_export_enable" {
type = bool
description = "Enable openetelemetry export to Dynatrace"
default = false
}
14 changes: 14 additions & 0 deletions terraform/azure/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

```hcl
azure_location = "" # azure location where you want to provision the resources
azure_subscription_id = "" # azure subscription id in which subcsription you want to provision the resources
```

Check out `variables.tf` for a complete list of variables
Expand Down Expand Up @@ -64,6 +65,19 @@ This terraform script supports the use of custom domains via Azure DNS.
dns_zone_name = "example.com" # Name of Azure DNS zone
```

## Send OpenTelemetry Traces to Dynatrace

It is possible to leverage the [Ansible OpenTelemetry callback plugin](https://docs.ansible.com/ansible/latest/collections/community/general/opentelemetry_callback.html) to send Traces to the Dynatraces API.

The following variable need to be set to enable it:

```hcl
otel_export_enable = true
```

> Note: The traces will be sent to the `dt_tenant/api/v2/otlp` endpoint
> Note: The api token specified in the `dt_api_token` variable needs to have the additional `openTelemetryTrace.ingest` scope

## Useful Terraform Commands


Expand Down
3 changes: 2 additions & 1 deletion terraform/azure/acebox-azure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,5 @@ module "provisioner" {
extra_vars = var.extra_vars
dashboard_user = var.dashboard_user
dashboard_password = local.dashboard_password
}
otel_export_enable = var.otel_export_enable
}
1 change: 1 addition & 0 deletions terraform/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ terraform {

provider "azurerm" {
features {}
subscription_id = var.azure_subscription_id
}


Expand Down
10 changes: 10 additions & 0 deletions terraform/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

variable "azure_subscription_id" {
description = "Azure Subscription ID for provisioning the Azure resources"
}

variable "name_prefix" {
description = "Prefix to distinguish the instance"
default = "ace-box-cloud"
Expand Down Expand Up @@ -92,3 +96,9 @@ variable "dashboard_password" {
description = "ACE-Box dashboard password."
default = ""
}

variable "otel_export_enable" {
type = bool
description = "Enable openetelemetry export to Dynatrace"
default = false
}
5 changes: 5 additions & 0 deletions terraform/azure/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ terraform {
required_version = ">= 0.12.20"

required_providers {
/* azurerm = {
source = "hashicorp/azurerm"
version = "~> 4.x"
}
*/
random = "~> 3.3.2"
local = "~> 2.2.2"
}
Expand Down

0 comments on commit ac0f4f6

Please sign in to comment.