Skip to content

feat(dcgw): Add OTEL_RESOURCE_ATTRIBUTES as supported#5480

Open
cloudjumpercat wants to merge 2 commits into
release/gateway-3.15from
feat/otel-resource-attributes-env-var-dcgw
Open

feat(dcgw): Add OTEL_RESOURCE_ATTRIBUTES as supported#5480
cloudjumpercat wants to merge 2 commits into
release/gateway-3.15from
feat/otel-resource-attributes-env-var-dcgw

Conversation

@cloudjumpercat
Copy link
Copy Markdown
Contributor

@cloudjumpercat cloudjumpercat commented Jun 5, 2026

Description

Fixes #5256

Preview Links

https://deploy-preview-5480--kongdeveloper.netlify.app/dedicated-cloud-gateways/reference/#kong-gateway-configuration

Question for reviewers: In 3.15, we're supporting OTEL_RESOURCE_ATTRIBUTES as an env var. This one WON'T have a KONG prefix. DCGW is supporting it, but when I add it to the {% kong_config_table env %} table, it automatically prefixes it with KONG_. I've attempted to update the table with Claude's fix (detailed below). It also seems like the env var isn't in the kong.conf JSON that was just generated a few days ago despite the Jira ticket saying it was completed.

Claude's fix for the table

This is the summary of what Claude says it's fixing:

Context
In Gateway 3.15, Dedicated Cloud Gateways support OTEL_RESOURCE_ATTRIBUTES as an environment variable. Unlike every other DCGW env var, this one is a standard OpenTelemetry variable and does not carry the KONG_ prefix.

The {% kong_config_table env %} block in app/dedicated-cloud-gateways/reference.md:401-433 automatically renders each field name as KONG_ in env mode. The prefixing happens in format_name at app/_plugins/drops/kong_config_table.rb:35-40:

def format_name(name, mode)
return name if mode == 'conf'
return "KONG_#{name.upcase}" if mode == 'env'
raise "Unknown kong_config_table mode: #{mode}"
end
There is currently no way to render an un-prefixed env var, so otel_resource_attributes renders incorrectly as KONG_OTEL_RESOURCE_ATTRIBUTES.

Approach
Add an opt-out flag, prefix: false, that can be set on an individual config entry. When set, env mode renders the upcased name without the KONG_ prefix.

  1. app/_plugins/drops/kong_config_table.rb
    KongConfigField already holds the per-field config hash in @config, so no signature changes are needed. Update format_name to honor the flag:

def format_name(name, mode)
return name if mode == 'conf'

if mode == 'env'
return name.upcase if @config['prefix'] == false

return "KONG_#{name.upcase}"

end

raise "Unknown kong_config_table mode: #{mode}"
end
Default behavior is unchanged (flag absent or true keeps the KONG_ prefix), so the other 17 files using the block are unaffected.

Checklist

  • Tested how-to docs. If not, note why here.
  • All pages contain metadata.
  • Any new docs link to existing docs.
  • All autogenerated instructions render correctly (API, decK, Konnect, Kong Manager).
  • Style guide (capitalized gateway entities, placeholder URLs) implemented correctly.
  • Every page has a description entry in frontmatter.
  • Add new pages to the product documentation index (if applicable).

Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 5, 2026 15:08
@cloudjumpercat cloudjumpercat requested a review from a team as a code owner June 5, 2026 15:08
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 5, 2026

Deploy Preview for kongdeveloper ready!

Name Link
🔨 Latest commit e9f9e85
🔍 Latest deploy log https://app.netlify.com/projects/kongdeveloper/deploys/6a23245bd7c2440007774274
😎 Deploy Preview https://deploy-preview-5480--kongdeveloper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Dedicated Cloud Gateways reference documentation to include OpenTelemetry resource attributes as a supported configuration option for data plane nodes.

Changes:

  • Adds otel_resource_attributes to the kong_config_table env list in the DCGW reference configuration section.

Comment on lines 430 to 433
- name: trusted_ips
- name: otel_resource_attributes
{% endkong_config_table %}
<!--vale on -->
Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants