Skip to content

[chart/opentelemetry-ebpf-instrumentation] only configure prometheus_export when a Service can scrape it - #2360

Open
NimrodAvni78 wants to merge 2 commits into
open-telemetry:mainfrom
coralogix:obi-prom-export-unscraped
Open

[chart/opentelemetry-ebpf-instrumentation] only configure prometheus_export when a Service can scrape it#2360
NimrodAvni78 wants to merge 2 commits into
open-telemetry:mainfrom
coralogix:obi-prom-export-unscraped

Conversation

@NimrodAvni78

@NimrodAvni78 NimrodAvni78 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

OBI defaulted to enable prometheus exporter.
But the prometheus exporter expires Prometheus metric children only while serving a scrape.
So without anyone scrapping it (no service) then metrics were not evicted and memory consumption grows without eviction

This fixes to only enable prometheus export when service is explicitly turned on

Link to tracking issue

Authorship

  • I, a human, wrote this pull request description myself.

@NimrodAvni78
NimrodAvni78 requested a review from a team as a code owner August 18, 2026 16:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25f7a65e1a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +162 to +163
{{- if not (include "obi.prometheusExportEnabled" .) }}
{{- $_ := unset $config "prometheus_export" }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve exporters used by direct pod scraping

When service.enabled is false—as it is by default—but Prometheus uses pod discovery, podAnnotations, or a separately managed Service to scrape the DaemonSet, this unconditionally deletes the configured prometheus_export stanza. The endpoint therefore stops listening after this patch upgrade and these valid scrape setups lose all application metrics; preserve explicitly configured exporters or provide a separate opt-out instead of treating the chart-managed Service as the only possible scraping path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this setting can also be enabled via config without this preset which requires a service

@grcevski grcevski left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! Nice!

…export when a Service can scrape it

Signed-off-by: NimrodAvni78 <nimrod@coralogix.com>
@NimrodAvni78
NimrodAvni78 force-pushed the obi-prom-export-unscraped branch from 25f7a65 to 5f47eb6 Compare August 20, 2026 08:04
Comment on lines 143 to 145
{{/*
Generate the configmap data based on preset and configuration values
*/}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
{{/*
Generate the configmap data based on preset and configuration values
*/}}

true
{{- end -}}
{{- end }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
{{/*
Generate the configmap data based on preset and configuration values
*/}}


{{- define "obi.configData" -}}
{{- $config := deepCopy .Values.config.data }}
{{- if not (include "obi.prometheusExportEnabled" .) }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need an additional template here? Can we simplify with

{{- if not .Values.service.enabled }}

instead?

- ALL
{{- end }}
{{- $promExport := dict }}
{{- if include "obi.prometheusExportEnabled" . }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here

@marcschaeferger

Copy link
Copy Markdown
Contributor

@NimrodAvni78 Pls rebase + see Review

@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Sep 10, 2026
@marcschaeferger marcschaeferger added bug Something isn't working chart:ebpf-instrumentation Issues related to ebpf-instrumentation helm chart waiting-for-author needs-rebase labels Sep 10, 2026
@marcschaeferger

Copy link
Copy Markdown
Contributor

@NimrodAvni78 Can you please address the review and rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chart:ebpf-instrumentation Issues related to ebpf-instrumentation helm chart needs-rebase Stale waiting-for-author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants