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
feat: add plugin execution tracing to OpenTelemetry plugin
This commit adds plugin execution tracing capability to the OpenTelemetry plugin,
allowing users to trace individual plugin phases (rewrite, access, header_filter,
body_filter, log) as child spans of the main request trace.
Changes:
- Added trace_plugins configuration option (default: false, opt-in)
- Added plugin_span_kind configuration for observability provider compatibility
- Enhanced plugin execution with OpenTelemetry span creation and finishing
- Added comprehensive request context attributes to plugin spans
- Updated documentation with examples and usage instructions
- Added comprehensive test suite for the new functionality
Features:
- Plugin Phase Tracing: Creates child spans for each plugin phase execution
- Rich Context: Includes HTTP method, URI, hostname, user agent, route info, and service info
- Configurable: Can be enabled/disabled via trace_plugins configuration
- Span Kind Control: Supports internal (default) and server span kinds for observability provider compatibility
- Proper Hierarchy: Plugin spans are correctly nested under main request spans
- Performance: Minimal overhead when disabled (default behavior)
Configuration:
- trace_plugins: boolean (default: false) - Enable/disable plugin tracing
- plugin_span_kind: string (default: 'internal') - Span kind for plugin spans
- 'internal': Standard internal operation (may be excluded from metrics)
- 'server': Server-side operation (typically included in service-level metrics)
This addresses GitHub issue #12510 and provides end-to-end tracing visibility
for APISIX plugin execution phases.
- OpenTelemetry tracing: [OpenTelemetry](docs/en/latest/plugins/opentelemetry.md) with plugin execution tracing
126
127
- Open source APM: support [Apache SkyWalking](docs/en/latest/plugins/skywalking.md)
127
128
- Works with external service discovery: In addition to the built-in etcd, it also supports [Consul](docs/en/latest/discovery/consul.md), [Consul_kv](docs/en/latest/discovery/consul_kv.md), [Nacos](docs/en/latest/discovery/nacos.md), [Eureka](docs/en/latest/discovery/eureka.md) and [Zookeeper (CP)](https://github.com/api7/apisix-seed/blob/main/docs/en/latest/zookeeper.md).
128
129
- Monitoring And Metrics: [Prometheus](docs/en/latest/plugins/prometheus.md)
0 commit comments