|
11 | 11 | - [User Stories](#user-stories)
|
12 | 12 | - [Steady-State trace collection](#steady-state-trace-collection)
|
13 | 13 | - [On-Demand trace collection](#on-demand-trace-collection)
|
| 14 | + - [Risks and Mitigations](#risks-and-mitigations) |
| 15 | +- [Design Details](#design-details) |
14 | 16 | - [Tracing API Requests](#tracing-api-requests)
|
15 | 17 | - [Exporting Spans](#exporting-spans)
|
16 | 18 | - [Running the OpenTelemetry Collector](#running-the-opentelemetry-collector)
|
@@ -107,6 +109,14 @@ kubectl proxy --port=8080 &
|
107 | 109 | curl http://localhost:8080/api/v1/nodes -H "traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4737-0000000000000000-01"
|
108 | 110 | ```
|
109 | 111 |
|
| 112 | +### Risks and Mitigations |
| 113 | + |
| 114 | +The primary risk associated with distributed tracing is DDOS. A user that can send a large number of sampled requests can cause the server to generate a large number of spans. This is mitigated by allowing respecting the incoming trace context for privileged (`system:master` and `system:monitoring` groups) users and by configuring the to `SamplingRatePerMillion` to a low value. |
| 115 | + |
| 116 | +There is also a risk of memory usage incurred by storing spans prior to export. This is mitigated by limiting the number of spans that can be queued for export, and dropping spans if necessary to stay under that limit. |
| 117 | + |
| 118 | +## Design Details |
| 119 | + |
110 | 120 | ### Tracing API Requests
|
111 | 121 |
|
112 | 122 | We will wrap the API Server's http server and http clients with [otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/master/instrumentation/net/http/otelhttp) to get spans for incoming and outgoing http requests. This generates spans for all sampled incoming requests and propagates context with all client requests. For incoming requests, this would go below [WithRequestInfo](https://github.com/kubernetes/kubernetes/blob/9eb097c4b07ea59c674a69e19c1519f0d10f2fa8/staging/src/k8s.io/apiserver/pkg/server/config.go#L676) in the filter stack, as it must be after authentication and authorization, before the panic filter, and is closest in function to the WithRequestInfo filter.
|
@@ -282,15 +292,18 @@ _This section must be completed when targeting beta graduation to a release._
|
282 | 292 | ###### How can an operator determine if the feature is in use by workloads?
|
283 | 293 | This is an operator-facing feature. Look for traces to see if tracing is enabled.
|
284 | 294 |
|
285 |
| -###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? |
286 |
| - - OpenTelemetry does not currently expose metrics about the number of traces successfully sent: https://github.com/open-telemetry/opentelemetry-go/issues/2547 |
| 295 | +###### How can someone using this feature know that it is working for their instance? |
| 296 | + Look for spans. If you see them, then it is working. |
287 | 297 |
|
288 |
| -###### What are the reasonable SLOs (Service Level Objectives) for the above SLIs? |
| 298 | +###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? |
289 | 299 | N/A
|
290 | 300 |
|
291 |
| -###### Are there any missing metrics that would be useful to have to improve observability of this feature? |
| 301 | +###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? |
292 | 302 | N/A
|
293 | 303 |
|
| 304 | +###### Are there any missing metrics that would be useful to have to improve observability of this feature? |
| 305 | + Yes, those are being added in OpenTelemetry, and we will use them once they are present: https://github.com/open-telemetry/opentelemetry-go/issues/2547 |
| 306 | + |
294 | 307 | ### Dependencies
|
295 | 308 |
|
296 | 309 | _This section must be completed when targeting beta graduation to a release._
|
|
0 commit comments