Skip to content
Open
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: 1 addition & 1 deletion charts/kubernetes-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# 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).

18 changes: 17 additions & 1 deletion charts/kubernetes-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,22 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/version']
{{- 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 }}
Comment on lines +214 to +229
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.

- name: SERVER_SERVLET_CONTEXT_PATH
value: '/{{ .Values.service.path }}'
{{- if kindIs "map" .Values.env }}
Expand Down Expand Up @@ -274,4 +290,4 @@ spec:
persistentVolumeClaim:
claimName: {{ .Values.efs.claimName }}
{{- end }}
{{- end }}
{{- end }}
5 changes: 4 additions & 1 deletion charts/kubernetes-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,7 @@ sqsd:
memory: 128Mi
requests:
cpu: 125m
memory: 64Mi
memory: 64Mi

otel:
enabled: false