feat(logs): updates opensearchexporter to use a logs_index_on_error flag for backup error records - #1977
Conversation
f38a47a to
985f846
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The current templates introduce invalid/unsafe logs_index_on_error values (quoted-string concatenation and an undefined ${index} placeholder) that can break rendered collector config at runtime.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the OpenSearch exporter configuration in the logs Helm charts to route failed export records into a dedicated “error” index via the new logs_index_on_error setting, and switches the OpenSearch exporter dependency to a fork that supports this behavior.
Changes:
- Add
logs_index_on_errorto multiple OpenSearch exporter configs (logs collector, ingester collector, external/syslog templates). - Set error index names to
*-datastream-errorvariants for failover exporters. - Update the OTel collector builder config to use
github.com/cloudoperators/.../opensearchexporter v0.152.6.
File summaries
| File | Description |
|---|---|
| logs/charts/templates/logs-collector.yaml | Adds logs_index_on_error for OpenSearch exporter failover pairs. |
| logs/charts/templates/ingester-collector.yaml | Adds logs_index_on_error for per-index failover exporters (needs YAML fix for quoting/concat). |
| logs/charts/templates/_syslog-audit-filter-config.tpl | Adds logs_index_on_error for syslog non-audit OpenSearch exporters. |
| logs/charts/templates/_external-config.tpl | Adds logs_index_on_error for external alerts/deployments OpenSearch exporters. |
| logs/charts/templates/_external-audit-exporter.tpl | Adds logs_index_on_error for audit OpenSearch exporters (current ${index} looks incorrect). |
| logs/build/otel-collector-builder-config.yaml | Switches OpenSearch exporter module path/version to cloudoperators fork. |
Review details
Suppressed comments (2)
logs/charts/templates/ingester-collector.yaml:154
- Same issue as above: quoting
$namebefore concatenation yields an invalid YAML scalar like"foo"-error. Compose the string then quote it.
logs_index: {{ $name | quote }}
logs_index_on_error: {{ $name | quote }}-error
sending_queue:
logs/charts/templates/_external-audit-exporter.tpl:86
logs_index_on_erroruses${index}but this template does not define anindexenv var anywhere (and no other templates use it), so this will likely resolve to an empty string or literal${index}at runtime. Sincelogs_indexis fixed toaudit-datastream, set the error index explicitly to match.
endpoint: {{ required "openTelemetry.externalCollector.syslogConfig.openSearchLogs.auditEndpoint is required when audit kafka is disabled" .Values.openTelemetry.externalCollector.syslogConfig.openSearchLogs.auditEndpoint }}
logs_index: audit-datastream
logs_index_on_error: ${index}-datastream-error
retry_on_failure:
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
985f846 to
30441aa
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The Helm template in ingester-collector.yaml uses invalid Go-template syntax and the audit exporter introduces a likely-incorrect/inconsistent error index name.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
logs/charts/templates/ingester-collector.yaml:153
$name-deadletteris not valid Helm/Go-template syntax and will render as an undefined variable or cause a template parse error; build the deadletter index name viaprintfinstead.
logs_index_on_error: {{ $name-deadletter | quote }}
logs/charts/templates/_external-audit-exporter.tpl:85
- The audit OpenSearch failover pair uses a different
logs_index_on_errorname for failover_b than failover_a and other exporters in this chart; using one consistent deadletter index simplifies operations and dashboards.
logs_index_on_error: audit-datastream-error
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Lite
749cdf2 to
289fb22
Compare
There was a problem hiding this comment.
🟡 Changes recommended
At least one OpenSearch log exporter configuration in the chart (e.g., OpenStack storage exporters) still lacks logs_index_on_error, so the “backup error records” behavior is not consistently applied.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Lite
7d0394c to
a40d0a8
Compare
…or backup error records --------- Signed-off-by: Simon Olander <simon.olander@sap.com>
a40d0a8 to
7928ccc
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The new logs_index_on_error configuration is applied consistently across exporter templates and is supported by the updated opensearchexporter dependency version.
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 0 new
- Review effort level: Lite
Signed-off-by: Simon Olander simon.olander@sap.com