Skip to content

feat(logs): updates opensearchexporter to use a logs_index_on_error flag for backup error records - #1977

Merged
olandr merged 1 commit into
mainfrom
feat/custom-osexporter
Sep 10, 2026
Merged

feat(logs): updates opensearchexporter to use a logs_index_on_error flag for backup error records#1977
olandr merged 1 commit into
mainfrom
feat/custom-osexporter

Conversation

@olandr

@olandr olandr commented Sep 4, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Simon Olander simon.olander@sap.com

@olandr
olandr force-pushed the feat/custom-osexporter branch 2 times, most recently from f38a47a to 985f846 Compare September 8, 2026 09:25
@olandr olandr changed the title feat(logs,audit-logs): updates opensearchexporter to use a logs_index_on_error flag for backup error records feat(logs): updates opensearchexporter to use a logs_index_on_error flag for backup error records Sep 8, 2026
@olandr
olandr marked this pull request as ready for review September 8, 2026 09:26
@olandr
olandr requested a review from a team as a code owner September 8, 2026 09:26
Copilot AI lite review requested due to automatic review settings September 8, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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_error to multiple OpenSearch exporter configs (logs collector, ingester collector, external/syslog templates).
  • Set error index names to *-datastream-error variants 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 $name before 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_error uses ${index} but this template does not define an index env var anywhere (and no other templates use it), so this will likely resolve to an empty string or literal ${index} at runtime. Since logs_index is fixed to audit-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.

Comment thread logs/charts/templates/ingester-collector.yaml
Comment thread logs/charts/templates/_external-audit-exporter.tpl

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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-deadletter is not valid Helm/Go-template syntax and will render as an undefined variable or cause a template parse error; build the deadletter index name via printf instead.
        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_error name 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

Comment thread logs/charts/templates/ingester-collector.yaml Outdated
Comment thread logs/charts/templates/_external-audit-exporter.tpl Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment thread logs/charts/templates/logs-collector.yaml
@olandr
olandr force-pushed the feat/custom-osexporter branch 2 times, most recently from 7d0394c to a40d0a8 Compare September 10, 2026 15:28
@olandr
olandr requested a lite review from Copilot September 10, 2026 15:31
…or backup error records

---------

Signed-off-by: Simon Olander <simon.olander@sap.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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

@olandr
olandr merged commit 0de8c0f into main Sep 10, 2026
8 checks passed
@olandr
olandr deleted the feat/custom-osexporter branch September 10, 2026 16:40
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