Skip to content

Add support for OTLP OpenTelemetry and resource attributes#166

Open
schaer-bgs wants to merge 1 commit intowso2:mainfrom
schaer-bgs:bugfix/opentelemetry
Open

Add support for OTLP OpenTelemetry and resource attributes#166
schaer-bgs wants to merge 1 commit intowso2:mainfrom
schaer-bgs:bugfix/opentelemetry

Conversation

@schaer-bgs
Copy link

@schaer-bgs schaer-bgs commented Mar 11, 2026

Purpose

OpenTelemetry settings allow for host and port values but OTLP uses url. Additionally there is currently no way to set additional resource_attributes to override service.name or deployment.environment.

Goals

Allow users to use OTLP OpenTelemetry and send additional resource attributes.

Approach

  • Adds Helm Chart values wso2.apim.configurations.openTelemetry.url and wso2.apim.configurations.openTelemetry.resourceAttributes.
  • Adds an additional if statement in the Helm template to either set url or host/port.
  • Adds a for loop to generate the necessary [[apim.open_telemetry.resource_attributes]] entries.

Release note

Add support for OTLP OpenTelemetry url and resource_attributes

Documentation

Updated README.md with new Helm values.

Samples

openTelemetry:
  enabled: true
  name: "otlp"
  url: "http://opentelemetry-daemon-collector.svc.cluster.local:4317"
  resourceAttributes:
    - name: "service.name"
      value: "wso2am-universal-gw"
    - name: "deployment.environment"
      value: "test"

Summary by CodeRabbit

  • New Features

    • OpenTelemetry now supports specifying a remote tracer URL with automatic fallback to hostname/port.
    • Added support for configuring multiple OpenTelemetry resource attributes.
  • Documentation

    • Updated configuration documentation and values tables to include the new OpenTelemetry URL and resource attributes options.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Walkthrough

This PR adds two OpenTelemetry configuration options (url, resourceAttributes) to documentation and updates deployment templates to conditionally use a remote tracer URL (or hostname/port fallback) and to render multiple resource attribute entries across Helm templates.

Changes

Cohort / File(s) Summary
Documentation Updates
all-in-one/README.md, distributed/control-plane/README.md, distributed/gateway/README.md, distributed/traffic-manager/README.md
Added wso2.apim.configurations.openTelemetry.url (string, default "") and wso2.apim.configurations.openTelemetry.resourceAttributes (list, default []) to OpenTelemetry values tables.
All-in-One Deployment Templates
all-in-one/confs/instance-1/deployment.toml, all-in-one/confs/instance-2/deployment.toml
Added conditional rendering: set apim.open_telemetry.remote_tracer.url when openTelemetry.url is non-empty, otherwise set remote_tracer.hostname/remote_tracer.port. Added loop to append multiple [[apim.open_telemetry.resource_attributes]] entries.
Control-Plane Deployment Templates
distributed/control-plane/confs/instance-1/deployment.toml, distributed/control-plane/confs/instance-2/deployment.toml
Introduced conditional remote_tracer.url vs hostname/port logic and a range loop to render multiple apim.open_telemetry.resource_attributes entries from configuration.
Gateway Deployment Template
distributed/gateway/confs/deployment.toml
Implemented conditional remote_tracer.url rendering with hostname/port fallback and added iteration to generate multiple apim.open_telemetry.resource_attributes blocks. Also includes a guarded [secrets] section (unchanged behavior, rendered conditionally).
Traffic-Manager Deployment Templates
distributed/traffic-manager/confs/instance-1/deployment.toml, distributed/traffic-manager/confs/instance-2/deployment.toml
Added conditional URL-based remote tracer configuration with hostname/port fallback and implemented loop to render multiple resource attribute entries under apim.open_telemetry.resource_attributes.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through configs, tidy and spry,
Added a URL and attributes piled high,
If URL's set, traces stream far and neat,
Else hostname/port guide the heartbeat,
Resource attributes prance — a rabbit's small feat ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main changes: adding OTLP OpenTelemetry support and resource attributes configuration to the Helm charts.
Description check ✅ Passed The description covers Purpose, Goals, Approach, Release note, and Documentation sections. Missing sections include User stories, Training, Certification, Marketing, Automation tests, Security checks, Samples details, Related PRs, Migrations, Test environment, and Learning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@all-in-one/confs/instance-1/deployment.toml`:
- Around line 336-341: The Helm template uses the wrong `ne` call order causing
parse errors; update the if-condition to call `ne` with the value first (e.g.,
use `if ne .Values.wso2.apim.configurations.openTelemetry.url ""`) so the branch
that sets remote_tracer.url versus remote_tracer.hostname/remote_tracer.port
works correctly; locate the conditional around the symbols remote_tracer.url,
remote_tracer.hostname, remote_tracer.port and the template variable
.Values.wso2.apim.configurations.openTelemetry.url and change the `if` to use
`ne` as a function with its arguments in the correct order.
- Around line 344-348: Replace the incorrect Go template loop and move it inside
the enabled check: change the `for` loop over
`.Values.wso2.apim.configurations.openTelemetry.resourceAttributes` to a `range`
and ensure the whole `[[apim.open_telemetry.resource_attributes]]` block is
emitted only when `.Values.wso2.apim.configurations.openTelemetry.enabled` is
true so the `apim.open_telemetry` parent exists; also add the missing `url` and
`resourceAttributes` keys under `openTelemetry` in `all-in-one/values.yaml`
(e.g. `openTelemetry.url` and `openTelemetry.resourceAttributes: []`) so the
template has those fields to iterate over.

In `@all-in-one/confs/instance-2/deployment.toml`:
- Around line 336-348: The Helm template has invalid conditional and loop syntax
and the resource attribute block sits outside the openTelemetry feature guard;
change the if to use the ne function (e.g. {{- if ne
.Values.wso2.apim.configurations.openTelemetry.url "" }}) instead of infix
comparison, change the loop to use range (iterate
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes with {{- range
$i, $attr := ... }}), and move the [[apim.open_telemetry.resource_attributes]]
range block inside the outer openTelemetry-enabled guard so
apim.open_telemetry.resource_attributes and the remote_tracer.url/hostname/port
logic only render when openTelemetry is enabled.

In `@distributed/control-plane/confs/instance-1/deployment.toml`:
- Around line 282-294: Fix the Helm template logic: change the conditional to
use the prefix function form (if ne
.Values.wso2.apim.configurations.openTelemetry.url "") when checking
.Values.wso2.apim.configurations.openTelemetry.url; replace the "for" loop with
Helm's "range" for iterating
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes; move the
[[apim.open_telemetry.resource_attributes]] range block so it is nested inside
the openTelemetry.enabled conditional (the same block that renders
remote_tracer.url/hostname/port) to avoid orphaned TOML entries; and add url and
resourceAttributes keys to distributed/control-plane/values.yaml under
.Values.wso2.apim.configurations.openTelemetry so the template has those values
available.

In `@distributed/control-plane/confs/instance-2/deployment.toml`:
- Around line 282-294: The template has multiple Helm syntax and logic errors:
change the conditional to use the ne function (e.g., if ne
.Values.wso2.apim.configurations.openTelemetry.url "" ) when checking url,
replace the Golang "for" with Helm's "range" when iterating resourceAttributes,
and move the entire [[apim.open_telemetry.resource_attributes]] block (the range
over .Values.wso2.apim.configurations.openTelemetry.resourceAttributes that
creates name/value entries) inside the openTelemetry.enabled conditional so
resource attributes are only rendered when openTelemetry is enabled; update
references to remote_tracer.* and apim.open_telemetry.resource_attributes
accordingly.

In `@distributed/gateway/confs/deployment.toml`:
- Around line 265-277: Add the new OpenTelemetry defaults to the gateway values
so the template keys exist by default: update the distributed gateway chart's
values for openTelemetry (the openTelemetry map used by
wso2.apim.configurations.openTelemetry) to include url and resourceAttributes in
addition to enabled, name, hostname, and port; ensure openTelemetry.url is set
to an empty string and openTelemetry.resourceAttributes is an empty list so the
template branches using wso2.apim.configurations.openTelemetry.url and
wso2.apim.configurations.openTelemetry.resourceAttributes have sensible defaults
and the generated docs reflect the new options.
- Around line 265-277: The Helm template has invalid Go-template syntax and a
misplaced loop: change the if condition from "if
.Values.wso2.apim.configurations.openTelemetry.url ne \"\"" to use the ne
function as "if ne .Values.wso2.apim.configurations.openTelemetry.url \"\"" and
replace the "for $i, $attr :=" loop with "range $i, $attr :="; also ensure the
[[apim.open_telemetry.resource_attributes]] loop (references to
$attr.name/$attr.value and the resource_attributes block) is placed inside the
same openTelemetry enabled guard so resource_attributes are not emitted when
openTelemetry is disabled, and apply the same fixes for the other
deployment.toml files (distributed/control-plane, distributed/traffic-manager,
all-in-one) where the same symbols appear.

In `@distributed/traffic-manager/confs/instance-1/deployment.toml`:
- Around line 166-178: The Helm template has syntax and logic errors: change the
if test to prefix notation using ne for
.Values.wso2.apim.configurations.openTelemetry.url (e.g. {{- if ne
.Values.wso2.apim.configurations.openTelemetry.url "" }}), replace the template
"for" with "range" when iterating
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes, and move the
[[apim.open_telemetry.resource_attributes]] block (the resourceAttributes
iteration) inside the openTelemetry.enabled conditional so resource attribute
rendering only occurs when openTelemetry is enabled; also ensure the values.yaml
for distributed/traffic-manager includes the openTelemetry.url and
resourceAttributes fields referenced by remote_tracer and
apim.open_telemetry.resource_attributes.

In `@distributed/traffic-manager/confs/instance-2/deployment.toml`:
- Around line 164-176: The Helm template has syntax and logic issues: change the
if expression to use the Helm ne helper (e.g., if ne
.Values.wso2.apim.configurations.openTelemetry.url "" ) for the URL check,
replace the template `for` loop with Helm's `range` when iterating
`.Values.wso2.apim.configurations.openTelemetry.resourceAttributes`, and move
the entire resource attributes block (the
[[apim.open_telemetry.resource_attributes]] entries) and the
remote_tracer.url/hostname/port logic inside the `openTelemetry.enabled`
conditional so they only render when openTelemetry is enabled; update references
to remote_tracer.url, remote_tracer.hostname, remote_tracer.port, and the
resource attribute loop accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9a2d8267-b7bf-4c18-aeb6-e926b16c9f96

📥 Commits

Reviewing files that changed from the base of the PR and between 7a834d1 and 1e6e49b.

📒 Files selected for processing (11)
  • all-in-one/README.md
  • all-in-one/confs/instance-1/deployment.toml
  • all-in-one/confs/instance-2/deployment.toml
  • distributed/control-plane/README.md
  • distributed/control-plane/confs/instance-1/deployment.toml
  • distributed/control-plane/confs/instance-2/deployment.toml
  • distributed/gateway/README.md
  • distributed/gateway/confs/deployment.toml
  • distributed/traffic-manager/README.md
  • distributed/traffic-manager/confs/instance-1/deployment.toml
  • distributed/traffic-manager/confs/instance-2/deployment.toml

Comment on lines +344 to +348
{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Use range instead of for and move inside the enabled block.

Two issues here:

  1. Helm/Go templates use range, not for — this will cause a template parsing error.
  2. The resource attributes loop is outside the openTelemetry.enabled conditional, which could generate [[apim.open_telemetry.resource_attributes]] entries without a parent [apim.open_telemetry] section, producing invalid TOML.

Additionally, the url and resourceAttributes fields are not defined in all-in-one/values.yaml (see Context snippet 1). These must be added for the template to work correctly.

🐛 Proposed fix
 {{- if .Values.wso2.apim.configurations.openTelemetry.enabled }}
 [apim.open_telemetry]
 remote_tracer.enable = {{ .Values.wso2.apim.configurations.openTelemetry.enabled }}
 remote_tracer.name = {{ .Values.wso2.apim.configurations.openTelemetry.name | quote }}
 {{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ $attr.name | quote }}
 value = {{ $attr.value | quote }}
 {{- end }}
+{{- end }}

Also add the missing fields in all-in-one/values.yaml:

openTelemetry:
  enabled: false
  name: ""
  hostname: ""
  port: ""
  # -- Remote tracer URL. This should be used when name is OTLP
  url: ""
  # -- Open Telemetry resource attributes
  resourceAttributes: []
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@all-in-one/confs/instance-1/deployment.toml` around lines 344 - 348, Replace
the incorrect Go template loop and move it inside the enabled check: change the
`for` loop over
`.Values.wso2.apim.configurations.openTelemetry.resourceAttributes` to a `range`
and ensure the whole `[[apim.open_telemetry.resource_attributes]]` block is
emitted only when `.Values.wso2.apim.configurations.openTelemetry.enabled` is
true so the `apim.open_telemetry` parent exists; also add the missing `url` and
`resourceAttributes` keys under `openTelemetry` in `all-in-one/values.yaml`
(e.g. `openTelemetry.url` and `openTelemetry.resourceAttributes: []`) so the
template has those fields to iterate over.

Comment on lines +336 to +348
{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- end }}

{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's view the actual file content around lines 336-348
cd all-in-one/confs/instance-2 && wc -l deployment.toml

Repository: wso2/helm-apim

Length of output: 77


🏁 Script executed:

# View the specific section mentioned in the review
cd all-in-one/confs/instance-2 && sed -n '330,360p' deployment.toml

Repository: wso2/helm-apim

Length of output: 1642


🏁 Script executed:

# Search for similar OpenTelemetry patterns in the codebase to understand the context
rg -A 15 "open_telemetry" all-in-one/confs/ --type toml | head -100

Repository: wso2/helm-apim

Length of output: 5540


🌐 Web query:

Helm template syntax "if ne" vs "if" with comparison operators

💡 Result:

In Helm (Go text/template), if doesn’t take infix comparison operators like !=, ==, >, etc. Instead, comparisons are done with functions like eq, ne, lt, gt, le, ge (and boolean combinators and, or, not). Helm documents this explicitly: “operators … are all implemented as functions.” [1]

{{ if ... }} (no comparison)

if evaluates the truthiness of the pipeline result (e.g., false, 0, empty string, nil, empty list/map → falsey; otherwise truthy). So:

{{- if .Values.enabled -}}
...
{{- end -}}

{{ if ne ... }} (not-equal comparison)

Use ne when you want a not-equal test:

{{- if ne .Values.env "prod" -}}
...
{{- end -}}

Why ne instead of !=?

Because in Helm templates you write comparisons as function calls (ne a b), not as a != b. [1] (The Go template comparison functions are named eq, ne, lt, le, gt, ge and correspond to ==, !=, <, <=, >, >= in meaning.) [2]

Small extras that matter

  • eq can compare against multiple candidates: {{ if eq .Values.tier "gold" "platinum" }} [2]
  • You can combine conditions with and/or and parentheses: {{ if and (ne .A 0) (gt .B 5) }} [1]

Sources: Helm template guide [1], Go template comparison functions notes [2].

[1] (helm.sh)
[2] (tip.golang.org)

Citations:


🌐 Web query:

Helm Go template range vs for loop syntax

💡 Result:

In Helm charts you’re writing Go text/template, which has range for iteration—there is no for loop syntax in the template language. [1][2]

range (the “for-each” loop)

Iterate lists/slices/arrays/maps:

{{- range $i, $v := .Values.items }}
# $i = index/key, $v = value
{{- end }}

Notes:

  • range blocks must be closed with {{ end }}. [1][2]
  • Variable assignment order in templates is $index, $element (and for maps, $key, $value). [1]

“for i := 0; i < n; i++” (numeric loops)

Go templates don’t have a C-style for, so in Helm you typically generate a slice of integers (Sprig/Helm functions) and then range over it:

{{- range $i := until 5 }}
# $i is 0..4
{{- end }}

Helm’s until returns [0, 1, 2, 3, 4], and untilStep start stop step is the step-version. [3]

Sources: Go text/template docs for range/variables and Helm docs for until/untilStep. [1][3]


Fix Helm template syntax: invalid if condition and for loop; move attribute loop inside feature guard.

Lines contain two Helm template syntax errors. The comparison condition uses invalid infix syntax; it should be {{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}. The loop uses invalid for syntax; it should be range. Additionally, the resource_attributes loop runs outside the openTelemetry.enabled block and will render attributes even when the feature is disabled—it must move inside the outer guard.

Suggested fix
 [apim.open_telemetry]
 remote_tracer.enable = {{ .Values.wso2.apim.configurations.openTelemetry.enabled }}
 remote_tracer.name = {{ .Values.wso2.apim.configurations.openTelemetry.name | quote }}
-{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
+{{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ $attr.name | quote }}
 value = {{ $attr.value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@all-in-one/confs/instance-2/deployment.toml` around lines 336 - 348, The Helm
template has invalid conditional and loop syntax and the resource attribute
block sits outside the openTelemetry feature guard; change the if to use the ne
function (e.g. {{- if ne .Values.wso2.apim.configurations.openTelemetry.url ""
}}) instead of infix comparison, change the loop to use range (iterate
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes with {{- range
$i, $attr := ... }}), and move the [[apim.open_telemetry.resource_attributes]]
range block inside the outer openTelemetry-enabled guard so
apim.open_telemetry.resource_attributes and the remote_tracer.url/hostname/port
logic only render when openTelemetry is enabled.

Comment on lines +282 to +294
{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- end }}

{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Multiple Helm template syntax errors and logic issue.

This segment has the same issues as the all-in-one deployment template:

  1. Line 282: ne must be a prefix function: {{- if ne .Values...url "" }}
  2. Line 290: Use range instead of for
  3. Lines 290-294: The resource attributes loop should be inside the openTelemetry.enabled block to avoid generating orphaned TOML entries

The url and resourceAttributes fields must also be added to distributed/control-plane/values.yaml.

🐛 Proposed fix
 {{- if .Values.wso2.apim.configurations.openTelemetry.enabled }}
 [apim.open_telemetry]
 remote_tracer.enable = {{ .Values.wso2.apim.configurations.openTelemetry.enabled }}
 remote_tracer.name = {{ .Values.wso2.apim.configurations.openTelemetry.name | quote }}
-{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
+{{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ $attr.name | quote }}
 value = {{ $attr.value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/control-plane/confs/instance-1/deployment.toml` around lines 282
- 294, Fix the Helm template logic: change the conditional to use the prefix
function form (if ne .Values.wso2.apim.configurations.openTelemetry.url "") when
checking .Values.wso2.apim.configurations.openTelemetry.url; replace the "for"
loop with Helm's "range" for iterating
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes; move the
[[apim.open_telemetry.resource_attributes]] range block so it is nested inside
the openTelemetry.enabled conditional (the same block that renders
remote_tracer.url/hostname/port) to avoid orphaned TOML entries; and add url and
resourceAttributes keys to distributed/control-plane/values.yaml under
.Values.wso2.apim.configurations.openTelemetry so the template has those values
available.

Comment on lines +282 to +294
{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- end }}

{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Multiple Helm template syntax errors and logic issue.

Same issues as instance-1:

  1. Line 282: Use {{- if ne .Values...url "" }}
  2. Line 290: Use range instead of for
  3. Lines 290-294: Move inside the openTelemetry.enabled block
🐛 Proposed fix
-{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
+{{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ $attr.name | quote }}
 value = {{ $attr.value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/control-plane/confs/instance-2/deployment.toml` around lines 282
- 294, The template has multiple Helm syntax and logic errors: change the
conditional to use the ne function (e.g., if ne
.Values.wso2.apim.configurations.openTelemetry.url "" ) when checking url,
replace the Golang "for" with Helm's "range" when iterating resourceAttributes,
and move the entire [[apim.open_telemetry.resource_attributes]] block (the range
over .Values.wso2.apim.configurations.openTelemetry.resourceAttributes that
creates name/value entries) inside the openTelemetry.enabled conditional so
resource attributes are only rendered when openTelemetry is enabled; update
references to remote_tracer.* and apim.open_telemetry.resource_attributes
accordingly.

Comment on lines +265 to +277
{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- end }}

{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add the new gateway defaults to distributed/gateway/values.yaml too.

This template now reads wso2.apim.configurations.openTelemetry.url and wso2.apim.configurations.openTelemetry.resourceAttributes, but distributed/gateway/values.yaml:480-488 still only defines enabled, name, hostname, and port. That leaves the gateway chart’s default values and generated docs incomplete for the new feature.

# distributed/gateway/values.yaml
openTelemetry:
  enabled: false
  name: ""
  hostname: ""
  port: ""
  url: ""
  resourceAttributes: []
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/gateway/confs/deployment.toml` around lines 265 - 277, Add the
new OpenTelemetry defaults to the gateway values so the template keys exist by
default: update the distributed gateway chart's values for openTelemetry (the
openTelemetry map used by wso2.apim.configurations.openTelemetry) to include url
and resourceAttributes in addition to enabled, name, hostname, and port; ensure
openTelemetry.url is set to an empty string and openTelemetry.resourceAttributes
is an empty list so the template branches using
wso2.apim.configurations.openTelemetry.url and
wso2.apim.configurations.openTelemetry.resourceAttributes have sensible defaults
and the generated docs reflect the new options.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find the same invalid Helm-template patterns elsewhere in the repo.
rg -n -C2 '\{\{[- ]*for\b' --glob '**/*.toml'
rg -n -C2 '\{\{[- ]*if\s+\.[^}]*\s+ne\s+""\s*\}\}' --glob '**/*.toml'

Repository: wso2/helm-apim

Length of output: 7664


🏁 Script executed:

# Verify the exact guard structure and context around the flagged lines
cat -n distributed/gateway/confs/deployment.toml | sed -n '258,280p'

Repository: wso2/helm-apim

Length of output: 1346


🌐 Web query:

Helm Go-template if ne operator syntax comparison

💡 Result:

In Helm (Go text/template), ne is a function (“not equal”), not an infix operator.

Basic not-equal check

{{- if ne .Values.env "prod" -}}
# ...
{{- end -}}

ne takes two arguments: ne <left> <right>. (helm.sh)

Combine comparisons (use parentheses because it’s function-call style)

{{- if and (ne .Values.a "x") (ne .Values.b "y") -}}
# ...
{{- end -}}

This works because and is also a template function that takes boolean expressions as arguments. (helm.sh)

Alternative form

{{- if not (eq .Values.env "prod") -}}
# ...
{{- end -}}

not negates the result of eq. (helm.sh)

Citations:


🌐 Web query:

Helm Go-template range loop syntax vs for loop

💡 Result:

Helm templates use Go’s text/template, which does not have a for loop statement. The looping construct is range (“for-each”). (helm.sh)

range (for-each) syntax in Helm/Go templates

Loop over a list (slice/array)

{{- range .Values.items }}
  name: {{ . }}
{{- end }}

Inside the loop, . becomes the current element. (pkg.go.dev)

Capture index + element

{{- range $i, $v := .Values.items }}
  {{ $i }} => {{ $v }}
{{- end }}

Note: in Go templates, when you declare two variables, the first is index/key and the second is element/value; with one variable, it gets the element (not the index). (pkg.go.dev)

Loop over a map (key/value)

{{- range $k, $v := .Values.labels }}
  {{ $k }}: {{ $v | quote }}
{{- end }}

(Go maps iterate in undefined order.) (pkg.go.dev)

range ... else for empty collections

{{- range .Values.items }}
  - {{ . }}
{{- else }}
  # no items
{{- end }}

(pkg.go.dev)

“For loop” (numeric counting) pattern in Helm

Helm typically does “counting loops” by generating a list of integers (via Sprig) and ranging over it:

{{- range $i, $_ := until 5 }}
  i={{ $i }}
{{- end }}

Or step sizes:

{{- range $i, $_ := untilStep 0 10 2 }}
  i={{ $i }}
{{- end }}

(blog.helm.sh)

Citations:


Fix invalid Helm/Go-template syntax in OpenTelemetry configuration blocks.

The control flow syntax is incorrect and prevents template rendering:

  • if .Values...url ne "" must be if ne .Values.url "" (ne is a function, not an operator)
  • for $i, $attr := must be range $i, $attr := (Go templates use range, not for)
  • The resource_attributes loop (line 273) is outside the openTelemetry.enabled guard, allowing partial configuration when telemetry is disabled

This pattern appears in all deployment.toml files (distributed/gateway, distributed/control-plane, distributed/traffic-manager, and all-in-one charts).

Suggested fix
 [apim.open_telemetry]
 remote_tracer.enable = {{ .Values.wso2.apim.configurations.openTelemetry.enabled }}
 remote_tracer.name = {{ .Values.wso2.apim.configurations.openTelemetry.name | quote }}
-{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
+{{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ $attr.name | quote }}
 value = {{ $attr.value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/gateway/confs/deployment.toml` around lines 265 - 277, The Helm
template has invalid Go-template syntax and a misplaced loop: change the if
condition from "if .Values.wso2.apim.configurations.openTelemetry.url ne \"\""
to use the ne function as "if ne
.Values.wso2.apim.configurations.openTelemetry.url \"\"" and replace the "for
$i, $attr :=" loop with "range $i, $attr :="; also ensure the
[[apim.open_telemetry.resource_attributes]] loop (references to
$attr.name/$attr.value and the resource_attributes block) is placed inside the
same openTelemetry enabled guard so resource_attributes are not emitted when
openTelemetry is disabled, and apply the same fixes for the other
deployment.toml files (distributed/control-plane, distributed/traffic-manager,
all-in-one) where the same symbols appear.

Comment on lines +166 to +178
{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- end }}

{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Multiple Helm template syntax errors and logic issue.

Same issues as other deployment templates:

  1. Line 166: Use {{- if ne .Values...url "" }} (prefix notation)
  2. Line 174: Use range instead of for
  3. Lines 174-178: Move inside the openTelemetry.enabled block

Update distributed/traffic-manager/values.yaml with the missing url and resourceAttributes fields.

🐛 Proposed fix
 {{- if .Values.wso2.apim.configurations.openTelemetry.enabled }}
 [apim.open_telemetry]
 remote_tracer.enable = {{ .Values.wso2.apim.configurations.openTelemetry.enabled }}
 remote_tracer.name = {{ .Values.wso2.apim.configurations.openTelemetry.name | quote }}
-{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
+{{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ $attr.name | quote }}
 value = {{ $attr.value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/traffic-manager/confs/instance-1/deployment.toml` around lines
166 - 178, The Helm template has syntax and logic errors: change the if test to
prefix notation using ne for .Values.wso2.apim.configurations.openTelemetry.url
(e.g. {{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}),
replace the template "for" with "range" when iterating
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes, and move the
[[apim.open_telemetry.resource_attributes]] block (the resourceAttributes
iteration) inside the openTelemetry.enabled conditional so resource attribute
rendering only occurs when openTelemetry is enabled; also ensure the values.yaml
for distributed/traffic-manager includes the openTelemetry.url and
resourceAttributes fields referenced by remote_tracer and
apim.open_telemetry.resource_attributes.

Comment on lines +164 to +176
{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- end }}

{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Multiple Helm template syntax errors and logic issue.

Same issues as instance-1:

  1. Line 164: Use {{- if ne .Values...url "" }}
  2. Line 172: Use range instead of for
  3. Lines 172-176: Move inside the openTelemetry.enabled block
🐛 Proposed fix
-{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
+{{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ $attr.name | quote }}
 value = {{ $attr.value | quote }}
 {{- end }}
+{{- end }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{- if .Values.wso2.apim.configurations.openTelemetry.url ne "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- end }}
{{- for $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
{{- if ne .Values.wso2.apim.configurations.openTelemetry.url "" }}
remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
{{- else }}
remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
{{- end }}
{{- range $i, $attr := .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
[[apim.open_telemetry.resource_attributes]]
name = {{ $attr.name | quote }}
value = {{ $attr.value | quote }}
{{- end }}
{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/traffic-manager/confs/instance-2/deployment.toml` around lines
164 - 176, The Helm template has syntax and logic issues: change the if
expression to use the Helm ne helper (e.g., if ne
.Values.wso2.apim.configurations.openTelemetry.url "" ) for the URL check,
replace the template `for` loop with Helm's `range` when iterating
`.Values.wso2.apim.configurations.openTelemetry.resourceAttributes`, and move
the entire resource attributes block (the
[[apim.open_telemetry.resource_attributes]] entries) and the
remote_tracer.url/hostname/port logic inside the `openTelemetry.enabled`
conditional so they only render when openTelemetry is enabled; update references
to remote_tracer.url, remote_tracer.hostname, remote_tracer.port, and the
resource attribute loop accordingly.

@schaer-bgs schaer-bgs force-pushed the bugfix/opentelemetry branch from 1e6e49b to 7a6a943 Compare March 11, 2026 12:26
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (3)
distributed/traffic-manager/confs/instance-1/deployment.toml (1)

172-178: ⚠️ Potential issue | 🟠 Major

Resource attributes loop is still outside the openTelemetry.enabled guard.

Same issue as other deployment templates: the {{- end }} on line 172 closes the enabled block, but the resourceAttributes loop executes unconditionally. This produces orphaned TOML entries when OpenTelemetry is disabled.

🐛 Proposed fix
 {{- if ne (.Values.wso2.apim.configurations.openTelemetry.url) "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- range .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ .name | quote }}
 value = {{ .value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/traffic-manager/confs/instance-1/deployment.toml` around lines
172 - 178, The TOML resource_attributes loop
(.Values.wso2.apim.configurations.openTelemetry.resourceAttributes) is being
rendered even when openTelemetry.enabled is false because the {{- end }} closed
the openTelemetry.enabled guard too early; move the resourceAttributes range
block inside the openTelemetry.enabled conditional (i.e., ensure the {{ if
.Values.wso2.apim.configurations.openTelemetry.enabled }} .. {{ end }} surrounds
the [[apim.open_telemetry.resource_attributes]] range) so the loop only emits
when openTelemetry is enabled.
distributed/control-plane/confs/instance-1/deployment.toml (1)

288-294: ⚠️ Potential issue | 🟠 Major

Resource attributes loop is still outside the openTelemetry.enabled guard.

The {{- end }} on line 288 closes the openTelemetry.enabled block, but the resourceAttributes loop (lines 290-294) executes unconditionally. When openTelemetry.enabled=false but resourceAttributes is non-empty, this generates orphaned [[apim.open_telemetry.resource_attributes]] TOML entries without the parent [apim.open_telemetry] section.

Move the loop inside the enabled block by swapping lines 288 and 294.

🐛 Proposed fix
 {{- if ne (.Values.wso2.apim.configurations.openTelemetry.url) "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- range .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ .name | quote }}
 value = {{ .value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@distributed/control-plane/confs/instance-1/deployment.toml` around lines 288
- 294, The resourceAttributes range is rendered outside the openTelemetry guard
causing orphaned [[apim.open_telemetry.resource_attributes]] entries when
openTelemetry.enabled is false; move the resourceAttributes loop inside the
openTelemetry block by swapping the closing {{- end }} for the
openTelemetry.enabled block with the range block so that the {{- range
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes }} ...
[[apim.open_telemetry.resource_attributes]] ... {{- end }} executes only when
openTelemetry.enabled is true (reference openTelemetry.enabled,
resourceAttributes, and apim.open_telemetry.resource_attributes).
all-in-one/confs/instance-2/deployment.toml (1)

342-348: ⚠️ Potential issue | 🟠 Major

Resource attributes loop is still outside the openTelemetry.enabled guard.

Same issue as other deployment templates: line 342's {{- end }} closes the enabled block, leaving the resourceAttributes loop to execute unconditionally. This produces orphaned [[apim.open_telemetry.resource_attributes]] entries when OpenTelemetry is disabled.

🐛 Proposed fix
 {{- if ne (.Values.wso2.apim.configurations.openTelemetry.url) "" }}
 remote_tracer.url = {{ .Values.wso2.apim.configurations.openTelemetry.url | quote }}
 {{- else }}
 remote_tracer.hostname = {{ .Values.wso2.apim.configurations.openTelemetry.hostname | quote }}
 remote_tracer.port = {{ .Values.wso2.apim.configurations.openTelemetry.port | quote }}
 {{- end }}
-{{- end }}
-
-{{- range .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
+{{- range .Values.wso2.apim.configurations.openTelemetry.resourceAttributes }}
 [[apim.open_telemetry.resource_attributes]]
 name = {{ .name | quote }}
 value = {{ .value | quote }}
 {{- end }}
+{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@all-in-one/confs/instance-2/deployment.toml` around lines 342 - 348, The
resourceAttributes loop for [[apim.open_telemetry.resource_attributes]] is
placed after the closing of the openTelemetry.enabled guard so it runs even when
OpenTelemetry is disabled; move the {{- range
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes }} ... {{- end
}} block so it is nested inside the openTelemetry enabled conditional (i.e.,
before the {{- end }} that closes the openTelemetry.enabled if) so the
apim.open_telemetry.resource_attributes entries are only rendered when
openTelemetry.enabled is true.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@all-in-one/confs/instance-2/deployment.toml`:
- Around line 342-348: The resourceAttributes loop for
[[apim.open_telemetry.resource_attributes]] is placed after the closing of the
openTelemetry.enabled guard so it runs even when OpenTelemetry is disabled; move
the {{- range .Values.wso2.apim.configurations.openTelemetry.resourceAttributes
}} ... {{- end }} block so it is nested inside the openTelemetry enabled
conditional (i.e., before the {{- end }} that closes the openTelemetry.enabled
if) so the apim.open_telemetry.resource_attributes entries are only rendered
when openTelemetry.enabled is true.

In `@distributed/control-plane/confs/instance-1/deployment.toml`:
- Around line 288-294: The resourceAttributes range is rendered outside the
openTelemetry guard causing orphaned [[apim.open_telemetry.resource_attributes]]
entries when openTelemetry.enabled is false; move the resourceAttributes loop
inside the openTelemetry block by swapping the closing {{- end }} for the
openTelemetry.enabled block with the range block so that the {{- range
.Values.wso2.apim.configurations.openTelemetry.resourceAttributes }} ...
[[apim.open_telemetry.resource_attributes]] ... {{- end }} executes only when
openTelemetry.enabled is true (reference openTelemetry.enabled,
resourceAttributes, and apim.open_telemetry.resource_attributes).

In `@distributed/traffic-manager/confs/instance-1/deployment.toml`:
- Around line 172-178: The TOML resource_attributes loop
(.Values.wso2.apim.configurations.openTelemetry.resourceAttributes) is being
rendered even when openTelemetry.enabled is false because the {{- end }} closed
the openTelemetry.enabled guard too early; move the resourceAttributes range
block inside the openTelemetry.enabled conditional (i.e., ensure the {{ if
.Values.wso2.apim.configurations.openTelemetry.enabled }} .. {{ end }} surrounds
the [[apim.open_telemetry.resource_attributes]] range) so the loop only emits
when openTelemetry is enabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aab268b1-9407-4def-8b58-e8469c13dc81

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6e49b and 7a6a943.

📒 Files selected for processing (11)
  • all-in-one/README.md
  • all-in-one/confs/instance-1/deployment.toml
  • all-in-one/confs/instance-2/deployment.toml
  • distributed/control-plane/README.md
  • distributed/control-plane/confs/instance-1/deployment.toml
  • distributed/control-plane/confs/instance-2/deployment.toml
  • distributed/gateway/README.md
  • distributed/gateway/confs/deployment.toml
  • distributed/traffic-manager/README.md
  • distributed/traffic-manager/confs/instance-1/deployment.toml
  • distributed/traffic-manager/confs/instance-2/deployment.toml
🚧 Files skipped from review as they are similar to previous changes (8)
  • distributed/gateway/README.md
  • distributed/control-plane/confs/instance-2/deployment.toml
  • distributed/control-plane/README.md
  • distributed/traffic-manager/README.md
  • distributed/traffic-manager/confs/instance-2/deployment.toml
  • distributed/gateway/confs/deployment.toml
  • all-in-one/README.md
  • all-in-one/confs/instance-1/deployment.toml

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.

3 participants