Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release/3.4.x] feat(opentelemetry): make endpoint field referenceable #11259

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
The field `header_type`now accepts the `aws` value to handle this specific
propagation header.
[11075](https://github.com/Kong/kong/pull/11075)
- **Opentelemetry**: Support the `endpoint` parameter as referenceable.
[#11220](https://github.com/Kong/kong/pull/11220)
- **Ip-Restriction**: Add TCP support to the plugin.
Thanks [@scrudge](https://github.com/scrudge) for contributing this change.
[#10245](https://github.com/Kong/kong/pull/10245)
Expand Down
2 changes: 1 addition & 1 deletion kong/plugins/opentelemetry/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ return {
{ config = {
type = "record",
fields = {
{ endpoint = typedefs.url { required = true } }, -- OTLP/HTTP
{ endpoint = typedefs.url { required = true, referenceable = true } }, -- OTLP/HTTP
{ headers = { description = "The custom headers to be added in the HTTP request sent to the OTLP server. This setting is useful for adding the authentication headers (token) for the APM backend.", type = "map",
keys = typedefs.header_name,
values = {
Expand Down
3 changes: 3 additions & 0 deletions spec/03-plugins/37-opentelemetry/04-exporter_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ for _, strategy in helpers.each_strategy() do
describe("#referenceable fields", function ()
local mock
lazy_setup(function()
helpers.setenv("TEST_OTEL_ENDPOINT", "http://127.0.0.1:" .. HTTP_SERVER_PORT)
helpers.setenv("TEST_OTEL_ACCESS_KEY", "secret-1")
helpers.setenv("TEST_OTEL_ACCESS_SECRET", "secret-2")

Expand All @@ -476,6 +477,7 @@ for _, strategy in helpers.each_strategy() do
}, { "opentelemetry" }))

setup_instrumentations("all", {
endpoint = "{vault://env/test_otel_endpoint}",
headers = {
["X-Access-Key"] = "{vault://env/test_otel_access_key}",
["X-Access-Secret"] = "{vault://env/test_otel_access_secret}",
Expand All @@ -485,6 +487,7 @@ for _, strategy in helpers.each_strategy() do
end)

lazy_teardown(function()
helpers.unsetenv("TEST_OTEL_ENDPOINT")
helpers.unsetenv("TEST_OTEL_ACCESS_KEY")
helpers.unsetenv("TEST_OTEL_ACCESS_SECRET")
helpers.stop_kong()
Expand Down
Loading