Skip to content

Commit

Permalink
chore: Rename additional_header_attributes to additional_header_prefi…
Browse files Browse the repository at this point in the history
…x_attributes
  • Loading branch information
jaysonsantos committed Sep 5, 2022
1 parent 8266b2a commit a19a27b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apisix/plugins/opentelemetry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ local schema = {
minLength = 1,
}
},
additional_header_attributes = {
additional_header_prefix_attributes = {
type = "array",
items = {
type = "string",
Expand Down Expand Up @@ -320,10 +320,10 @@ function _M.rewrite(conf, api_ctx)
inject_attributes(attributes, conf.additional_attributes, api_ctx.var, false)
end

if conf.additional_header_attributes then
if conf.additional_header_prefix_attributes then
inject_attributes(
attributes,
conf.additional_header_attributes,
conf.additional_header_prefix_attributes,
core.request.headers(api_ctx),
true
)
Expand Down
4 changes: 2 additions & 2 deletions docs/en/latest/plugins/opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ The Plugin only supports binary-encoded [OLTP over HTTP](https://opentelemetry.i
| 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_attributes | array[string] | False | | | Variables and its values which will be appended to the trace span. |
| additional_header_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_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-`. |

### Configuring the collector

Expand Down
2 changes: 1 addition & 1 deletion t/plugin/opentelemetry2.t
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ opentelemetry export span
"sampler": {
"name": "always_on"
},
"additional_header_attributes": [
"additional_header_prefix_attributes": [
"x-my-header-*"
]
}
Expand Down

0 comments on commit a19a27b

Please sign in to comment.