Skip to content

chore: add hostname tag to Sentry config - #2934

Merged
gausie merged 4 commits into
mainfrom
sentry-hostname-tag
Jun 9, 2026
Merged

chore: add hostname tag to Sentry config#2934
gausie merged 4 commits into
mainfrom
sentry-hostname-tag

Conversation

@gausie

@gausie gausie commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Tags each Sentry event with the hostname of the machine generating the telemetry, making it easier to filter and correlate events by server instance.

Summary by CodeRabbit

  • Chores
    • Telemetry now adds the machine hostname as a tag for error reporting across core and worker processes.
    • This improves traceability of reports to specific hosts without changing external behavior or public APIs.

@gausie
gausie requested a review from a team as a code owner June 9, 2026 08:36
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2a6411d-e42c-474f-8cda-ef27eec82b68

📥 Commits

Reviewing files that changed from the base of the PR and between a126efa and ef88dc0.

📒 Files selected for processing (1)
  • controlplane/src/core/composition/composeGraphs.worker.ts
✅ Files skipped from review due to trivial changes (1)
  • controlplane/src/core/composition/composeGraphs.worker.ts

Walkthrough

This PR imports Node's os module in two runtime entrypoints and sets a Sentry tag hostname to os.hostname() during Sentry initialization. No other Sentry configuration or public interfaces were changed.

Changes

Sentry Hostname Tag

Layer / File(s) Summary
Sentry hostname tag initialization (controlplane)
controlplane/src/core/sentry.config.ts
Imports os and calls Sentry.setTag('hostname', os.hostname()) during Sentry initialization in the controlplane config.
Sentry hostname tag initialization (worker)
controlplane/src/core/composition/composeGraphs.worker.ts
Imports os and calls Sentry.setTag('hostname', os.hostname()) during Sentry initialization in the composeGraphs worker.

🎯 2 (Simple) | ⏱️ ~10 minutes

  • wundergraph/cosmo#2905: Touches composeGraphs.worker.ts Sentry instrumentation; relates to tracing/span propagation changes.
  • wundergraph/cosmo#2931: Modifies composeGraphs.worker.ts Sentry initialization and flushing; related instrumentation changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: add hostname tag to Sentry config' directly and clearly describes the main change: adding a hostname tag to Sentry configuration across two files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gausie gausie changed the title Add hostname tag to Sentry config chore: Add hostname tag to Sentry config Jun 9, 2026
@gausie gausie changed the title chore: Add hostname tag to Sentry config chore: add hostname tag to Sentry config Jun 9, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@controlplane/src/core/sentry.config.ts`:
- Line 37: The Sentry hostname tag is only set in Sentry.init path in
Sentry.setTag('hostname', os.hostname()) within sentry.config.ts but the worker
Sentry initialization in the composeGraphs.worker (function/initializer that
configures Sentry in controlplane/src/core/composition/composeGraphs.worker.ts)
does not set this tag, so add the same call to set the hostname tag after the
worker Sentry initialization (i.e., call Sentry.setTag('hostname',
os.hostname()) or equivalent using the worker's Sentry instance immediately
after its Sentry.init/configure step) so events from the worker include the
hostname tag.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0fd81586-103d-4538-b793-42bcf7bede9e

📥 Commits

Reviewing files that changed from the base of the PR and between 76a1bbc and ade483c.

📒 Files selected for processing (1)
  • controlplane/src/core/sentry.config.ts

Comment thread controlplane/src/core/sentry.config.ts
@gausie
gausie enabled auto-merge (squash) June 9, 2026 08:53
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.12%. Comparing base (9224bc0) to head (c6878ca).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
controlplane/src/core/sentry.config.ts 0.00% 1 Missing and 1 partial ⚠️
...plane/src/core/composition/composeGraphs.worker.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2934      +/-   ##
==========================================
- Coverage   65.13%   65.12%   -0.01%     
==========================================
  Files         327      327              
  Lines       47127    47130       +3     
  Branches     5239     5239              
==========================================
- Hits        30697    30695       -2     
- Misses      16406    16411       +5     
  Partials       24       24              
Files with missing lines Coverage Δ
...plane/src/core/composition/composeGraphs.worker.ts 0.00% <0.00%> (ø)
controlplane/src/core/sentry.config.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread controlplane/src/core/composition/composeGraphs.worker.ts
Comment thread controlplane/src/core/composition/composeGraphs.worker.ts
@gausie
gausie merged commit 35a0ad6 into main Jun 9, 2026
10 checks passed
@gausie
gausie deleted the sentry-hostname-tag branch June 9, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants