Skip to content

Define azd telemetry component #209

Description

@weikanglim

We need to set up a component that allows us to log telemetry prior to #190. This can be as simple as using appinsights-go package directly to log to AppInsights, or a more robust solution.

Requirements in descending order of importance:

  • Minimizing observable performance impact on CLI due to telemetry being emitted / uploaded
  • Reliability of telemetry (how well does telemetry respond to early terminations, crashes, telemetry service unavailability).
  • Ease of developer use in instrumentation
  • Latency of telemetry (ingestion delay)

Note that the most important telemetry we emit (the azd command usage) happens near the end of the application process lifecycle, which further emphasizes the importance of the first two requirements (performance and reliability). Any delay here impacts user perceivable performance of the tool, which is tricky to deal with, when we're experiencing ~100ms (networking + service response time) order of latency for us to upload the telemetry.

Proposal

  • Application emits telemetry. Telemetry is batched and upon CLI exit or batch size being met, it is stored to disk.
  • Upon CLI exit, a background process is invoked to perform upload of telemetry if any telemetry was emitted.
  • The background process (there will only be one) will upload stored telemetry on disk.
    • Upon transient failures, stored telemetry is retried with delay, using disk storage as the queue.
    • A cleanup thread is run separately to ensure that storage is never too backed up

Progress

  • Add conversion between otel spans into ApplicationInsights event envelopes
  • Add transmitter class for sending events to AppInsights
  • Add local logs storage + background transmitter
  • Create wrappers around OpenTelemetry for common telemetry usage

Metadata

Metadata

Assignees

Labels

area/telemetryTelemetry, tracing, observability

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions