Skip to content

Commit 8c388f4

Browse files
Update opentelemetry-agents.md
Added Terraform for other sections
1 parent a18d224 commit 8c388f4

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

articles/container-apps/opentelemetry-agents.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,29 @@ az containerapp env telemetry data-dog set \
180180
# [Terraform](#tab/terraform)
181181

182182
```hcl
183+
resource "azapi_update_resource" "app_insights_open_telemetry_integration" {
184+
name = azurerm_container_app_environment.managed_environment.name
185+
parent_id = azurerm_resource_group.resource_group.id
186+
type = "Microsoft.App/managedEnvironments@2023-11-02-preview"
187+
body = jsonencode({
188+
properties = {
189+
openTelemetryConfiguration = {
190+
destinationsConfiguration = {
191+
dataDogConfiguration = {
192+
site = "<YOUR_DATADOG_SUBDOMAIN>.datadoghq.com"
193+
key = "<YOUR_DATADOG_KEY>"
194+
}
195+
}
196+
tracesConfiguration = {
197+
destinations = ["dataDog"]
198+
}
199+
metricsConfiguration = {
200+
destinations = ["dataDog"]
201+
}
202+
}
203+
}
204+
})
205+
}
183206
```
184207

185208
---
@@ -253,6 +276,48 @@ az containerapp env telemetry otlp add \
253276
# [Terraform](#tab/terraform)
254277

255278
```hcl
279+
resource "azapi_update_resource" "app_insights_open_telemetry_integration" {
280+
name = azurerm_container_app_environment.managed_environment.name
281+
parent_id = azurerm_resource_group.resource_group.id
282+
type = "Microsoft.App/managedEnvironments@2023-11-02-preview"
283+
body = jsonencode({
284+
properties = {
285+
openTelemetryConfiguration = {
286+
destinationsConfiguration = {
287+
otlpConfigurations = [
288+
{
289+
name = "otlp1"
290+
endpoint = "ENDPOINT_URL_1"
291+
insecure = false
292+
headers = "api-key-1=key"
293+
},
294+
{
295+
name = "otlp2"
296+
endpoint = "ENDPOINT_URL_2"
297+
insecure = true
298+
}
299+
]
300+
}
301+
logsConfiguration = {
302+
destinations = [
303+
"otlp2"
304+
]
305+
},
306+
tracesConfiguration = {
307+
destinations = [
308+
"otlp1",
309+
"otlp2"
310+
]
311+
},
312+
metricsConfiguration = {
313+
destinations = [
314+
"otlp1"
315+
]
316+
}
317+
}
318+
}
319+
})
320+
}
256321
```
257322

258323
---

0 commit comments

Comments
 (0)