Skip to content

Comments

PM-9762: default otel config#38

Open
prodm8l wants to merge 2 commits intomainfrom
PM-9762
Open

PM-9762: default otel config#38
prodm8l wants to merge 2 commits intomainfrom
PM-9762

Conversation

@prodm8l
Copy link
Contributor

@prodm8l prodm8l commented Jan 18, 2026

Description

Optional description here

Checklists

Change type

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Development

  • Artifact version was updated in respective Chart.yaml according to the rules defined in Semantic Versioning rules
  • Security design review passed

Summary by CodeRabbit

Release Notes

  • New Features

    • OpenTelemetry integration added for tracing and metrics; disabled by default and configurable via chart values.
  • Chores

    • Kubernetes service chart version bumped to 1.1.1.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

Adds optional OpenTelemetry support to the Kubernetes Helm chart and bumps the chart version. A new otel.enabled values flag is added; the deployment template conditionally injects OTEL-related environment variables when enabled.

Changes

Cohort / File(s) Summary
Chart Version
charts/kubernetes-service/Chart.yaml
Chart version updated from 1.1.0 to 1.1.1.
Deployment template
charts/kubernetes-service/templates/deployment.yaml
Adds conditional .Values.otel.enabled block that injects OTEL environment variables (OTEL_LOGS_EXPORTER, OTEL_METRICS_EXPORTER, NODE_IP via Downward API, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_TRACES_SAMPLER).
Values
charts/kubernetes-service/values.yaml
Appends new top-level otel: block with enabled: false default. Minor formatting around sqsd.resources.requests.memory retained.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Kube as Kubernetes (Downward API)
    participant Pod as Application Pod
    participant App as App Container
    participant OTLP as OTLP Collector

    Note over Kube,Pod: Pod creation with env injection
    Kube->>Pod: Inject NODE_IP (status.hostIP) when otel.enabled
    Pod->>App: Start with OTEL_* env vars set
    App->>OTLP: Send OTLP data to http://$(NODE_IP):4318 (http/protobuf)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble at charts with a curious twitch,
A sprinkle of OTEL—quiet, not rich,
Env vars hop in, node IP in tow,
Tracing the burrows where observables grow. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description uses the template but is largely empty with only the placeholder 'Optional description here' and all checklists unchecked, despite actual substantive changes being made. Add a detailed description explaining the OpenTelemetry configuration changes, select the appropriate change type checkbox, and confirm the chart version update and security review status.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'PM-9762: default otel config' directly relates to the changeset, which adds OpenTelemetry configuration to the Helm chart.
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
  • Commit unit tests in branch PM-9762

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: 1

🤖 Fix all issues with AI agents
In `@charts/kubernetes-service/templates/deployment.yaml`:
- Around line 214-229: Change the hardcoded OTEL_TRACES_SAMPLER value to be
configurable via values.yaml: add .Values.otel.sampler (default
"parentbased_traceidratio") and .Values.otel.samplerRatio (default e.g. "0.1")
to values.yaml, then update the deployment template where OTEL_TRACES_SAMPLER is
set to use .Values.otel.sampler and also inject OTEL_TRACES_SAMPLER_ARG or
OTEL_TRACES_RATIO (as appropriate for your collector/runtime) using
.Values.otel.samplerRatio; ensure the template falls back to
"parentbased_traceidratio" and a safe ratio if the values are omitted and keep
the rest of the OTEL env block (NODE_IP, endpoints) unchanged.
🧹 Nitpick comments (2)
charts/kubernetes-service/values.yaml (1)

243-244: Consider exposing OTEL configuration parameters in values.

The deployment template hardcodes OTEL_EXPORTER_OTLP_ENDPOINT port (4318), OTEL_EXPORTER_OTLP_PROTOCOL (http/protobuf), and OTEL_TRACES_SAMPLER (always_on). Making these configurable via values.yaml would allow per-environment tuning (e.g., switching to parentbased_traceidratio sampler for production, or using gRPC on port 4317).

Suggested values structure
 otel:
   enabled: false
+  port: 4318
+  protocol: "http/protobuf"
+  sampler: "always_on"
charts/kubernetes-service/templates/deployment.yaml (1)

219-222: Nit: inline comment on fieldPath line.

The # Kubernetes downward API comment on line 222 is valid YAML but somewhat redundant — status.hostIP with fieldRef is a well-known pattern. Consider removing it to keep the template clean.

Comment on lines +214 to +229
{{- if .Values.otel.enabled }}
- name: OTEL_LOGS_EXPORTER
value: 'none'
- name: OTEL_METRICS_EXPORTER
value: 'none'
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP # Kubernetes downward API
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: 'http://$(NODE_IP):4318'
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: 'http/protobuf'
- name: OTEL_TRACES_SAMPLER
value: 'always_on'
{{- 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 | 🟡 Minor

OTEL env var injection looks correct; one operational concern with always_on sampler.

The $(NODE_IP) variable interpolation is correctly ordered (defined before use), and the conditional gating on .Values.otel.enabled is sound.

However, OTEL_TRACES_SAMPLER: always_on (line 228) sends 100% of traces, which can be costly at scale. Consider defaulting to parentbased_traceidratio with a configurable ratio for production environments — this ties into making the sampler configurable via values.yaml as suggested.

🤖 Prompt for AI Agents
In `@charts/kubernetes-service/templates/deployment.yaml` around lines 214 - 229,
Change the hardcoded OTEL_TRACES_SAMPLER value to be configurable via
values.yaml: add .Values.otel.sampler (default "parentbased_traceidratio") and
.Values.otel.samplerRatio (default e.g. "0.1") to values.yaml, then update the
deployment template where OTEL_TRACES_SAMPLER is set to use .Values.otel.sampler
and also inject OTEL_TRACES_SAMPLER_ARG or OTEL_TRACES_RATIO (as appropriate for
your collector/runtime) using .Values.otel.samplerRatio; ensure the template
falls back to "parentbased_traceidratio" and a safe ratio if the values are
omitted and keep the rest of the OTEL env block (NODE_IP, endpoints) unchanged.

- Add otel.enabled option for OTEL configuration
- Fix template syntax error (remove space in {{- if)
- Bump version to 1.1.1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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: 1

🤖 Fix all issues with AI agents
In `@charts/kubernetes-service/Chart.yaml`:
- Line 18: The Chart.yaml currently sets version: 1.1.1 but the change adds new
optional OpenTelemetry functionality and the commit references 1.2.0; update the
Chart.yaml version field from 1.1.1 to 1.2.0 to reflect a minor SemVer bump for
new backward-compatible features and ensure any other references or
docs/metadata that mention 1.1.1 are updated to 1.2.0 (look for the version key
in Chart.yaml and any packaging/release metadata).

# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.0
version: 1.1.1
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Version bump should be minor (1.2.0), not patch (1.1.1).

Adding optional OpenTelemetry support is new functionality. Per SemVer, new backward-compatible features warrant a minor version bump. Also, the commit message references 1.2.0 while the file has 1.1.1 — this inconsistency suggests the intended version was 1.2.0.

-version: 1.1.1
+version: 1.2.0
📝 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
version: 1.1.1
version: 1.2.0
🤖 Prompt for AI Agents
In `@charts/kubernetes-service/Chart.yaml` at line 18, The Chart.yaml currently
sets version: 1.1.1 but the change adds new optional OpenTelemetry functionality
and the commit references 1.2.0; update the Chart.yaml version field from 1.1.1
to 1.2.0 to reflect a minor SemVer bump for new backward-compatible features and
ensure any other references or docs/metadata that mention 1.1.1 are updated to
1.2.0 (look for the version key in Chart.yaml and any packaging/release
metadata).

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