dotnet / sdk-container-builds

Libraries and build tooling to create container images from .NET projects using MSBuild
https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container
MIT License
175 stars 30 forks source link

Improve the telemetry of the containers tools #539

Open baronfel opened 5 months ago

baronfel commented 5 months ago

Today the .NET CLI collects telemetry during a given build from a variety of data sources, and one part of this telemetry is the PublishProtocol MSBuild Property. We (MS) use this property to track usage rates of the containers feature, as well as other message metadata like

This data point works great as long as people are using the containerization features via the dotnet publish -p PublishProfile=DefaultContainer mechanism (or another named profile). However, with the advent of Aspire and support for publishing multiple projects, more and more users are using containers via the more generic target-based mechanism: dotnet publish /t:PublishContainer.

Publishes that use the target-based form never set PublishProtocol to the DefaultContainer value, and so are not reflected in our telemetry. To accurate gauge usage of the feature, we'd like to make explicit containerization telemetry checkpoints that gathers specific data about how the container publish occurred.

Data to gather on success

Data to gather on failure

There are a number of places where the operation can fail, and each of them can have different data. At minimum we should be tracking why the failure occurred. Some examples of failure reasons include:

For remote registries

For local storage (docker/podman)

For tar.gz output

Data protection concerns

The information we gather will of course be

baronfel commented 1 week ago

Need to write docs for this now that it has been merged: