Azure / Azure/data-api-builder
[Bug]: add-telemetry overwrites Previous Telemetry Settings
- Langage dominant
- C#
- Étoiles
- 1.5k
- Forks
- 370
- Merge moyen
- 3 j 22 h
- PR mergées (30 j)
- 9
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 ✓
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par le point d’entrée CLI add-telemetry et reproduisez les deux commandes avec bug6.json. Examinez la manière dont le bloc de télémétrie est écrit lors de la deuxième invocation, puis ajoutez un test de régression montrant que les paramètres Application Insights existants sont conservés tandis que les paramètres OpenTelemetry sont mis à jour.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- azure, csharp
- Domaine
- cli, observability-sre
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 68/100