Skip to content

Commit

Permalink
docs: update opentelemetry plugin doc attribute and correct otel co…
Browse files Browse the repository at this point in the history
…llector misplaced comment in config file (#10943)

* remove the use of attribute[0] to describe data within the array

* add missing attribute additional_header_prefix_attributes to the zh doc

* correct the misplaced comment for otel collector in config-default.yaml
  • Loading branch information
kayx23 authored Feb 20, 2024
1 parent bfc6a19 commit f79c4eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion conf/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ plugin_attr: # Plugin attributes
inactive_timeout: 1 # Set the timeout for spans to wait in the export queue before being sent,
# if the queue is not full.
max_export_batch_size: 16 # Set the maximum number of spans to include in each batch sent to the
set_ngx_var: false # export opentelemetry variables to nginx variables
# OpenTelemetry collector.
set_ngx_var: false # Export opentelemetry variables to NGINX variables.
prometheus: # Plugin: prometheus
export_uri: /apisix/prometheus/metrics # Set the URI for the Prometheus metrics endpoint.
metric_prefix: apisix_ # Set the prefix for Prometheus metrics generated by APISIX.
Expand Down
6 changes: 2 additions & 4 deletions docs/en/latest/plugins/opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ The Plugin only supports binary-encoded [OLTP over HTTP](https://opentelemetry.i
| sampler.options.root.name | string | False | always_off | ["always_on", "always_off", "trace_id_ratio"] | Root sampling strategy. |
| sampler.options.root.options | object | False | {fraction = 0} | | Root sampling strategy parameters. |
| sampler.options.root.options.fraction | number | False | 0 | [0, 1] | Root sampling probability for `trace_id_ratio`. |
| additional_attributes | array[string] | False | | | Variables and its values which will be appended to the trace span. |
| additional_attributes[0] | string | True | | | APISIX or Nginx variables. For example, `http_header` or `route_id`. |
| additional_header_prefix_attributes | array[string] | False | | | Headers or headers prefixes to be appended to the trace span's attributes. |
| additional_header_prefix_attributes[0]| string | True | | | Request headers. For example, `x-my-header"` or `x-my-headers-*` to include all headers with the prefix `x-my-headers-`. |
| additional_attributes | array[string] | False | | | Additional attributes appended to the trace span. Support built-in NGINX or APISIX variables in values, such as `http_header` or `route_id`. |
| additional_header_prefix_attributes | array[string] | False | | | Headers or header prefixes appended to the trace span's attributes. For example, use `x-my-header"` or `x-my-headers-*` to include all headers with the prefix `x-my-headers-`. |

### Configuring the collector

Expand Down
4 changes: 2 additions & 2 deletions docs/zh/latest/plugins/opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ description: 本文介绍了关于 Apache APISIX `opentelemetry` 插件的基本
| sampler.options.root.name | string || always_off | ["always_on", "always_off", "trace_id_ratio"] | root 采样策略。 |
| sampler.options.root.options | object || {fraction = 0} | | root 采样策略参数。 |
| sampler.options.root.options.fraction | number || 0 | [0, 1] | `trace_id_ratio` root 采样策略的百分比 |
| additional_attributes | array[string] || | | 追加到 trace span 的额外属性(变量名为 `key`,变量值为 `value`|
| additional_attributes[0] | string | | | | APISIX 或 NGINX 变量,例如:`http_header` 或者 `route_id` |
| additional_attributes | array[string] || | | 追加到 trace span 的额外属性,支持内置 NGINX 或 APISIX 变量,例如:`http_header` 或者 `route_id`|
| additional_header_prefix_attributes | array[string] | False | | | 附加到跟踪范围属性的标头或标头前缀。例如,使用 `x-my-header"``x-my-headers-*` 来包含带有前缀 `x-my-headers-` 的所有标头。 |

## 如何设置数据上报

Expand Down

0 comments on commit f79c4eb

Please sign in to comment.