Skip to content

Add Beholder default metric filter views#2238

Draft
pkcll wants to merge 3 commits into
beholder-otel-limit-metric-cardinalityfrom
beholder-otel-metric-filter-views
Draft

Add Beholder default metric filter views#2238
pkcll wants to merge 3 commits into
beholder-otel-limit-metric-cardinalityfrom
beholder-otel-metric-filter-views

Conversation

@pkcll

@pkcll pkcll commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add pkg/beholder/metricviews with deny-only DefaultViews(blacklist) — empty blacklist by default (no attributes stripped until configured).
  • Add MetricViewsAttributeBlacklist on beholder.Config, wired via CL_TELEMETRY_METRIC_VIEWS_ATTRIBUTE_BLACKLIST (comma-separated) through loop EnvConfig and server.go.
  • Refactor meter provider helpers to Config.metricViews() and zero-arg Config.metricOptions(); caller views precede defaults so histogram-bucket overrides are not shadowed.
  • Wire CL_TELEMETRY_METRIC_VIEWS_DISABLED as an emergency disable flag.

Stacks on #2225 (cardinality limit). Merge limit PR first, then rebase this onto main.

Test plan

  • go test ./pkg/beholder/... ./pkg/loop

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (7)

package github (1)
  • com/smartcontractkit/chainlink-common/pkg/beholder/metricviews — ➕ Added
pkg/beholder.Config (2)
  • MetricViewsAttributeBlacklist — ➕ Added

  • MetricViewsDisabled — ➕ Added

pkg/beholder.writerClientConfig (2)
  • MetricViewsAttributeBlacklist — ➕ Added

  • MetricViewsDisabled — ➕ Added

pkg/loop.EnvConfig (2)
  • TelemetryMetricViewsAttributeBlacklist — ➕ Added

  • TelemetryMetricViewsDisabled — ➕ Added


📄 View full apidiff report

@pkcll pkcll force-pushed the beholder-otel-limit-metric-cardinality branch from 9eaf479 to a7dbabb Compare July 10, 2026 23:14
@pkcll pkcll force-pushed the beholder-otel-metric-filter-views branch from b3a19ee to ee3c5d6 Compare July 10, 2026 23:15
Introduce metricviews.DefaultViews() with an empty denylist by default,
Config.metricViews/metricOptions methods, and CL_TELEMETRY_METRIC_VIEWS_DISABLED
wiring through loop env and server. Caller views precede defaults so
histogram-bucket overrides are not shadowed.

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	pkg/beholder/meter_provider.go
@pkcll pkcll force-pushed the beholder-otel-metric-filter-views branch from ee3c5d6 to ed2bce5 Compare July 11, 2026 00:00
pkcll added 2 commits July 11, 2026 16:18
Expose MetricViewsAttributeBlacklist on beholder.Config and wire
CL_TELEMETRY_METRIC_VIEWS_ATTRIBUTE_BLACKLIST through loop env and server.
DefaultViews builds a global deny view when keys are configured.
Wire MetricViewsAttributeBlacklist through beholder.Config and
CL_TELEMETRY_METRIC_VIEWS_ATTRIBUTE_BLACKLIST via loop env/server.
DefaultViews(blacklist) registers a global deny view when non-empty;
empty by default so no attributes are stripped until configured.
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.

1 participant