Skip to content

feat(observability): identify the process in telemetry - #820

Merged
taitelee merged 5 commits into
mainfrom
claude/obs-772-process-identity-oyqtjm
Oct 13, 2026
Merged

taitelee merged 5 commits into
mainfrom
claude/obs-772-process-identity-oyqtjm

Conversation

@taitelee

Copy link
Copy Markdown
Member

Requested by Taite · project thread

Summary

Before: the OpenTelemetry resource carried only service.name (the constant wavehouse), OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES were ignored, instance_id was logged once at boot and nowhere else, and the build was visible only on /version. Two replicas of one role pushing over OTLP were indistinguishable.

After: every span, metric series and OTLP log record carries service.version, service.instance.id (the boot config's instance_id), wavehouse.roles (sorted), wavehouse.git_commit and wavehouse.build_time alongside service.name, and the standard env vars override or extend them (a malformed OTEL_RESOURCE_ATTRIBUTES is logged, never fatal). A new wavehouse_build_info gauge (always 1; version, git_commit, build_time, roles; no instance or tenant label, since the resource carries the instance) shows a mixed-version rollout. Every log line after the boot config loads carries instance_id, stdout included.

How: observability.Identity (new identity.go) builds the resource with resource.WithFromEnv() merged last and registers the build-info gauge on the meter provider; InitProvider takes an Identity instead of a service name. internal/app/wire_identity.go (new) builds it from the boot config and build info. Because #712 and #770 edit wire.go and app.go, those touches are minimal: wire.go changes two lines inside wireObservability (the InitProvider argument and the OTLP logger's With), neither in a region those PRs edit; app.go drops the now-duplicate instance_id key from the process roles line (line 184), separated by an unchanged line from #712's nearest hunk. A git merge-tree against both PR heads showed no new conflicts.

Test plan

  • make build, go vet ./... (and with -tags integration)
  • go test for internal/observability, internal/app, internal/config, cmd/wavehouse: resource attributes, env override key by key, empty fields omitted, malformed env non-fatal, Prometheus scrape shows wavehouse_build_info and target_info with service_instance_id
  • Pre-push code and docs reviewers: ship_it
  • make ci (not run here: needs Docker; owner runs it locally). golangci-lint could not be downloaded in this environment either. tests/integration/otel_test.go gains build_info/target_info assertions that run there.

Related Issues

Closes #772
Part of #777

🤖 Generated with Claude Code

https://claude.ai/code/session_0174TPmnzAJSxK7ej3Q9q1i8


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

📝 Summary

Summary by CodeRabbit

  • New Features
    • Log records now include the process instance ID after configuration loads. Telemetry also identifies each process with service, build, instance, and role information.
    • Metrics include a build information gauge labeled with version, commit, build time, and roles.
    • Standard OpenTelemetry environment variables can override or extend resource attributes. Malformed resource attributes are logged without preventing startup.
  • Documentation
    • Updated configuration, deployment, and observability guidance to explain process identity in logs and telemetry.

The application now builds a process identity from service, build, instance, and role data. OpenTelemetry resources and logs use that identity, and enabled metrics providers register a wavehouse_build_info gauge.

Changes: Process Identity

Layer / File(s) Summary
Construct process identity
internal/observability/identity.go, internal/app/wire_identity.go, internal/app/wire_identity_test.go
Adds the Identity type and builds it from application build metadata, instance ID, and sorted role names.
Apply identity to telemetry
internal/observability/identity.go, internal/observability/provider.go, internal/app/wire.go, internal/observability/*_test.go, internal/testutil/otlp.go, tests/integration/otel_test.go, docs/src/content/docs/architecture.md, docs/src/content/docs/configuration.mdx, docs/src/content/docs/deployment.md, AGENTS.md, CHANGELOG.md
InitProvider accepts an Identity and builds a shared resource with environment overrides. It registers wavehouse_build_info when metrics are enabled. Tests check resource attributes, environment handling, the gauge, and Prometheus target_info.
Add identity to log records
cmd/wavehouse/main.go, internal/app/app.go, internal/app/wire.go, internal/observability/identity.go, internal/config/config.go, config.yaml, docs/src/content/docs/architecture.md, docs/src/content/docs/configuration.mdx, docs/src/content/docs/deployment.md, AGENTS.md
After configuration loads, the default logger includes the instance ID. The process-roles startup log no longer repeats it. Documentation describes the instance ID in logs and telemetry.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant InitProvider
  participant newResource
  participant MeterProvider
  App->>App: identity() builds fields and sorted roles
  App->>InitProvider: pass Identity and ProviderConfig
  InitProvider->>newResource: build telemetry resource from Identity
  InitProvider->>MeterProvider: register build-info gauge
Loading

Suggested reviewers: ericandrechek

Merge Risk: 🔵 Low · up to 17fae

Telemetry now identifies the process, its roles, and its build. The remaining gap affects only Prometheus scraping: when one scrape target load-balances across several replicas, ordinary metric series lack an instance label, so those replicas cannot be distinguished. Adding that label is a small follow-up, and the change is otherwise reasonable to merge.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 52.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 12 files. (6 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Direct issue [#772] requires process identity on telemetry, build visibility in metrics, and standard OpenTelemetry environment support. internal/observability/identity.go builds service.name, `se…
Out of Scope Changes check Passed The changes remain connected to [#772]. Wiring updates pass the identity to the providers and loggers. Application, configuration, documentation, changelog, and integration-test updates document or ve…
Title check Passed The title clearly and concisely describes the primary change: adding process identity to telemetry.
Description check Passed The description directly explains the telemetry identity changes, build-info metric, logging updates, environment overrides, and test plan.
Full details: Docstring Coverage

Explanation

Docstring coverage is 52.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 12 files. (6 skipped: 6 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions github-actions Bot added documentation Improvements or additions to documentation go Pull requests that update go code area/observability Metrics, logs, traces, health, profiling area/docs Documentation, site/, README area/infra CI, build, deploy, Docker, release area/app Process wiring (internal/app): component build, run, release labels Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

📚 Docs preview

✅ Live: https://pr-820-wavehouse-docs.wave-rf.workers.dev (follows this PR)
This commit (17fae0d): https://6e4b5dda-wavehouse-docs.wave-rf.workers.dev (exactly this commit; open it if the link above looks stale)

  • Commit: 17fae0d Merge remote-tracking branch 'origin/main' into claude/obs-772-process-identity-oyqtjm
  • Author: @taitelee
  • Committed: 2026-10-13 11:01 EDT
  • Uploaded: 2026-10-13 13:55 EDT (run)

@github-code-quality

github-code-quality Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Go

Go

The overall line coverage in commit 17fae0d in the claude/obs-772-proce... branch remains at 93%, unchanged from commit 38cec1b in the main branch.

Show a line coverage summary of the most impacted files.
File main 38cec1b claude/obs-772-proce... 17fae0d +/-
internal/observ...ity/provider.go 83% 81% -2%
internal/ingest/claims.go 92% 91% -1%
internal/mq/ext...nal_consumer.go 89% 88% -1%
internal/mq/external.go 85% 85% 0%
internal/ingest/worker.go 97% 97% 0%
internal/app/wire.go 93% 93% 0%
cmd/wavehouse/main.go 62% 64% +2%
internal/observ...ity/identity.go 0% 95% +95%
internal/app/wire_identity.go 0% 100% +100%

Updated October 13, 2026 15:28 UTC

…s-identity-oyqtjm

# Conflicts:
#	AGENTS.md
#	docs/src/content/docs/architecture.md
#	docs/src/content/docs/configuration.mdx

Copy link
Copy Markdown
Member Author

Integration tests (backends) failed on 17fae0d in internal/mq TestExternalNATS_Recheck ("a row the history refused shows as a gap", a 5s Eventually on the external-NATS history poll). I don't think this PR caused it:

  • This PR changes nothing in internal/mq, and nothing that test calls.
  • The same test passed on this branch's previous head (8cad471).
  • It also passed on main at 38cec1b, the commit this head merges.

The test is timing-sensitive, so this looks like a one-off. No fix exists yet because nothing points to a real defect. I'll re-run the failed job once when the run finishes, and treat a second failure as real.


Generated by Claude Code

@taitelee

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@taitelee

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f30789fd-545c-4d18-a9aa-28aeaec18e85
📥 Commits

Reviewing files that changed from the base of the PR and between 38cec1b and 17fae0d.

📒 Files selected for processing (18)
  • AGENTS.md
  • CHANGELOG.md
  • cmd/wavehouse/main.go
  • config.yaml
  • docs/src/content/docs/architecture.md
  • docs/src/content/docs/configuration.mdx
  • docs/src/content/docs/deployment.md
  • internal/app/app.go
  • internal/app/wire.go
  • internal/app/wire_identity.go
  • internal/app/wire_identity_test.go
  • internal/config/config.go
  • internal/observability/identity.go
  • internal/observability/identity_test.go
  • internal/observability/provider.go
  • internal/observability/provider_test.go
  • internal/testutil/otlp.go
  • tests/integration/otel_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Review details
🧰 Additional context used
📚 Code guidelines (5)
docs/src/content/docs/deployment.md — auto-discovered
AGENTS.md — auto-discovered
docs/src/content/docs/development.md — auto-discovered
.github/copilot-instructions.md — auto-discovered
CONTRIBUTING.md — auto-discovered
📓 Path-based instructions (8)
Source excerpt: All images use multi-stage builds (Go Alpine builder → distroless runtime) for minimal attack surface.

📄 CodeRabbit inference engine (docs/src/content/docs/deployment.md)

Files:

  • docs/src/content/docs/deployment.md
Source excerpt: Add the field to the appropriate struct in `internal/config/config.go` with `yaml` and `env` tags, and put a non-zero default in `defaults()` there.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • internal/config/config.go
Source excerpt: **In MDX, leave a blank line between a JSX tag and a code fence.**

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • docs/src/content/docs/configuration.mdx
Source excerpt: **Integration test needing Docker** → add a subtest under `tests/integration/` (e.g.

📄 CodeRabbit inference engine (docs/src/content/docs/development.md)

Files:

  • tests/integration/otel_test.go
See [AGENTS.md](../AGENTS.md) for project conventions, architecture notes, and AI agent instructions.

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • AGENTS.md
Source excerpt: **Docs prose**: never hard-wrap Markdown — one paragraph is one line.

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • docs/src/content/docs/configuration.mdx
Source excerpt: Run `make fix` to apply them.

📄 CodeRabbit inference engine (docs/src/content/docs/development.md)

Files:

  • CHANGELOG.md
  • docs/src/content/docs/deployment.md
  • docs/src/content/docs/configuration.mdx
  • docs/src/content/docs/architecture.md
  • AGENTS.md
Source excerpt: **Editors see WH001 in `.md` only.**

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • CHANGELOG.md
  • docs/src/content/docs/deployment.md
  • docs/src/content/docs/architecture.md
  • AGENTS.md
🪛 LanguageTool
CHANGELOG.md

[typographical] ~44-~44: Consider using an em dash in dialogues and enumerations.
Context: - **Every span, metric series and log rec...

(DASH_RULE)

docs/src/content/docs/configuration.mdx

[typographical] ~286-~286: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ... you can run traces-only, logs-only, etc. Prometheus exposition is configured in ...

(WRB_QUESTION_MARK)


[style] ~286-~286: Since ownership is already implied, this phrasing may be redundant.
Context: ... Prometheus exposition is configured in its own top-level prometheus b...

(PRP_OWN)


[typographical] ~296-~296: The word ‘When’ starts a question. Add a question mark (“?”) at the end of the sentence.
Context: ...ized regardless of the sub-toggles below. The OTLP endpoint, TLS, custom CA, mutu...

(WRB_QUESTION_MARK)

AGENTS.md

[style] ~43-~43: Since ownership is already implied, this phrasing may be redundant.
Context: ...as behavior; a new backend runs it from its own test, with mqtest.Caps only where its...

(PRP_OWN)

Comment thread internal/observability/provider.go
@github-project-automation github-project-automation Bot moved this from Backlog to In review in WaveHouse Task Board Oct 13, 2026
@taitelee
taitelee marked this pull request as ready for review October 13, 2026 17:53
@taitelee
taitelee requested review from a team and EricAndrechek October 13, 2026 17:53
@taitelee
taitelee merged commit 538274d into main Oct 13, 2026
40 of 43 checks passed
@taitelee
taitelee deleted the claude/obs-772-process-identity-oyqtjm branch October 13, 2026 17:55
@github-project-automation github-project-automation Bot moved this from In review to Done in WaveHouse Task Board Oct 13, 2026

This branch was successfully deployed

1 active deployment
preview/docs — 17fae0d9 Deployed Oct 13, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/app Process wiring (internal/app): component build, run, release area/docs Documentation, site/, README area/infra CI, build, deploy, Docker, release area/observability Metrics, logs, traces, health, profiling documentation Improvements or additions to documentation go Pull requests that update go code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat(observability): identify the process in telemetry (version, instance id, roles)

2 participants