Skip to content

Commit

Permalink
signalr: enums, server prefix, transport definition
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Jul 26, 2023
1 parent 7d9ff65 commit f1e600e
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 76 deletions.
16 changes: 0 additions & 16 deletions docs/dotnet/dotnet-aspnet-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ This document defines semantic conventions for ASP.NET Core metrics, not specifi

**TODO:Any chance we will need to report any attributes in future?**

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

<!-- semconv metric.aspnet.server.unhandled_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -48,8 +46,6 @@ All routing metrics are reported by `Microsoft.AspNetCore.Routing` meter.

### Metric: `aspnet.routing.successful_matches`

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

<!-- semconv metric.aspnet.routing.match_attempts(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down Expand Up @@ -82,8 +78,6 @@ Metrics reported by `Microsoft.AspNetCore.Diagnostics` meter.

### Metric: `aspnet.diagnostics_handler.exceptions`

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

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

### Metric: `aspnet.rate_limiting.active_request_leases`

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

<!-- semconv metric.aspnet.rate_limiting.active_request_leases(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -124,8 +116,6 @@ All rate-limiting metrics are reported by `Microsoft.AspNetCore.RateLimiting` me

### Metric: `aspnet.rate_limiting.request_lease.duration`

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

<!-- semconv metric.aspnet.rate_limiting.request_lease.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -140,8 +130,6 @@ All rate-limiting metrics are reported by `Microsoft.AspNetCore.RateLimiting` me

### Metric: `aspnet.rate_limiting.queued_requests`

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

<!-- semconv metric.aspnet.rate_limiting.queued_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -158,8 +146,6 @@ All rate-limiting metrics are reported by `Microsoft.AspNetCore.RateLimiting` me

### Metric: `aspnet.rate_limiting.queued_requests.duration`

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

<!-- semconv metric.aspnet.rate_limiting.queued_request.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -178,8 +164,6 @@ All rate-limiting metrics are reported by `Microsoft.AspNetCore.RateLimiting` me

### Metric: `aspnet.rate_limiting.requests`

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

<!-- semconv metric.aspnet.rate_limiting.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 @@ -17,8 +17,6 @@ This document defines semantic conventions for DNS metrics emitted by .NET.

### Metric: `dns.lookups.duration`

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

<!-- semconv metric.dotnet.dns.lookup.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down
8 changes: 0 additions & 8 deletions docs/dotnet/dotnet-http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ All Http client metrics are reported by `System.Net.Http` meter.

### Metric: `http.client.open_connections`

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

<!-- semconv metric.dotnet.http.client.open_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down Expand Up @@ -60,8 +58,6 @@ All Http client metrics are reported by `System.Net.Http` meter.

### Metric: `http.client.connection.duration`

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

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

### Metric: `http.client.request.time_in_queue`

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

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

**TODO: any reason we don't have this metric in generic OTEL semconv?**

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

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

## Metric: `aspnet.kestrel.active_connections`

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

<!-- semconv metric.aspnet.kestrel.active_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -39,8 +37,6 @@ This document defines semantic conventions for Kestrel web server.

## Metric: `aspnet.kestrel.connection.duration`

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

<!-- semconv metric.aspnet.kestrel.connection.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand Down Expand Up @@ -69,8 +65,6 @@ This document defines semantic conventions for Kestrel web server.

## Metric: `aspnet.kestrel.rejected_connections`

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

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

## Metric: `aspnet.kestrel.queued_connections`

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

<!-- semconv metric.aspnet.kestrel.queued_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -112,8 +104,6 @@ Meter name is `Microsoft.AspNetCore.Server.Kestrel`

## Metric: `aspnet.kestrel.queued_requests`

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

<!-- semconv metric.aspnet.kestrel.queued_requests(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -136,8 +126,6 @@ Meter name is `Microsoft.AspNetCore.Server.Kestrel`

## Metric: `kestrel.upgraded_connections`

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

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

## Metric: `kestrel.tls_handshake.duration`

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

<!-- semconv metric.aspnet.kestrel.tls_handshake.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -183,9 +169,6 @@ Meter name is `Microsoft.AspNetCore.Server.Kestrel`

## Metric: `kestrel.active_tls_handshakes`

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


<!-- semconv metric.aspnet.kestrel.active_tls_handshakes(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
Expand All @@ -202,5 +185,4 @@ Meter name is `Microsoft.AspNetCore.Server.Kestrel`
**[1]:** **TODO: why not server.**? What's KEstrel-specific about it**
<!-- endsemconv -->


[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
53 changes: 35 additions & 18 deletions docs/dotnet/dotnet-signalr-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,70 @@ This document defines semantic conventions for SignalR metrics emitted by .NET c

## Metric: `signalr_http_transport.connection.duration`

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



<!-- semconv metric.signalr.server.connection.duration(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `signalr_http_transport.connection.duration` | Histogram | `s` | The duration of connections on the server. [1] |
| `signalr.server.http_transport.connection.duration` | Histogram | `s` | The duration of connections on the server. [1] |

**[1]:** **TODO: why http_transport? can we report protocol name as dimension and not a metric name?**
**TODO: we should do signalr.server**
Corresponding `EventCounter` name is `connections-duration`; Meter name is `Microsoft.AspNetCore.Http.Connections`
<!-- endsemconv -->

<!-- semconv metric.signalr.server.connection.duration(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `signalr.http_transport.status` | string | TODO [1] | `TODO` | Recommended |
| `signalr.http_transport.transport` | string | TODO [2] | `TODO` | Recommended |
| `signalr.http_transport.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Recommended |
| `signalr.transport` | string | SignalR transport - https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md | `web_sockets`; `long_polling` | Recommended |

**[1]:** **TODO: why not signalr.status? What's HTTP-specific about it**
`signalr.http_transport.status` MUST be one of the following:

**[2]:** **TODO: why not network.transport?**
<!-- endsemconv -->
| Value | Description |
|---|---|
| `normal_closure` | The connection was closed normally. |
| `timeout` | The connection was closed due to a timeout. |
| `app_shutdown` | The connection was closed because the app is shutting down. |

## Metric: `signalr_http_transport.active_connections`

**Status**: [Experimental][DocumentStatus]
`signalr.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.

| Value | Description |
|---|---|
| `server_sent_events` | ServerSentEvents protocol |
| `long_polling` | LongPolling protocol |
| `web_sockets` | WebSockets protocol |
<!-- endsemconv -->

## Metric: `signalr_http_transport.active_connections`

<!-- semconv metric.signalr.server.active_connections(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `signalr_http_transport.active_connections` | Histogram | `s` | Number of connections that are currently active on the server. [1] |
| `signalr.server.http_transport.active_connections` | Histogram | `s` | Number of connections that are currently active on the server. [1] |

**[1]:** **TODO: why http_transport? can we report protocol as dimension and not a metric name?**
**TODO: we should do signalr.server**
Corresponding `EventCounter` name is `current-connections`; Meter name is `Microsoft.AspNetCore.Http.Connections`
<!-- endsemconv -->

<!-- semconv metric.signalr.server.active_connections(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `signalr.http_transport.status` | string | TODO [1] | `TODO` | Recommended |
| `signalr.http_transport.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Recommended |
| `signalr.transport` | string | SignalR transport - https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md | `web_sockets`; `long_polling` | Recommended |

`signalr.http_transport.status` MUST be one of the following:

| Value | Description |
|---|---|
| `normal_closure` | The connection was closed normally. |
| `timeout` | The connection was closed due to a timeout. |
| `app_shutdown` | The connection was closed because the app is shutting down. |

`signalr.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.

**[1]:** **TODO: why not signalr.status? What's HTTP-specific about it**
| Value | Description |
|---|---|
| `server_sent_events` | ServerSentEvents protocol |
| `long_polling` | LongPolling protocol |
| `web_sockets` | WebSockets protocol |
<!-- endsemconv -->


Expand Down
46 changes: 32 additions & 14 deletions model/metrics/dotnet-signalr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,57 @@ groups:
brief: SignalR attributes
attributes:
- id: http_transport.status
type: string
brief: TODO
examples: ["TODO"]
note: "**TODO: why not signalr.status? What's HTTP-specific about it**"
- id: http_transport.transport
type: string
brief: TODO
examples: ["TODO"]
note: "**TODO: why not network.transport?**"
type:
members:
- id: normal_closure
value: 'normal_closure'
brief: 'The connection was closed normally.'
- id: timeout
value: 'timeout'
brief: 'The connection was closed due to a timeout.'
- id: app_shutdown
value: 'app_shutdown'
brief: 'The connection was closed because the app is shutting down.'
brief: SignalR HTTP connection closure status.
examples: ["app_shutdown", "timeout"]
- id: transport
brief: SignalR transport - https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md
type:
allow_custom_values: true
members:
- id: server_sent_events
value: 'server_sent_events'
brief: 'ServerSentEvents protocol'
- id: long_polling
value: 'long_polling'
brief: 'LongPolling protocol'
- id: web_sockets
value: 'web_sockets'
brief: 'WebSockets protocol'
examples: ["web_sockets", "long_polling"]

- id: metric.signalr.server.connection.duration
type: metric
metric_name: signalr_http_transport.connection.duration
metric_name: signalr.server.http_transport.connection.duration
brief: The duration of connections on the server.
instrument: histogram
unit: "s"
note: |
**TODO: why http_transport? can we report protocol name as dimension and not a metric name?**
**TODO: we should do signalr.server**
Corresponding `EventCounter` name is `connections-duration`; Meter name is `Microsoft.AspNetCore.Http.Connections`
attributes:
- ref: signalr.http_transport.status
- ref: signalr.http_transport.transport
- ref: signalr.transport

- id: metric.signalr.server.active_connections
type: metric
metric_name: signalr_http_transport.active_connections
metric_name: signalr.server.http_transport.active_connections
brief: Number of connections that are currently active on the server.
instrument: histogram
unit: "s"
note: |
**TODO: why http_transport? can we report protocol as dimension and not a metric name?**
**TODO: we should do signalr.server**
Corresponding `EventCounter` name is `current-connections`; Meter name is `Microsoft.AspNetCore.Http.Connections`
attributes:
- ref: signalr.http_transport.status
- ref: signalr.transport

Check failure on line 61 in model/metrics/dotnet-signalr.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[new-line-at-end-of-file] no new line character at the end of file

0 comments on commit f1e600e

Please sign in to comment.