Azure / Azure/data-api-builder

[Bug]: add-telemetry overwrites Previous Telemetry Settings

Offen
#3,539 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
2.0 cli
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

## 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 ✓

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne am add-telemetry CLI-Einstiegspunkt und führe die beiden Befehle anhand von bug6.json erneut aus. Untersuche, wie der Telemetrieblock beim zweiten Aufruf geschrieben wird, und füge einen Regressionstest hinzu, der zeigt, dass vorhandene Application Insights-Einstellungen erhalten bleiben, während die OpenTelemetry-Einstellungen aktualisiert werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, csharp
Bereich
cli, observability-sre
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.