ServiceLevelIndicators.Asp.ApiVersioning
10.0.0-preview.6
dotnet add package ServiceLevelIndicators.Asp.ApiVersioning --version 10.0.0-preview.6
NuGet\Install-Package ServiceLevelIndicators.Asp.ApiVersioning -Version 10.0.0-preview.6
<PackageReference Include="ServiceLevelIndicators.Asp.ApiVersioning" Version="10.0.0-preview.6" />
<PackageVersion Include="ServiceLevelIndicators.Asp.ApiVersioning" Version="10.0.0-preview.6" />
<PackageReference Include="ServiceLevelIndicators.Asp.ApiVersioning" />
paket add ServiceLevelIndicators.Asp.ApiVersioning --version 10.0.0-preview.6
#r "nuget: ServiceLevelIndicators.Asp.ApiVersioning, 10.0.0-preview.6"
#:package ServiceLevelIndicators.Asp.ApiVersioning@10.0.0-preview.6
#addin nuget:?package=ServiceLevelIndicators.Asp.ApiVersioning&version=10.0.0-preview.6&prerelease
#tool nuget:?package=ServiceLevelIndicators.Asp.ApiVersioning&version=10.0.0-preview.6&prerelease
ServiceLevelIndicators.Asp.ApiVersioning
Adds API version as a metric dimension to ServiceLevelIndicators.Asp SLI metrics. Works with the Asp.Versioning package.
When To Use This Package
Choose ServiceLevelIndicators.Asp.ApiVersioning only when your ASP.NET Core application already uses Asp.Versioning and you want the resolved API version included in emitted SLI metrics.
This package extends ServiceLevelIndicators.Asp; it is not a replacement for it.
Installation
dotnet add package ServiceLevelIndicators.Asp.ApiVersioning
Requires ServiceLevelIndicators.Asp (installed automatically as a dependency).
Usage
Chain AddApiVersion() onto the SLI builder:
builder.Services.AddServiceLevelIndicator(options =>
{
options.LocationId = ServiceLevelIndicator.CreateLocationId("public", "westus3");
})
.AddMvc()
.AddApiVersion();
This registers ApiVersionEnrichment, which reads the resolved API version from the request and emits it as an attribute on every SLI measurement.
Requirements
- ASP.NET Core application using ServiceLevelIndicators.Asp
- Asp.Versioning configured in the application
AddApiVersion()chained onto the SLI builder
Emitted Attribute
| Attribute | Description |
|---|---|
http.api.version |
The resolved API version string (e.g. 1.0, 2024-01-15), Neutral, or Unspecified |
This attribute is added alongside all the standard attributes emitted by ServiceLevelIndicators.Asp (Operation, CustomerResourceId, LocationId, activity.status.code, http.response.status.code).
Further Reading
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Asp.Versioning.Http (>= 10.0.0-preview.2)
- ServiceLevelIndicators.Asp (>= 10.0.0-preview.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0-preview.6 | 40 | 3/14/2026 |
| 10.0.0-preview.2 | 69 | 3/5/2026 |
| 8.0.1 | 321 | 2/11/2025 |
| 8.0.0-alpha.25 | 116 | 11/22/2024 |
| 8.0.0-alpha.24 | 109 | 11/20/2024 |
| 8.0.0-alpha.17 | 159 | 5/21/2024 |
| 8.0.0-alpha.12 | 164 | 3/29/2024 |
| 8.0.0-alpha.7 | 142 | 1/24/2024 |
| 8.0.0-alpha.6 | 119 | 1/23/2024 |
| 1.1.2 | 334 | 12/14/2023 |
| 1.1.1 | 278 | 11/10/2023 |
| 1.0.1 | 295 | 10/3/2023 |
| 0.1.0-alpha.20 | 176 | 9/27/2023 |
| 0.1.0-alpha.19 | 125 | 9/27/2023 |
| 0.1.0-alpha.18 | 194 | 9/14/2023 |
| 0.1.0-alpha.10 | 214 | 8/23/2023 |