Skip to content

update monitoring config struct#1227

Merged
bukata-sa merged 4 commits into
mainfrom
fix/monitoring-config-struct
Jul 3, 2026
Merged

update monitoring config struct#1227
bukata-sa merged 4 commits into
mainfrom
fix/monitoring-config-struct

Conversation

@bukata-sa

@bukata-sa bukata-sa commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Refactor monitoring.Config struct: replace Enabled/Type fields with typed sub-configs (Beholder.Enabled, Pyroscope.Enabled, PyroscopeConfig.URL), add top-level LogLevel.
  • Add SetupPyroscope helper in common/monitoring/setup.go; SetupBeholder now takes BeholderConfig directly.
  • Wire pyroscope setup and teardown into Bootstrapper (NewBootstrapper/Stop).
  • Update all call sites to new struct shape: setup.go, cmd/verifier/common.go, cmd/executor/common.go, aggregator/cmd/main.go, aggregator/pkg/server.go, indexer/cmd/main.go,
    indexer/pkg/config/config.go.
  • Update devenv TOML configs and environment wiring to new struct shape; remove standalone pyroscope_url top-level fields.
  • Remove GenerateTemplateConfig from token verifier devenv service (no longer needed to extract pyroscope URL).
  • Add LogLevel and LogStreamingLevel validation in Config.Validate and BeholderConfig.Validate.

Testing

just rebuild-all
ccv obs up
check logs and metrics (ccip_service_started)

Checklist

  • Breaking changes documented in changelog (see changelog directory)
  • Cross link related PRs (in this or other repositories)
  • just lint fix - no new lint errors
  • just generate - mocks and protobufs are up to date

@bukata-sa bukata-sa marked this pull request as ready for review July 2, 2026 22:03
@bukata-sa bukata-sa requested review from a team as code owners July 2, 2026 22:03
Copilot AI review requested due to automatic review settings July 2, 2026 22:03

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.

Pull request overview

This PR refactors the CCV monitoring configuration to remove the old Enabled/Type switch and replace it with typed sub-configs (Monitoring.Beholder, Monitoring.Pyroscope) plus a top-level Monitoring.LogLevel. It also centralizes Pyroscope lifecycle management in the bootstrapper and updates service wiring + devenv TOML templates accordingly.

Changes:

  • Refactor common/monitoring.Config and validation to support Beholder.Enabled, Pyroscope.Enabled/URL, and LogLevel.
  • Add SetupPyroscope helper and wire Pyroscope setup/teardown into Bootstrapper startup/shutdown.
  • Update call sites, tests, and devenv TOML configs/templates to match the new monitoring config shape.

Reviewed changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
indexer/pkg/config/config.go Switch indexer config validation to delegate to Monitoring.Validate().
indexer/config.example.toml Update example TOML to new Monitoring.{LogLevel,Pyroscope,Beholder} layout.
indexer/cmd/oapigen/go.sum Add Pyroscope module checksums for codegen module.
indexer/cmd/main.go Gate beholder monitoring initialization on Monitoring.Beholder.Enabled.
executor/config_test.go Adjust config validation test inputs to new monitoring semantics.
deployment/changesets/generate_token_verifier_config.go Update token-verifier config generation to match new monitoring model (and related inputs).
common/monitoring/setup.go Refactor SetupBeholder signature and add SetupPyroscope helper.
common/monitoring/logging/logging.go Change logger init to accept string log level and key off Beholder.Enabled.
common/monitoring/config.go Implement new monitoring config schema and validation (log levels + pyroscope URL).
cmd/verifier/common.go Update monitoring enablement check to config.Beholder.Enabled.
cmd/executor/service_test.go Consolidate monitoring-disabled test case with new config structure.
cmd/executor/common.go Update executor monitoring enablement check to config.Beholder.Enabled.
build/devenv/services/tokenVerifier.template.toml Remove standalone pyroscope_url template entry.
build/devenv/services/tokenVerifier.go Remove embedded template usage and template-derived config helper.
build/devenv/services/aggregator.template.toml Update devenv aggregator template to new monitoring sections and remove standalone pyroscope_url.
build/devenv/fakes/go.sum Add Pyroscope module checksums for devenv fakes module.
build/devenv/fakes/go.mod Add Pyroscope indirect dependencies for devenv fakes module.
build/devenv/environment_monolith.go Remove token-verifier template-config extraction for Pyroscope/Monitoring.
build/devenv/env.toml Update monolith devenv config keys/sections to new monitoring structure.
build/devenv/env-phased.toml Update phased devenv config keys/sections to new monitoring structure.
build/devenv/env-cl.toml Update CL devenv config keys/sections to new monitoring structure.
build/devenv/env-cl-16.toml Update CL-16 devenv config keys/sections to new monitoring structure.
build/devenv/config.go Adjust strict TOML decode error reporting path.
build/devenv/components/tokenverifier/component.go Remove template-config extraction in tokenverifier component wiring.
bootstrap/config_test.go Update bootstrap monitoring validation tests to new config shape.
bootstrap/bootstrap.go Wire beholder setup via BeholderConfig, init logger via Monitoring.LogLevel, and add Pyroscope lifecycle management.
aggregator/tests/utils.go Update test configs to new monitoring struct defaults (empty struct).
aggregator/pkg/server.go Update configuration logging keys to reflect Beholder.Enabled.
aggregator/cmd/main.go Update monitoring init condition and noop monitoring construction.

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

Comment thread build/devenv/config.go
Comment thread build/devenv/config.go
Comment thread executor/config_test.go Outdated
Comment thread bootstrap/bootstrap.go
Comment thread common/monitoring/logging/logging.go
Comment thread common/monitoring/config.go Outdated
Comment thread common/monitoring/config.go Outdated
Comment thread deployment/changesets/generate_token_verifier_config.go
@bukata-sa bukata-sa force-pushed the fix/monitoring-config-struct branch from 2abc31f to 8b8ff02 Compare July 2, 2026 22:15
Comment thread bootstrap/bootstrap.go Outdated
Comment thread common/monitoring/logging/logging.go Outdated
Comment thread common/monitoring/config.go Outdated
Comment thread common/monitoring/config.go Outdated
Comment thread common/monitoring/config.go Outdated
// SetupPyroscope starts the Pyroscope profiler.
func SetupPyroscope(lggr logger.Logger, name string, config PyroscopeConfig) (*pyroscope.Profiler, error) {
if !config.Enabled {
return nil, nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: is returning nil for profiler safer than returning some no-op object?

@bukata-sa bukata-sa force-pushed the fix/monitoring-config-struct branch from c622d5c to 8070223 Compare July 3, 2026 11:27
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Code coverage report:

Package main fix/monitoring-config-struct Diff
github.com/smartcontractkit/chainlink-ccv/aggregator 49.56% 49.57% +0.01%
github.com/smartcontractkit/chainlink-ccv/bootstrap 55.60% 58.25% +2.65%
github.com/smartcontractkit/chainlink-ccv/cli 65.13% 65.13% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 13.55% 13.55% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 51.82% 51.82% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 46.47% 46.47% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 35.55% 35.60% +0.05%
github.com/smartcontractkit/chainlink-ccv/integration 46.25% 46.16% -0.09%
github.com/smartcontractkit/chainlink-ccv/pkg 100.00% 100.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/pricer 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 63.06% 63.06% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 35.17% 35.17% +0.00%
Total 46.80% 46.70% -0.10%

@bukata-sa bukata-sa enabled auto-merge July 3, 2026 12:30
@bukata-sa bukata-sa added this pull request to the merge queue Jul 3, 2026
Merged via the queue into main with commit 413d7fd Jul 3, 2026
41 checks passed
@bukata-sa bukata-sa deleted the fix/monitoring-config-struct branch July 3, 2026 12:57
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.

4 participants