Skip to content

Commit 0577ab2

Browse files
committed
update docs
1 parent f6e92b8 commit 0577ab2

2 files changed

Lines changed: 268 additions & 38 deletions

File tree

docs/en/latest/plugins/opentelemetry.md

Lines changed: 131 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,37 +153,152 @@ In OpenTelemetry collector's log, you should see information similar to the foll
153153

154154
```text
155155
2024-02-18T17:14:03.825Z info ResourceSpans #0
156-
Resource SchemaURL:
157-
Resource attributes:
158-
-> telemetry.sdk.language: Str(lua)
159-
-> telemetry.sdk.name: Str(opentelemetry-lua)
160-
-> telemetry.sdk.version: Str(0.1.1)
161-
-> hostname: Str(e34673e24631)
162-
-> service.name: Str(APISIX)
163156
ScopeSpans #0
164157
ScopeSpans SchemaURL:
165158
InstrumentationScope opentelemetry-lua
166159
Span #0
167-
Trace ID : fbd0a38d4ea4a128ff1a688197bc58b0
160+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
161+
Parent ID : 905f850f13e32bfb
162+
ID : 5a3835b61110d942
163+
Name : http_router_match
164+
Kind : Internal
165+
Start time : 2025-10-24 06:58:04.430430976 +0000 UTC
166+
End time : 2025-10-24 06:58:04.431542016 +0000 UTC
167+
Status code : Unset
168+
Status message :
169+
Span #1
170+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
171+
Parent ID : 905f850f13e32bfb
172+
ID : 4ab25e2b92f394e1
173+
Name : resolve_dns
174+
Kind : Internal
175+
Start time : 2025-10-24 06:58:04.432521984 +0000 UTC
176+
End time : 2025-10-24 06:58:04.44903296 +0000 UTC
177+
Status code : Unset
178+
Status message :
179+
Span #2
180+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
181+
Parent ID : 905f850f13e32bfb
182+
ID : 3620c0f05dd2be4f
183+
Name : apisix.phase.header_filter
184+
Kind : Internal
185+
Start time : 2025-10-24 06:58:06.960481024 +0000 UTC
186+
End time : 2025-10-24 06:58:06.960510976 +0000 UTC
187+
Status code : Unset
188+
Status message :
189+
Span #3
190+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
191+
Parent ID : 4c5f3476f62a7e8a
192+
ID : a9bfad7bb6986e41
193+
Name : apisix.phase.body_filter
194+
Kind : Internal
195+
Start time : 2025-10-24 06:58:06.960579072 +0000 UTC
196+
End time : 2025-10-24 06:58:06.96059008 +0000 UTC
197+
Status code : Unset
198+
Status message :
199+
Span #4
200+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
201+
Parent ID : b2994675df6baa83
202+
ID : 26705f9c47584a5b
203+
Name : apisix.phase.delayed_body_filter.opentelemetry
204+
Kind : Internal
205+
Start time : 2025-10-24 06:58:06.960613888 +0000 UTC
206+
End time : 2025-10-24 06:58:06.960687104 +0000 UTC
207+
Status code : Unset
208+
Status message :
209+
Span #5
210+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
211+
Parent ID : 4c5f3476f62a7e8a
212+
ID : b2994675df6baa83
213+
Name : apisix.phase.delayed_body_filter
214+
Kind : Internal
215+
Start time : 2025-10-24 06:58:06.96059904 +0000 UTC
216+
End time : 2025-10-24 06:58:06.960692992 +0000 UTC
217+
Status code : Unset
218+
Status message :
219+
Span #6
220+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
221+
Parent ID : 905f850f13e32bfb
222+
ID : 4c5f3476f62a7e8a
223+
Name : apisix.phase.body_filter
224+
Kind : Server
225+
Start time : 2025-10-24 06:58:06.96056704 +0000 UTC
226+
End time : 2025-10-24 06:58:06.960698112 +0000 UTC
227+
Status code : Unset
228+
Status message :
229+
Span #7
230+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
231+
Parent ID : 2024d73d32cbd81b
232+
ID : 223c64fb691a24e8
233+
Name : apisix.phase.body_filter
234+
Kind : Internal
235+
Start time : 2025-10-24 06:58:06.961624064 +0000 UTC
236+
End time : 2025-10-24 06:58:06.961635072 +0000 UTC
237+
Status code : Unset
238+
Status message :
239+
Span #8
240+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
241+
Parent ID : fd193dd24c618f60
242+
ID : 8729ad6e0d94a23b
243+
Name : apisix.phase.delayed_body_filter.opentelemetry
244+
Kind : Internal
245+
Start time : 2025-10-24 06:58:06.961648896 +0000 UTC
246+
End time : 1970-01-01 00:00:00 +0000 UTC
247+
Status code : Unset
248+
Status message :
249+
Span #9
250+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
251+
Parent ID : 2024d73d32cbd81b
252+
ID : fd193dd24c618f60
253+
Name : apisix.phase.delayed_body_filter
254+
Kind : Internal
255+
Start time : 2025-10-24 06:58:06.961641984 +0000 UTC
256+
End time : 1970-01-01 00:00:00 +0000 UTC
257+
Status code : Unset
258+
Status message :
259+
Span #10
260+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
261+
Parent ID : 905f850f13e32bfb
262+
ID : 2024d73d32cbd81b
263+
Name : apisix.phase.body_filter
264+
Kind : Server
265+
Start time : 2025-10-24 06:58:06.960980992 +0000 UTC
266+
End time : 1970-01-01 00:00:00 +0000 UTC
267+
Status code : Unset
268+
Status message :
269+
Span #11
270+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
271+
Parent ID : cfb0b4603dc2e385
272+
ID : 905f850f13e32bfb
273+
Name : apisix.phase.access
274+
Kind : Server
275+
Start time : 2025-10-24 06:58:04.427932928 +0000 UTC
276+
End time : 1970-01-01 00:00:00 +0000 UTC
277+
Status code : Unset
278+
Status message :
279+
Span #12
280+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
168281
Parent ID :
169-
ID : af3dc7642104748a
170-
Name : GET /anything
282+
ID : cfb0b4603dc2e385
283+
Name : GET /headers
171284
Kind : Server
172-
Start time : 2024-02-18 17:14:03.763244032 +0000 UTC
173-
End time : 2024-02-18 17:14:03.920229888 +0000 UTC
285+
Start time : 2025-10-24 06:58:04.432427008 +0000 UTC
286+
End time : 2025-10-24 06:58:06.962299904 +0000 UTC
174287
Status code : Unset
175288
Status message :
176289
Attributes:
177290
-> net.host.name: Str(127.0.0.1)
178291
-> http.method: Str(GET)
179292
-> http.scheme: Str(http)
180-
-> http.target: Str(/anything)
181-
-> http.user_agent: Str(curl/7.64.1)
293+
-> http.target: Str(/headers)
294+
-> http.user_agent: Str(curl/8.16.0)
182295
-> apisix.route_id: Str(otel-tracing-route)
183296
-> apisix.route_name: Empty()
184-
-> http.route: Str(/anything)
297+
-> http.route: Str(/headers)
185298
-> http.status_code: Int(200)
186-
{"kind": "exporter", "data_type": "traces", "name": "debug"}
299+
{"resource": {"service.instance.id": "5006c483-d64c-4d1d-87ac-edb037ba3669", "service.name": "otelcol-contrib", "service.version": "0.138.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "traces"}
300+
2025-10-24T06:58:13.893Z info Metrics {"resource": {"service.instance.id": "5006c483-d64c-4d1d-87ac-edb037ba3669", "service.name": "otelcol-contrib", "service.version": "0.138.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "metrics", "resource metrics": 1, "metrics": 25, "data points": 26}
301+
2025-10-24T06:58:13.893Z info ResourceMetrics #0
187302
```
188303

189304
To visualize these traces, you can export your telemetry to backend Services, such as Zipkin and Prometheus. See [exporters](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter) for more details.

docs/zh/latest/plugins/opentelemetry.md

Lines changed: 137 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -152,37 +152,152 @@ curl "http://127.0.0.1:9080/anything"
152152

153153
```text
154154
2024-02-18T17:14:03.825Z info ResourceSpans #0
155-
Resource SchemaURL:
156-
Resource attributes:
157-
-> telemetry.sdk.language: Str(lua)
158-
-> telemetry.sdk.name: Str(opentelemetry-lua)
159-
-> telemetry.sdk.version: Str(0.1.1)
160-
-> hostname: Str(e34673e24631)
161-
-> service.name: Str(APISIX)
162155
ScopeSpans #0
163156
ScopeSpans SchemaURL:
164157
InstrumentationScope opentelemetry-lua
165158
Span #0
166-
Trace ID : fbd0a38d4ea4a128ff1a688197bc58b0
159+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
160+
Parent ID : 905f850f13e32bfb
161+
ID : 5a3835b61110d942
162+
Name : http_router_match
163+
Kind : Internal
164+
Start time : 2025-10-24 06:58:04.430430976 +0000 UTC
165+
End time : 2025-10-24 06:58:04.431542016 +0000 UTC
166+
Status code : Unset
167+
Status message :
168+
Span #1
169+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
170+
Parent ID : 905f850f13e32bfb
171+
ID : 4ab25e2b92f394e1
172+
Name : resolve_dns
173+
Kind : Internal
174+
Start time : 2025-10-24 06:58:04.432521984 +0000 UTC
175+
End time : 2025-10-24 06:58:04.44903296 +0000 UTC
176+
Status code : Unset
177+
Status message :
178+
Span #2
179+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
180+
Parent ID : 905f850f13e32bfb
181+
ID : 3620c0f05dd2be4f
182+
Name : apisix.phase.header_filter
183+
Kind : Internal
184+
Start time : 2025-10-24 06:58:06.960481024 +0000 UTC
185+
End time : 2025-10-24 06:58:06.960510976 +0000 UTC
186+
Status code : Unset
187+
Status message :
188+
Span #3
189+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
190+
Parent ID : 4c5f3476f62a7e8a
191+
ID : a9bfad7bb6986e41
192+
Name : apisix.phase.body_filter
193+
Kind : Internal
194+
Start time : 2025-10-24 06:58:06.960579072 +0000 UTC
195+
End time : 2025-10-24 06:58:06.96059008 +0000 UTC
196+
Status code : Unset
197+
Status message :
198+
Span #4
199+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
200+
Parent ID : b2994675df6baa83
201+
ID : 26705f9c47584a5b
202+
Name : apisix.phase.delayed_body_filter.opentelemetry
203+
Kind : Internal
204+
Start time : 2025-10-24 06:58:06.960613888 +0000 UTC
205+
End time : 2025-10-24 06:58:06.960687104 +0000 UTC
206+
Status code : Unset
207+
Status message :
208+
Span #5
209+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
210+
Parent ID : 4c5f3476f62a7e8a
211+
ID : b2994675df6baa83
212+
Name : apisix.phase.delayed_body_filter
213+
Kind : Internal
214+
Start time : 2025-10-24 06:58:06.96059904 +0000 UTC
215+
End time : 2025-10-24 06:58:06.960692992 +0000 UTC
216+
Status code : Unset
217+
Status message :
218+
Span #6
219+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
220+
Parent ID : 905f850f13e32bfb
221+
ID : 4c5f3476f62a7e8a
222+
Name : apisix.phase.body_filter
223+
Kind : Server
224+
Start time : 2025-10-24 06:58:06.96056704 +0000 UTC
225+
End time : 2025-10-24 06:58:06.960698112 +0000 UTC
226+
Status code : Unset
227+
Status message :
228+
Span #7
229+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
230+
Parent ID : 2024d73d32cbd81b
231+
ID : 223c64fb691a24e8
232+
Name : apisix.phase.body_filter
233+
Kind : Internal
234+
Start time : 2025-10-24 06:58:06.961624064 +0000 UTC
235+
End time : 2025-10-24 06:58:06.961635072 +0000 UTC
236+
Status code : Unset
237+
Status message :
238+
Span #8
239+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
240+
Parent ID : fd193dd24c618f60
241+
ID : 8729ad6e0d94a23b
242+
Name : apisix.phase.delayed_body_filter.opentelemetry
243+
Kind : Internal
244+
Start time : 2025-10-24 06:58:06.961648896 +0000 UTC
245+
End time : 1970-01-01 00:00:00 +0000 UTC
246+
Status code : Unset
247+
Status message :
248+
Span #9
249+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
250+
Parent ID : 2024d73d32cbd81b
251+
ID : fd193dd24c618f60
252+
Name : apisix.phase.delayed_body_filter
253+
Kind : Internal
254+
Start time : 2025-10-24 06:58:06.961641984 +0000 UTC
255+
End time : 1970-01-01 00:00:00 +0000 UTC
256+
Status code : Unset
257+
Status message :
258+
Span #10
259+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
260+
Parent ID : 905f850f13e32bfb
261+
ID : 2024d73d32cbd81b
262+
Name : apisix.phase.body_filter
263+
Kind : Server
264+
Start time : 2025-10-24 06:58:06.960980992 +0000 UTC
265+
End time : 1970-01-01 00:00:00 +0000 UTC
266+
Status code : Unset
267+
Status message :
268+
Span #11
269+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
270+
Parent ID : cfb0b4603dc2e385
271+
ID : 905f850f13e32bfb
272+
Name : apisix.phase.access
273+
Kind : Server
274+
Start time : 2025-10-24 06:58:04.427932928 +0000 UTC
275+
End time : 1970-01-01 00:00:00 +0000 UTC
276+
Status code : Unset
277+
Status message :
278+
Span #12
279+
Trace ID : 95a1644afaaf65e1f0193b1f193b990a
167280
Parent ID :
168-
ID : af3dc7642104748a
169-
Name : GET /anything
281+
ID : cfb0b4603dc2e385
282+
Name : GET /headers
170283
Kind : Server
171-
Start time : 2024-02-18 17:14:03.763244032 +0000 UTC
172-
End time : 2024-02-18 17:14:03.920229888 +0000 UTC
284+
Start time : 2025-10-24 06:58:04.432427008 +0000 UTC
285+
End time : 2025-10-24 06:58:06.962299904 +0000 UTC
173286
Status code : Unset
174287
Status message :
175288
Attributes:
176-
-> net.host.name: Str(127.0.0.1)
177-
-> http.method: Str(GET)
178-
-> http.scheme: Str(http)
179-
-> http.target: Str(/anything)
180-
-> http.user_agent: Str(curl/7.64.1)
181-
-> apisix.route_id: Str(otel-tracing-route)
182-
-> apisix.route_name: Empty()
183-
-> http.route: Str(/anything)
184-
-> http.status_code: Int(200)
185-
{"kind": "exporter", "data_type": "traces", "name": "debug"}
289+
-> net.host.name: Str(127.0.0.1)
290+
-> http.method: Str(GET)
291+
-> http.scheme: Str(http)
292+
-> http.target: Str(/headers)
293+
-> http.user_agent: Str(curl/8.16.0)
294+
-> apisix.route_id: Str(otel-tracing-route)
295+
-> apisix.route_name: Empty()
296+
-> http.route: Str(/headers)
297+
-> http.status_code: Int(200)
298+
{"resource": {"service.instance.id": "5006c483-d64c-4d1d-87ac-edb037ba3669", "service.name": "otelcol-contrib", "service.version": "0.138.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "traces"}
299+
2025-10-24T06:58:13.893Z info Metrics {"resource": {"service.instance.id": "5006c483-d64c-4d1d-87ac-edb037ba3669", "service.name": "otelcol-contrib", "service.version": "0.138.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "metrics", "resource metrics": 1, "metrics": 25, "data points": 26}
300+
2025-10-24T06:58:13.893Z info ResourceMetrics #0
186301
```
187302

188303
要可视化这些追踪,你可以将 traces 导出到后端服务,例如 Zipkin 和 Prometheus。有关更多详细信息,请参阅[exporters](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter)

0 commit comments

Comments
 (0)