Skip to content

Commit

Permalink
unify routing matches metrics and rename connection.usage to open_con…
Browse files Browse the repository at this point in the history
…nections
  • Loading branch information
lmolkova committed Jul 26, 2023
1 parent 42860c0 commit d797b84
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 74 deletions.
37 changes: 2 additions & 35 deletions docs/dotnet/dotnet-aspnet-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,15 @@ All routing metrics are reported by `Microsoft.AspNetCore.Routing` meter.

**Status**: [Experimental][DocumentStatus]

**TODO: can we try one aspnet.routing.matches** ?

This metric is required.

<!-- semconv metric.aspnet.routing.successful_matches(metric_table) -->
<!-- semconv metric.aspnet.routing.match_attempts(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `aspnet.routing.successful_matches` | Counter | `{match}` | Number of requests that successfully matched to an endpoint. [1] |

**[1]:** Meter name is `Microsoft.AspNetCore.Routing`.
<!-- endsemconv -->

<!-- semconv metric.aspnet.routing.successful_matches(full) -->
<!-- semconv metric.aspnet.routing.match_attempts(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `aspnet.routing.fallback` | string | TODO | `TODO` | Required |
Expand All @@ -52,24 +48,6 @@ This metric is required.
SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.
<!-- endsemconv -->

### Metric: `aspnet.routing.failed_matches`

**TODO: would if be useful to add method name, scheme, or other attributes?**

**Status**: [Experimental][DocumentStatus]

This metric is required.
<!-- semconv metric.aspnet.routing.failed_matches(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `aspnet.routing.failed_matches` | Counter | `{match}` | Number of requests that failed to match to an endpoint. [1] |

**[1]:** An unmatched request may be handled by later middleware, such as the static files or authentication middleware. Meter name is `Microsoft.AspNetCore.Routing`
<!-- endsemconv -->

<!-- semconv metric.aspnet.routing.failed_matches(full) -->
<!-- endsemconv -->

## Exception metrics

Metrics reported by `Microsoft.AspNetCore.Diagnostics` meter.
Expand All @@ -78,7 +56,6 @@ Metrics reported by `Microsoft.AspNetCore.Diagnostics` meter.

**Status**: [Experimental][DocumentStatus]

This metric is required.
<!-- semconv metric.aspnet.diagnostics_handler.exceptions(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -103,8 +80,6 @@ All rate-limiting metrics are reported by `Microsoft.AspNetCore.RateLimiting` me

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.aspnet.rate_limiting.active_request_leases(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -123,8 +98,6 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.aspnet.rate_limiting.request_lease.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -141,8 +114,6 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.aspnet.rate_limiting.queued_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -166,8 +137,6 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.aspnet.rate_limiting.queued_request.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -189,8 +158,6 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.aspnet.rate_limiting.rejected_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down
2 changes: 0 additions & 2 deletions docs/dotnet/dotnet-dns-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ This document defines semantic conventions for DNS metrics emitted by .NET.

**Status**: [Experimental][DocumentStatus]

This metric is required.

This metric SHOULD be specified with
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/metrics/api.md#instrument-advice)
of **`[TODO]`**.
Expand Down
10 changes: 1 addition & 9 deletions docs/dotnet/dotnet-http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ All Http client metrics are reported by `System.Net.Http` meter.

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.dotnet.http.client.connections.usage(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down Expand Up @@ -63,8 +61,6 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.dotnet.http.client.connection.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down Expand Up @@ -101,8 +97,6 @@ Follows common [http.client.duration](../http/http-metrics.md#metric-httpclientd

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.dotnet.http.client.active_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down Expand Up @@ -161,8 +155,6 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original

**Status**: [Experimental][DocumentStatus]

This metric is required.

<!-- semconv metric.dotnet.http.client.failed_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down Expand Up @@ -240,7 +232,7 @@ Follows common [http.server.active_requests](../http/http-metrics.md#metric-http

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.aspnet.server.unhandled_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand Down
16 changes: 8 additions & 8 deletions docs/dotnet/dotnet-kestrel-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This document defines semantic conventions for Kestrel web server.

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.active_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand All @@ -43,7 +43,7 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.connection.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand Down Expand Up @@ -75,7 +75,7 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.rejected_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand All @@ -100,7 +100,7 @@ Meter name is `Microsoft.AspNetCore.Server.Kestrel`

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.queued_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand All @@ -122,7 +122,7 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.queued_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand All @@ -148,7 +148,7 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.upgraded_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand All @@ -171,7 +171,7 @@ Meter name is `Microsoft.AspNetCore.Server.Kestrel`

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.tls_handshake.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand Down Expand Up @@ -199,7 +199,7 @@ This metric is required.

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.kestrel.active_tls_handshakes(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand Down
4 changes: 2 additions & 2 deletions docs/dotnet/dotnet-signalr-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This document defines semantic conventions for SignalR metrics emitted by .NET c

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.signalr.server.connection.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand All @@ -44,7 +44,7 @@ Corresponding `EventCounter` name is `connections-duration`; Meter name is `Micr

**Status**: [Experimental][DocumentStatus]

This metric is required.


<!-- semconv metric.signalr.server.active_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
Expand Down
31 changes: 16 additions & 15 deletions model/metrics/dotnet-aspnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,30 @@ groups:
**TODO Any reason not to put it into aspnet? seems ASP.NET -specific (middleware, app code), not necessarily HTTP?**
# routing
- id: metric.aspnet.routing.successful_matches
- id: metric.aspnet.routing.match_attempts
type: metric
metric_name: aspnet.routing.successful_matches
brief: Number of requests that successfully matched to an endpoint.
metric_name: aspnet.routing.match_attempts
brief: Number of requests that were attempted to be matched to an endpoint.
instrument: counter
unit: "{match}"
note: >
Meter name is `Microsoft.AspNetCore.Routing`.
note: Meter name is `Microsoft.AspNetCore.Routing`.
attributes:
- ref: http.route
requirement_level: required
- ref: aspnet.routing.fallback
requirement_level: required

- id: metric.aspnet.routing.failed_matches
type: metric
metric_name: aspnet.routing.failed_matches
brief: Number of requests that failed to match to an endpoint.
note: >
An unmatched request may be handled by later middleware, such as the static files or authentication middleware.
Meter name is `Microsoft.AspNetCore.Routing`
instrument: counter
unit: "{match}"
- id: match_status
type:
allow_custom_values: true
members:
- id: success
value: 'success'
brief: 'TODO'
- id: failure
value: 'failure'
brief: 'TODO'
brief: Match result - success or failure
examples: ["success", "failure"]

# diagnostics
- id: metric.aspnet.diagnostics_handler.exceptions
Expand Down
6 changes: 3 additions & 3 deletions model/metrics/dotnet-http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ groups:
unit: "s"
note: Meter name is `System.Net.NameResolution`.
attributes:
- id: question.name
- id: dns.question.name
type: string
brief: The name being queried.
requirement_level: required
Expand All @@ -21,9 +21,9 @@ groups:
Tabs, carriage returns, and line feeds should be converted to \t, \r, and
\n respectively.
- id: metric.dotnet.http.client.connections.usage
- id: metric.dotnet.http.client.open_connections
type: metric
metric_name: http.client.connections.usage
metric_name: http.client.open_connections
brief: "Number of outbound HTTP connections that are currently active or idle on the client"
instrument: updowncounter
unit: "{connection}"
Expand Down

0 comments on commit d797b84

Please sign in to comment.