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

fix: update otel version to match Kong Gateway version #13325

Merged
merged 1 commit into from
Jul 2, 2024
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
19 changes: 14 additions & 5 deletions kong/clustering/compat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,20 @@ function _M.check_configuration_compatibility(cp, dp)
-- CP plugin needs to match DP plugins with major version
-- CP must have plugin with equal or newer version than that on DP

if cp_plugin.major ~= dp_plugin.major or
cp_plugin.minor < dp_plugin.minor then
local msg = "configured data plane " .. name .. " plugin version " .. dp_plugin.version ..
" is different to control plane plugin version " .. cp_plugin.version
return nil, msg, CLUSTERING_SYNC_STATUS.PLUGIN_VERSION_INCOMPATIBLE
-- luacheck:ignore 542
if name == "opentelemetry" and dp_plugin.major == 0 and dp_plugin.minor == 1 then
-- The first version of the opentelemetry plugin was introduced into the Kong code base with a version
-- number 0.1.0 and released that way. In subsequent releases, the version number was then not updated
-- to avoid the compatibility check from failing. To work around this issue and allow us to fix the
-- version number of the opentelemetry plugin, we're accepting the plugin with version 0.1.0 to be
-- compatible
else
if cp_plugin.major ~= dp_plugin.major or
cp_plugin.minor < dp_plugin.minor then
local msg = "configured data plane " .. name .. " plugin version " .. dp_plugin.version ..
" is different to control plane plugin version " .. cp_plugin.version
return nil, msg, CLUSTERING_SYNC_STATUS.PLUGIN_VERSION_INCOMPATIBLE
end
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion kong/plugins/opentelemetry/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local clone = require "table.clone"
local otlp = require "kong.plugins.opentelemetry.otlp"
local propagation = require "kong.tracing.propagation"
local tracing_context = require "kong.tracing.tracing_context"
local kong_meta = require "kong.meta"


local ngx = ngx
Expand All @@ -24,7 +25,7 @@ local _log_prefix = "[otel] "


local OpenTelemetryHandler = {
VERSION = "0.1.0",
VERSION = kong_meta.version,
PRIORITY = 14,
}

Expand Down
Loading