Skip to content

fix: use glob syntax instead of regex in Beyla discovery config#2485

Merged
petewall merged 4 commits intomainfrom
petewall/fix-beyla-glob-syntax
Apr 14, 2026
Merged

fix: use glob syntax instead of regex in Beyla discovery config#2485
petewall merged 4 commits intomainfrom
petewall/fix-beyla-glob-syntax

Conversation

@petewall
Copy link
Copy Markdown
Collaborator

Beyla interprets discovery fields as glob patterns, not regex. The default
config used "." (regex any-char) instead of "*" (glob wildcard) for
k8s_namespace, and regex alternation "|" instead of glob brace alternation
for exe_path exclusions. This caused Beyla to discover zero services and
silently skip exclusions.

Fixes #2484

petewall and others added 2 commits April 13, 2026 17:14
Beyla interprets discovery fields as glob patterns, not regex. The default
config used "." (regex any-char) instead of "*" (glob wildcard) for
k8s_namespace, and regex alternation "|" instead of glob brace alternation
for exe_path exclusions. This caused Beyla to discover zero services and
silently skip exclusions.

Fixes #2484

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@petewall petewall self-assigned this Apr 13, 2026
@petewall petewall requested a review from rlankfo as a code owner April 13, 2026 22:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

TruffleHog Scan Results

Summary: Found 7 potential secrets (0 verified, 7 unverified)

  • Possible secret (GoogleGeminiAPIKey) at charts/k8s-monitoring/docs/examples/images/images-by-digest/output.yaml:2740AIza***QX4U
  • Possible secret (GoogleGeminiAPIKey) at charts/k8s-monitoring/docs/examples/private-image-registries/individual/output.yaml:2755AIza***QX4U
  • Possible secret (GoogleGeminiAPIKey) at charts/k8s-monitoring/docs/examples/resource-requests-and-limits/output.yaml:2482AIza***QX4U
  • Possible secret (GoogleGeminiAPIKey) at charts/k8s-monitoring/docs/examples/tolerations/output.yaml:2679AIza***QX4U
  • Possible secret (GoogleGeminiAPIKey) at charts/k8s-monitoring/docs/examples/tolerations/output.yaml:2679AIza***QX4U
  • Possible secret (GoogleGeminiAPIKey) at charts/k8s-monitoring/tests/platform/grafana-cloud/k8s-monitoring/.rendered/output.yaml:3601AIza***QX4U
  • Possible secret (GoogleGeminiAPIKey) at charts/k8s-monitoring/tests/platform/grafana-cloud/k8s-monitoring/.rendered/output.yaml:3601AIza***QX4U

Review: Check if unverified secrets are false positives.


Ignoring False Positives:
To mark a false positive, add # trufflehog:ignore as an inline comment on the same line as the detected secret:

my_fake_secret = "AKIAIOSFODNN7EXAMPLE"  # trufflehog:ignore

This works for files that support line numbers (most source files). After adding the comment, push your changes and the scan will re-run.

Signed-off-by: Pete Wall <pete.wall@grafana.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Beyla discovery defaults in the Helm chart by using glob syntax (as Beyla expects) instead of regex syntax, restoring service discovery and exclusion behavior.

Changes:

  • Update default k8s_namespace match-all from . (regex) to * (glob) in generated Beyla config.
  • Update default exe_path exclusion from regex alternation to glob brace alternation.
  • Regenerate affected rendered outputs / snapshots and update the exclude-by-namespace example to use the corrected glob.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
charts/k8s-monitoring/charts/feature-auto-instrumentation/templates/_beyla-config.tpl Fixes the default Beyla discovery config to use glob patterns (*, {...}) instead of regex syntax.
charts/k8s-monitoring/tests/feature_beyla_config_test.yaml Updates test expectations to match corrected rendered discovery defaults.
charts/k8s-monitoring/tests/platform/openshift/.rendered/output.yaml Updates rendered snapshot with corrected glob patterns and checksum.
charts/k8s-monitoring/tests/platform/grafana-cloud/k8s-monitoring/.rendered/output.yaml Updates rendered snapshot with corrected glob patterns and checksum.
charts/k8s-monitoring/docs/examples/tolerations/output.yaml Updates example rendered output to reflect corrected discovery defaults.
charts/k8s-monitoring/docs/examples/resource-requests-and-limits/output.yaml Updates example rendered output to reflect corrected discovery defaults.
charts/k8s-monitoring/docs/examples/private-image-registries/individual/output.yaml Updates example rendered output to reflect corrected discovery defaults.
charts/k8s-monitoring/docs/examples/images/images-by-digest/output.yaml Updates example rendered output to reflect corrected discovery defaults.
charts/k8s-monitoring/docs/examples/features/auto-instrumentation/span-metrics-only/output.yaml Updates example rendered output to reflect corrected discovery defaults.
charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics/output.yaml Updates example rendered output to reflect corrected discovery defaults.
charts/k8s-monitoring/docs/examples/exclude-by-namespace/values.yaml Fixes the example values to use k8s_namespace: "*" (glob match-all).
charts/k8s-monitoring/docs/examples/exclude-by-namespace/README.md Fixes the example documentation to use k8s_namespace: "*" (glob match-all).
charts/k8s-monitoring/docs/examples/exclude-by-namespace/output.yaml Updates example rendered output to reflect the corrected glob pattern and checksum.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@mariomac mariomac left a comment

Choose a reason for hiding this comment

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

Correct to me! just a couple of corrections in docs/examples/exclude-by-namespace

Comment thread charts/k8s-monitoring/docs/examples/exclude-by-namespace/README.md Outdated
Comment thread charts/k8s-monitoring/docs/examples/exclude-by-namespace/values.yaml Outdated
Signed-off-by: Pete Wall <pete.wall@grafana.com>
@petewall
Copy link
Copy Markdown
Collaborator Author

@mariomac , updated services to instrument.

@petewall petewall merged commit 24d3f1a into main Apr 14, 2026
75 checks passed
@petewall petewall deleted the petewall/fix-beyla-glob-syntax branch April 14, 2026 16:38
petewall added a commit that referenced this pull request Apr 14, 2026
* fix: use glob syntax instead of regex in Beyla discovery config

Beyla interprets discovery fields as glob patterns, not regex. The default
config used "." (regex any-char) instead of "*" (glob wildcard) for
k8s_namespace, and regex alternation "|" instead of glob brace alternation
for exe_path exclusions. This caused Beyla to discover zero services and
silently skip exclusions.

Fixes #2484

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: regenerate all rendered outputs with corrected Beyla glob patterns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix unit test snapshot

Signed-off-by: Pete Wall <pete.wall@grafana.com>

* change services to instrument

Signed-off-by: Pete Wall <pete.wall@grafana.com>

---------

Signed-off-by: Pete Wall <pete.wall@grafana.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

K8s Helm chart issue - Beyla discovery config uses regex syntax in glob fields

3 participants