@@ -152,37 +152,152 @@ curl "http://127.0.0.1:9080/anything"
152152
153153``` text
1541542024-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)
162155ScopeSpans #0
163156ScopeSpans SchemaURL:
164157InstrumentationScope opentelemetry-lua
165158Span #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 :
175288Attributes:
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