Skip to content

Commit e8df5cd

Browse files
committed
Code review
1 parent ec9096a commit e8df5cd

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

site/content/how-to/monitoring/tracing.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ Visit [http://127.0.0.1:16686](http://127.0.0.1:16686) to view the dashboard.
5959

6060
## Enabling Tracing
6161

62-
Enabling tracing requires two pieces of configuration. The first is a resource called `NginxProxy`, which contains global settings relating to the NGINX data plane. This resource is created and managed by the [cluster operator](https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/), and is referenced in the `parametersRef` field of the GatewayClass. This resource can be created and linked when we install NGINX Gateway Fabric using its helm chart, or it can be added later. In this guide we will install the resource using the helm chart, but will also show what it looks like in case you want to add it after installation.
62+
Enabling tracing requires two pieces of configuration.
63+
64+
- `NginxProxy`: This resource contains global settings relating to the NGINX data plane. It is created and managed by the [cluster operator](https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/), and is referenced in the `parametersRef` field of the GatewayClass. This resource can be created and linked when we install NGINX Gateway Fabric using its helm chart, or it can be added later. In this guide we will install the resource using the helm chart, but will also show what it looks like in case you want to add it after installation.
6365

6466
The `NginxProxy` resource contains configuration for the collector, and applies to all Gateways and routes under the GatewayClass. It does not enable tracing, but is a prerequisite to the next piece of configuration.
6567

66-
The second piece of configuration is the `ObservabilityPolicy`, which is a [Policy](https://gateway-api.sigs.k8s.io/reference/policy-attachment/) that targets HTTPRoutes or GRPCRoutes. This Policy is created by the [application developer](https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/) and enables tracing for a specific route or routes. It requires the `NginxProxy` resource to exist in order to complete the tracing configuration.
68+
- `ObservabilityPolicy`: Theis resource is a [Policy](https://gateway-api.sigs.k8s.io/reference/policy-attachment/) that targets HTTPRoutes or GRPCRoutes. It is created by the [application developer](https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/) and enables tracing for a specific route or routes. It requires the `NginxProxy` resource to exist in order to complete the tracing configuration.
6769

6870
TODO(sberman): link to reference docs
6971

@@ -277,14 +279,14 @@ spec:
277279
name: coffee
278280
tracing:
279281
strategy: ratio
280-
ratio: 50
282+
ratio: 75
281283
spanAttributes:
282284
- key: coffee-key
283285
value: coffee-value
284286
EOF
285287
```
286288

287-
This policy attaches to the coffee HTTPRoute and enables ratio-based tracing, where 50% of requests will be sampled. We've also included a span attribute to add extra data to the spans.
289+
This policy attaches to the coffee HTTPRoute and enables ratio-based tracing, where 75% of requests will be sampled. We've also included a span attribute to add extra data to the spans.
288290

289291
Let's check the status of the policy:
290292

@@ -310,13 +312,13 @@ Status:
310312
Controller Name: gateway.nginx.org/nginx-gateway-controller
311313
```
312314

313-
The policy is accepted, so now let's send some more traffic.
315+
The policy is accepted, so now let's send some more traffic. Run the following command multiple times.
314316

315317
```shell
316-
for i in $(seq 1 10); do curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee; sleep 1; done
318+
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee
317319
```
318320

319-
This will send 10 requests. Once complete, let's refresh the Jaeger dashboard. We should now see a service entry called `ngf:default:cafe`, and a few traces. The service name by default is `ngf:<gateway-namespace>:<gateway-name>`.
321+
Once complete, let's refresh the Jaeger dashboard. We should now see a service entry called `ngf:default:cafe`, and a few traces. The service name by default is `ngf:<gateway-namespace>:<gateway-name>`.
320322

321323
{{<img src="img/jaeger-trace-overview.png" alt="">}}
322324

0 commit comments

Comments
 (0)