You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Route with `zipkin` and use the default span version 2. You should adjust the IP address as needed for the Zipkin HTTP endpoint, and configure the sample ratio to `1` to trace every request.
81
81
82
+
:::note
83
+
84
+
You can fetch the `admin_key` from `config.yaml` and save to an environment variable with the following command:
85
+
86
+
```bash
87
+
admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 's/"//g')
88
+
```
89
+
90
+
:::
91
+
82
92
```shell
83
93
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
84
94
-H "X-API-KEY: ${admin_key}" \
@@ -202,10 +212,10 @@ Create a Route with `zipkin`. Please adjust the IP address as needed for the Zip
202
212
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
203
213
-H "X-API-KEY: ${admin_key}" \
204
214
-d '{
205
-
"id": "kin-tracing-route",
215
+
"id": "zipkin-tracing-route",
206
216
"uri": "/anything",
207
217
"plugins": {
208
-
"kin": {
218
+
"zipkin": {
209
219
"endpoint": "http://127.0.0.1:9411/api/v2/spans",
210
220
"sample_ratio": 1
211
221
}
@@ -237,11 +247,11 @@ Similarly, you should find more span details once you click into a trace:
237
247
238
248
### Using Trace Variables in Logging
239
249
240
-
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:
250
+
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:
241
251
242
-
- `kin_context_traceparent`: [trace parent](https://www.w3.org/TR/trace-context/#trace-context-http-headers-format) ID
243
-
- `kin_trace_id`: trace ID of the current span
244
-
- `kin_span_id`: span ID of the current span
252
+
- `zipkin_context_traceparent`: [trace parent](https://www.w3.org/TR/trace-context/#trace-context-http-headers-format) ID
253
+
- `zipkin_trace_id`: trace ID of the current span
254
+
- `zipkin_span_id`: span ID of the current span
245
255
246
256
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.
0 commit comments