Skip to content

Add JobSpecReporter service for OCR2 job spec telemetry via Beholder#22123

Merged
thomjg merged 31 commits intodevelopfrom
feat/add-jobspecreporter-20260420
May 7, 2026
Merged

Add JobSpecReporter service for OCR2 job spec telemetry via Beholder#22123
thomjg merged 31 commits intodevelopfrom
feat/add-jobspecreporter-20260420

Conversation

@thomjg
Copy link
Copy Markdown
Contributor

@thomjg thomjg commented Apr 21, 2026

Relevant ticket: DF-24042

Summary

Adds a new JobSpecReporter service that emits full job-spec telemetry via Beholder for active OCR2 jobs. This gives internal teams visibility into running job configurations.

What's added

Proto schema (core/services/nodestatusreporter/jobspec/events/)

  • job_spec.proto with JobSpecEvent, OCR2OracleSpecInfo, OCR2EVMRelayConfig, and OCR2MedianPluginConfig messages. All 21 fields of OCR2OracleSpec are covered. Raw JSON passthroughs (relay_config_json, plugin_config_json, onchain_signing_strategy_json) are included alongside typed sub-messages to ensure forward compatibility.
  • Mirrors the existing bridgestatus/events/ layout (emit.go, generate.go, types.go).

JobSpecReporter service (core/services/nodestatusreporter/jobspec/)

  • Mirrors BridgeStatusReporter exactly: same services.Engine pattern, HealthReport(), disabled-early-return in start()`.
  • Hourly heartbeat via services.NewTicker emitting a JobSpecEvent for each active job that passes the shouldEmit gate.
  • Immediate create / delete events via a new job.Listener registered with job.Spawner — covers both FMS-driven approvals and manually created jobs.
  • Proposal lifecycle fields (proposed_at, approved_at, accept_latency_seconds) populated from feeds.ORM; silently omitted for manually created jobs.
  • Bridge names extracted from the top-level observationSource DOT DAG only (not sub-pipelines).

job.Spawner listener hook (core/services/job/spawner.go)

  • New Listener interface with OnJobStarted / OnJobStopped.
  • RegisterListener(Listener) added to the Spawner interface.
  • Listeners are called in a panic-safe, non-blocking goroutine after successful CreateJob and after DeleteJob.

feeds.ORM (core/services/feeds/orm.go)

  • Adds GetJobProposalByExternalJobID — a read-only SELECT mirroring GetJobProposalByRemoteUUID.

Config ([JobSpecReporter] TOML section)

  • Enabled — defaults false.
  • PollingInterval — defaults 1h, minimum 1m.
  • EnabledOCR2PluginTypes — allowlist of OCR2 plugin types to emit for; defaults ["median"]. Set to [] to emit for all OCR2 plugin types.
  • EmitNonOCR2Jobs — emit the generic envelope for non-OCR2 jobs; defaults false.

Initial rollout: only ocr2median jobs emit by default. Widening to other job types is a config change, no code change required.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

✅ No conflicts with other open PRs targeting develop

@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs 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
Copy link
Copy Markdown

trunk-io Bot commented Apr 21, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestIntegration_KeeperPluginLogUpkeep_ErrHandler The test failed without a specific error message, likely due to an unspecified failure in the test process. Logs ↗︎

View Full Report ↗︎Docs

Comment thread core/services/nodestatusreporter/jobspec/events/job_spec.proto Outdated
@thomjg thomjg added the build-publish Build and Publish image to SDLC label Apr 29, 2026
@thomjg thomjg removed the build-publish Build and Publish image to SDLC label Apr 29, 2026
@thomjg thomjg added build-publish Build and Publish image to SDLC and removed build-publish Build and Publish image to SDLC labels Apr 29, 2026
@thomjg thomjg requested review from a team as code owners May 4, 2026 17:25
Comment thread core/config/docs/core.toml
Comment thread core/config/docs/core.toml
Comment thread core/services/job/spawner.go Outdated
Comment thread core/services/job/spawner.go
Comment thread core/services/nodestatusreporter/jobspec/job_spec_reporter.go
}
s.Service, s.eng = services.Config{
Name: ServiceName,
Start: s.start,
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.

Is there a need for a custom Close() here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't be a need for it, services.Engine stops the goroutine; same for BridgeStatusReporter which has a similar implementation.

cll-gg
cll-gg previously approved these changes May 6, 2026
@thomjg thomjg requested a review from jmank88 May 6, 2026 13:29
@cl-sonarqube-production
Copy link
Copy Markdown

@thomjg thomjg added this pull request to the merge queue May 7, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 7, 2026
@thomjg thomjg added this pull request to the merge queue May 7, 2026
Merged via the queue into develop with commit 1ad6a12 May 7, 2026
271 of 275 checks passed
@thomjg thomjg deleted the feat/add-jobspecreporter-20260420 branch May 7, 2026 16:41
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.

3 participants