diff --git a/apisix/plugins/opentelemetry.lua b/apisix/plugins/opentelemetry.lua index fec3d0cacea3..12d61c99fc3b 100644 --- a/apisix/plugins/opentelemetry.lua +++ b/apisix/plugins/opentelemetry.lua @@ -295,7 +295,7 @@ function _M.rewrite(conf, api_ctx) end end - local ctx, _ = tracer:start(upstream_context, api_ctx.var.request_uri, { + local ctx = tracer:start(upstream_context, api_ctx.var.request_uri, { kind = span_kind.client, attributes = attributes, }) diff --git a/conf/config-default.yaml b/conf/config-default.yaml index 65506083aded..17b1838a974f 100644 --- a/conf/config-default.yaml +++ b/conf/config-default.yaml @@ -407,6 +407,21 @@ plugin_attr: service_name: APISIX service_instance_name: APISIX Instance Name endpoint_addr: http://127.0.0.1:12800 + opentelemetry: + trace_id_source: x-request-id + resource: + service.name: APISIX + collector: + address: 127.0.0.1:4317 + request_timeout: 3 + request_headers: + Authorization: token + batch_span_processor: + drop_on_queue_full: false + max_queue_size: 1024 + batch_timeout: 2 + inactive_timeout: 1 + max_export_batch_size: 16 prometheus: export_uri: /apisix/prometheus/metrics metric_prefix: apisix_ diff --git a/docs/en/latest/plugins/opentelemetry.md b/docs/en/latest/plugins/opentelemetry.md index 4f7d599cc381..d2610eb02159 100644 --- a/docs/en/latest/plugins/opentelemetry.md +++ b/docs/en/latest/plugins/opentelemetry.md @@ -90,7 +90,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f1 ## How to set collecting -We can set the collecting by specifying the configuration in `conf/config.yaml`. +You can set the collecting by specifying the configuration in `conf/config.yaml`. | Name | Type | Default | Description | | ------------ | ------ | -------- | ----------------------------------------------------- |