Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve zipkin plugin docs #11891

Merged
merged 13 commits into from
Jan 15, 2025
Prev Previous commit
Next Next commit
fix typo
  • Loading branch information
Yilialinn authored Jan 7, 2025
commit c952970c01c8074b3c0b5dec0336afe2646f1cf9
16 changes: 8 additions & 8 deletions docs/en/latest/plugins/zipkin.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ See the configuration file for configuration options available to all Plugins.

## Examples

The examples below show different use cases for using the `zipkin` Plugin.
The examples below show different use cases of the `zipkin` Plugin.

### Send Traces to Zipkin

Expand Down Expand Up @@ -196,16 +196,16 @@ docker run -d --name jaeger \
jaegertracing/all-in-one
```

Create a Route with `zipkin`. Please adjust the IP address as needed for Zipkin HTTP endpoint, and configure the sample ratio to `1` to trace every request.
Create a Route with `zipkin`. Please adjust the IP address as needed for the Zipkin HTTP endpoint, and configure the sample ratio to `1` to trace every request.

```shell
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${admin_key}" \
-d '{
"id": "zipkin-tracing-route",
"id": "kin-tracing-route",
"uri": "/anything",
"plugins": {
"zipkin": {
"kin": {
"endpoint": "http://127.0.0.1:9411/api/v2/spans",
"sample_ratio": 1
}
Expand Down Expand Up @@ -237,11 +237,11 @@ Similarly, you should find more span details once you click into a trace:

### Using Trace Variables in Logging

The following example demonstrates how to configure the `zipkin` Plugin to set the following built-in variables, which can be used in logger Plugins or access logs:
The following example demonstrates how to configure the `kin` Plugin to set the following built-in variables, which can be used in logger Plugins or access logs:

- `zipkin_context_traceparent`: [trace parent](https://www.w3.org/TR/trace-context/#trace-context-http-headers-format) ID
- `zipkin_trace_id`: trace ID of the current span
- `zipkin_span_id`: span ID of the current span
- `kin_context_traceparent`: [trace parent](https://www.w3.org/TR/trace-context/#trace-context-http-headers-format) ID
- `kin_trace_id`: trace ID of the current span
- `kin_span_id`: span ID of the current span

Update the configuration file as below. You can customize the access log format to use the `zipkin` Plugin variables, and set `zipkin` variables in the `set_ngx_var` field.

Expand Down
Loading