Azure / Azure/data-api-builder
[Bug]: add-telemetry overwrites Previous Telemetry Settings
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
## Expected
Second call should only modify OTEL settings, preserving App Insights settings.
### North star
```
dab configure --runtime.telemetry.application-insights.enabled
dab configure --runtime.telemetry.application-insights.connection-string
dab configure --runtime.telemetry.open-telemetry.enabled
dab configure --runtime.telemetry.open-telemetry.endpoint
dab configure --runtime.telemetry.open-telemetry.headers
dab configure --runtime.telemetry.open-telemetry.exporter-protocol
dab configure --runtime.telemetry.open-telemetry.service-name
```
So that we can **deprecate** `add-telemetry`
## Actual
Second call resets app-insights enabled to false and removes connection-string.
## Workaround
Configure all telemetry providers in a single add-telemetry call.
## Details
Running dab add-telemetry --app-insights-enabled true then dab add-telemetry --otel-enabled true results in app-insights being reset to false and its connection-string being removed. Each call replaces the entire telemetry block rather than merging.
```bash
dab init --database-type mssql --connection-string "test" --config bug6.json
dab add-telemetry --app-insights-enabled true --app-insights-conn-string "InstrumentationKey=test123" --config bug6.json
# Config: application-insights.enabled = true, connection-string = "InstrumentationKey=test123" ✓
dab add-telemetry --otel-enabled true --otel-endpoint "http://localhost:4317" --config bug6.json
# Config: application-insights.enabled = false ✗ (overwritten)
# Config: application-insights.connection-string removed ✗
# Config: open-telemetry correctly set ✓
Contributor guide
Assessment
This issue has not been assessed yet.