Skip to content

Commit 9a1b5dc

Browse files
authored
Fix Serving Metric Queue Names + add HTTP Metrics (#6533)
* Fix Serving Metric Queue Names * include otel http metrics
1 parent 1bd2fae commit 9a1b5dc

File tree

1 file changed

+66
-5
lines changed

1 file changed

+66
-5
lines changed

docs/versioned/serving/observability/metrics/serving-metrics.md

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,63 @@ Administrators can monitor Serving control plane based on the metrics exposed by
1313

1414
These metrics may change as we flush out our migration from OpenCensus to OpenTelemetry
1515

16-
## Queue Proxy
16+
## Workload Metrics
1717

18-
The queue proxy is the per-pod sidecar that enforces container concurrency and provides metrics to the autoscaler. The following metrics provide you insights into queued
18+
Each workload pod has a sidecar that enforces container concurrency and provides metrics to the autoscaler. The following OTel metrics provide you insights into queued
1919
requests and user-container behavior.
2020

21-
### `kn.queueproxy.depth`
21+
The following attributes are included with workload metrics
22+
23+
Name | Type | Description
24+
-|-|-
25+
`container.name` | string | Name of the container emit metrics. This is hardcoded to `queue-proxy`.
26+
`k8s.namespace.name` | string | Namespace of the workload
27+
`k8s.pod.name` | string | Name of the workload pod
28+
`service.version` | string | Version of the sidecar emitting metrics
29+
`service.name` | string | Either the name of the Knative Service, Configuration or Revision.
30+
`service.instance.id` | string | Identifier of the instance which is the same as the `k8s.pod.name`
31+
`kn.service.name` | string | Knative Service name associated with this Revision
32+
`kn.configuration.name` | string | Knative Configuration name associated with this Revision
33+
`kn.revision.name` | string | The name of the Revision
34+
35+
### `kn.serving.queue.depth`
2236

2337
**Instrument Type:** Int64Gauge
2438

2539
**Unit ([UCUM](https://ucum.org)):** {request}
2640

2741
**Description:** Number of current items in the queue proxy queue
2842

29-
### `kn.queueproxy.app.duration`
43+
### `kn.serving.invocation.duration`
3044

3145
**Instrument Type:** Float64Histogram
3246

3347
**Unit ([UCUM](https://ucum.org)):** s
3448

3549
**Description:** The duration of the task execution
3650

51+
The following attributes are included with the metric
52+
53+
Name | Type | Description
54+
-|-|-
55+
`http.response.status_code` | int | Status code of the duration
56+
57+
### HTTP metrics
58+
59+
Since the sidecar receives and forwards requests to the user container it has both HTTP server and client metrics.
60+
61+
#### HTTP Server Metrics
62+
63+
Knative implements the [semantic conventions for HTTP Servers](https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#http-server) using the OpenTelemetry [otel-go/otelhttp](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) package.
64+
65+
Please refer to the [OpenTelemetry docs](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) for details about the HTTP Server metrics it exports.
66+
67+
#### HTTP Client Metrics
68+
69+
Knative implements the [semantic conventions for HTTP Clients](https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#http-client) using the OpenTelemetry [otel-go/otelhttp](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) package.
70+
71+
Please refer to the [OpenTelemetry docs](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) for details about the HTTP Client metrics it exports.
72+
3773
## Activator
3874

3975
The following metrics can help you to understand how an application responds when traffic passes through the activator. For example, when scaling from zero, high request latency might mean that requests are taking too much time to be fulfilled.
@@ -51,10 +87,35 @@ The following attributes are included with the metric
5187

5288
Name | Type | Description
5389
-|-|-
54-
`k8s.namespace.name` | string | Namespace of the Revision
90+
`k8s.namespace.name` | string | Namespace of the resource
91+
`kn.service.name` | string | Knative Service name associated with this Revision
92+
`kn.configuration.name` | string | Knative Configuration name associated with this Revision
93+
`kn.revision.name` | string | The name of the Revision
94+
95+
### HTTP metrics
96+
97+
Since the activator receives and forwards requests to the user workload it has both HTTP server and client metrics.
98+
99+
#### HTTP Server Metrics
100+
101+
Knative implements the [semantic conventions for HTTP Servers](https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#http-server) using the OpenTelemetry [otel-go/otelhttp](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) package.
102+
103+
Please refer to the [OpenTelemetry docs](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) for details about the HTTP Server metrics it exports.
104+
105+
The following attributes are included in the server metrics
106+
107+
Name | Type | Description
108+
-|-|-
55109
`kn.service.name` | string | Knative Service name associated with this Revision
56110
`kn.configuration.name` | string | Knative Configuration name associated with this Revision
57111
`kn.revision.name` | string | The name of the Revision
112+
`k8s.namespace.name` | string | Namespace of the resource
113+
114+
#### HTTP Client Metrics
115+
116+
Knative implements the [semantic conventions for HTTP Clients](https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#http-client) using the OpenTelemetry [otel-go/otelhttp](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) package.
117+
118+
Please refer to the [OpenTelemetry docs](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) for details about the HTTP Client metrics it exports.
58119

59120
## Autoscaler
60121

0 commit comments

Comments
 (0)