Skip to content

Conversation

@gheorghestrimtu
Copy link
Collaborator

@gheorghestrimtu gheorghestrimtu commented Dec 17, 2025

Add WSURL_{chainID} and HTTPURL_{chainID} labels to heartbeat metrics to enable RPC visibility via Beholder.

For privacy and security, only the domain (host) is extracted from node URLs, stripping API keys and other sensitive path information.

Changes:

  • Add EVMNodeURLs field to HeartbeatConfig
  • Extract domains from EVM node WSURL and HTTPURL in NewHeartbeatConfig
  • Add ExtractDomainFromURLString helper function
  • Add labels to heartbeat emitter for each chain's RPC endpoints
  • Add comprehensive tests for domain extraction and config handling

Add WSURL_{chainID} and HTTPURL_{chainID} labels to heartbeat metrics
to enable RPC visibility via Beholder. This allows identification of
third-party RPC usage across EVM chains.

For privacy and security, only the domain (host) is extracted from
node URLs, stripping API keys and other sensitive path information.

Changes:
- Add EVMNodeURLs field to HeartbeatConfig
- Extract domains from EVM node WSURL and HTTPURL in NewHeartbeatConfig
- Add ExtractDomainFromURLString helper function
- Add labels to heartbeat emitter for each chain's RPC endpoints
- Add comprehensive tests for domain extraction and config handling

RANE-4333
@github-actions
Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@trunk-io

This comment was marked as off-topic.

@gheorghestrimtu gheorghestrimtu marked this pull request as ready for review December 17, 2025 16:59
@gheorghestrimtu gheorghestrimtu requested a review from a team as a code owner December 17, 2025 16:59
Copilot AI review requested due to automatic review settings December 17, 2025 16:59
@gheorghestrimtu gheorghestrimtu requested a review from a team as a code owner December 17, 2025 16:59
@gheorghestrimtu gheorghestrimtu marked this pull request as draft December 17, 2025 16:59
Copy link
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

This PR adds EVM RPC node domain labels to heartbeat metrics for improved observability in Beholder, while protecting sensitive information like API keys by extracting only the domain portion of node URLs.

Key changes:

  • Added EVMNodeURLs field to HeartbeatConfig to store extracted domains mapped by chain ID
  • Implemented ExtractDomainFromURLString helper to safely extract domains from URLs
  • Updated NewHeartbeatConfig to populate EVM node domains for all configured chains

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/services/chainlink/heartbeat.go Adds EVMNodeURLs config field, implements domain extraction logic in NewHeartbeatConfig, and adds extracted domains as labels to heartbeat metrics
core/services/chainlink/heartbeat_test.go Adds comprehensive tests for domain extraction edge cases and HeartbeatConfig initialization with various EVM node URL configurations

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

@gheorghestrimtu gheorghestrimtu added the build-publish Build and Publish image to SDLC label Dec 18, 2025
@cl-sonarqube-production
Copy link

@gheorghestrimtu gheorghestrimtu marked this pull request as ready for review December 19, 2025 16:31
@gheorghestrimtu gheorghestrimtu marked this pull request as draft December 23, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-publish Build and Publish image to SDLC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant