Skip to content

Commit

Permalink
feat: Added deployment environment to otel collector (#2846)
Browse files Browse the repository at this point in the history
added deployment environment to otel collector
  • Loading branch information
mamari90 authored Mar 3, 2025
1 parent 40d8e7d commit 42400ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/elk-monitoring/05_elastic_stack.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ resource "kubectl_manifest" "otel_collector" {

apm_endpoint = var.otel_collector_cloud_migration ? var.elastic_cloud_apm_endpoint : "http://quickstart-apm-http.elastic-system.svc.cluster.local:8200"
apm_authorization = var.otel_collector_cloud_migration ? "ApiKey ${data.azurerm_key_vault_secret.apm_api_key[0].value}" : "Bearer ${data.kubernetes_secret.get_apm_token.data.secret-token}"
deployment_env = var.env
})

force_conflicts = true
Expand Down
8 changes: 8 additions & 0 deletions src/elk-monitoring/env/opentelemetry_operator_helm/otel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ spec:
check_interval: 1s
limit_mib: 2000
batch:
resource:
attributes:
- key: deployment.environment
value: ${deployment_env}
action: upsert
exporters:
logging:
Expand All @@ -32,10 +37,13 @@ spec:
pipelines:
traces:
receivers: [otlp]
processors: [resource]
exporters: [logging, otlphttp/elastic]
metrics:
receivers: [otlp]
processors: [resource]
exporters: [logging, otlphttp/elastic]
logs:
receivers: [otlp]
processors: [resource]
exporters: [logging, otlphttp/elastic]

0 comments on commit 42400ce

Please sign in to comment.