Skip to content

Commit

Permalink
feature: add opentelemetry plugin. (apache#3891)
Browse files Browse the repository at this point in the history
  • Loading branch information
roketyyang committed Jan 25, 2022
1 parent d83a5e4 commit e602fce
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apisix/plugins/opentelemetry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down
15 changes: 15 additions & 0 deletions conf/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
2 changes: 1 addition & 1 deletion docs/en/latest/plugins/opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| ------------ | ------ | -------- | ----------------------------------------------------- |
Expand Down

0 comments on commit e602fce

Please sign in to comment.