Skip to content

Conversation

@kirqz23
Copy link
Contributor

@kirqz23 kirqz23 commented Aug 25, 2025

What

Use chainlink-common otelzap core in chainlink global logger for exporting logs through beholder to Otel and Loki.
Enables early logger setup with OTel support without requiring chainlink logger recreation when beholder is initialised. Leveraging atomic core for swapping noop core with otel core when Beholder is ready.

Related PRs:

  1. INFOPLAT-2282: Add beholderNoopLogerProvider and LogStreamingEnabled flag to control emitting logs chainlink-common#1263
  2. INFOPLAT-1035: logger implement otelzap chainlink-common#1359
  3. INFOPLAT-2672: beholder: config option to enable streaming logs to OTel in LOOP chainlink-common#1486
  4. INFOPLAT-2672: beholder: config option to enable streaming logs to OTel in core #19005
  5. Beholder OTel logs streaming for LOOPP's chainlink-common#1566
  6. INFOPLAT-2449 add telemetry log level config option #19775
  7. beholder: add telemetry LogLevel config option for log streaming chainlink-common#1591

How

  1. Early init of beholder and it's dependencies in before hooks for subcommands. We introduced common BeforeNode() and AfterNode() function that setups and clears all dependencies including database, datastore, keystore and beholder. The reference to db, keystore and datasource is stored in the shell.
  2. We integrated chainlink-common otelzap package with zap core for otel. To be able to initilize logger earlier (before beholder is ready in root node command), we leverage atomic functionality to swap atomic core for otel whenever beholder is ready in atomic operation to avoid race condition. Additionally, we implemented NewWithCores() that accepts additional cores (besides default one) that helped us achieve above.

@kirqz23 kirqz23 requested review from a team as code owners August 25, 2025 12:20
@kirqz23 kirqz23 marked this pull request as draft August 25, 2025 12:20
@github-actions
Copy link
Contributor

👋 kirqz23, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@kirqz23 kirqz23 changed the title INFOPLAT-2449: Use chainlink-common otelzap core in chainlink core global logger INFOPLAT-2449: Use chainlink-common otelzap core in chainlink global logger Aug 31, 2025
@kirqz23 kirqz23 marked this pull request as ready for review August 31, 2025 15:01
@kirqz23 kirqz23 marked this pull request as draft September 5, 2025 12:30
@kirqz23 kirqz23 marked this pull request as ready for review September 8, 2025 13:28
@kirqz23 kirqz23 requested a review from jmank88 September 8, 2025 22:04
@kirqz23 kirqz23 requested a review from jmank88 September 8, 2025 22:26
@kirqz23 kirqz23 requested a review from jmank88 September 9, 2025 21:16
@kirqz23 kirqz23 requested a review from 4of9 September 12, 2025 14:52
@pkcll pkcll force-pushed the infoplat-2449-otelzap-logger branch from d3bd9c3 to f13bfc3 Compare September 29, 2025 02:37
@pkcll pkcll requested a review from a team as a code owner September 29, 2025 02:37
@jmank88 jmank88 added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@pavel-raykov pavel-raykov added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@pavel-raykov pavel-raykov added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@cl-sonarqube-production
Copy link

@jmank88 jmank88 added this pull request to the merge queue Oct 14, 2025
Merged via the queue into develop with commit 5798b30 Oct 14, 2025
361 of 367 checks passed
@jmank88 jmank88 deleted the infoplat-2449-otelzap-logger branch October 14, 2025 22:54
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.

4 participants