Azure / Azure/azure-sdk-tools

Pipelines should emit a packages_published_total metric

Open
#6,380 0 comments 0 reactions 0 assignees View on GitHub
Central-EngSys
Dominant language
C#
Stars
135
Forks
260
Avg merge
1d 22h
Merged PRs (30d)
115

Description

We should start emitting metrics from our pipelines to track the number of packages we publish.

The pipelines should emit a metric in the [logmetric format](https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/982/Pipeline-log-metrics?anchor=emitting-metrics):

```
logmetric: { "name": "packages_published_total", "value": 1, "timestamp": "2023-06-21T19:03:27Z", "labels": { "format": "npm", ... } }
```

The metric name should be the same for all languages and package types (nuget, npm, etc...). The labels should differentiate the packages by:
- **language** : "dotnet"
- **feed** : "azure-sdk/public/azure-sdk-for-net"
- **format**: "nuget"
- **service**: "storage"
- **package_name**: "Azure.Storage.Blobs.ChangeFeed"
- **version**: "12.0.0-preview.35"
- **release_type**: "beta" ("official", "alpha", etc)

With good labels, this will allow us to locate releases of individual packages, or aggregate the packages emitted by language, service or feed:

**official release count by calendar month**
``` kusto
Metrics
| where Timestamp >= startofmonth(ago(365d))
| where Name == "packages_published_total"
| where Labels.release_type == "official"
| summarize sum(Value) by startofmonth(Timestamp)
```

**find the build id that released a specific version**
``` kusto
Metrics
| where Timestamp >= ago(365d)
| where Name == "packages_published_total"
| where Labels.release_type == "official"
| where Labels.package_name == "Azure.Storage.Blobs.ChangeFeed"
| where Labels.version == "12.0.0"
| project Timestamp, BuildId, LogId, LineNumber
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the package-publishing pipelines and the Azure DevOps logmetric format referenced in the issue. Add the shared packages_published_total metric across the relevant language and package-type pipelines, with the listed labels, and verify that published packages produce the expected release records.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
ci-cd, observability, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.