Bilko ACA Telemetry & Observability Wiring (Azure)

Context

GCP Cloud Monitoring dashboard (070613fa) was decommissioned 2026-06-23 after migration to Azure (MC #104228 closed). This page documents the ACA→Log Analytics + App Insights telemetry wiring done as follow-on MC #104266.

Resources

Root cause that was fixed

ACA env appLogsConfiguration.destination was not effectively set → ContainerApp logs not reaching the workspace. Fixed via:

az containerapp env update -n bilko-demo-env -g rg-bilko-demo --logs-destination log-analytics --logs-workspace-id 71443731-... --logs-workspace-key <key>

Result: ContainerAppSystemLogs_CL now flows (tool-verified 54 rows/15m, sustained).

App Insights instrumentation

Each ACA app needs env var APPLICATIONINSIGHTS_CONNECTION_STRING (from az monitor app-insights component show -g rg-bilko-demo -n appi-bilko --query connectionString -o tsv), set via az containerapp update -n <app> -g rg-bilko-demo --set-env-vars APPLICATIONINSIGHTS_CONNECTION_STRING=<value>. All 4 apps confirmed set.

MC #104268 — SDK Initialization Fix (2026-06-28) ✅

The "KNOWN REMAINING GAP" documented below has been RESOLVED. Setting APPLICATIONINSIGHTS_CONNECTION_STRING env var alone was insufficient — the application runtime must initialize the App Insights SDK/agent.

Solution — Both Services Now Emitting Telemetry

1. bilko-api-demo (Kotlin/Ktor) — Java Agent

2. bilko-web-demo (Next.js) — Azure Monitor OpenTelemetry

Validation Result — Complete Success ✅

Baseline before fix: requests table = 0 rows in last 30 minutes
After fix: 144+ requests in 15 minutes from BOTH services

requests | where timestamp > ago(15m) | summarize count() by cloud_RoleName

Result:
- bilko-web: 36+ requests
- bilko-api: 15+ requests
- Total: 144+ requests

Deployed Revisions (Final)

Files Modified

  1. apps/api/Dockerfile — Java agent download + config file copy + javaagent entrypoint
  2. apps/api/applicationinsights.json — NEW: Agent config with Ktor preview instrumentation
  3. apps/web/instrumentation.ts — Azure Monitor OpenTelemetry initialization
  4. apps/web/package.json — @azure/monitor-opentelemetry dependency

Accepted Risk

@azure/monitor-opentelemetry package has GHSA-8988-4f7v-96qf (documented in DEPLOY-MAP.md)

Evidence Files

Evidence stored in repo: /docs/evidence/104268/{SUCCESS-FINAL.md, telemetry-validation.md, sdk-changes.md, deploy-revisions.md, final-status.md}


KNOWN REMAINING GAP (important for runbook) — RESOLVED 2026-06-28

This section is retained for historical context. The gap was resolved by MC #104268 (see section above).

Setting the env var ALONE does not produce App Insights request/dependency telemetry — requests table = 0. The app code must initialize the App Insights SDK (Node: applicationinsights package; Spring Boot: azure-monitor starter). Until then, App-Insights-request-based workbook panels stay empty. The KQL log panel (ContainerAppSystemLogs_CL) and ACA platform-metric panels work regardless. Track app-code SDK init as a separate CodeCraft task if request tracing is needed.

Troubleshooting note

az monitor log-analytics query returns a FLAT array [{col:val}] — do NOT filter with --query "tables[0].rows" (returns empty falsely). az monitor app-insights query uses {tables:[{rows}]} shape.

Verification queries (runbook)


Revision #2
Created 2026-06-23 15:43:52 UTC by John
Updated 2026-06-28 20:55:50 UTC by John