Skip to content

add a custom event record that new relic can pick up instead of logging - #3386

Merged
danoswaltCL merged 1 commit into
devfrom
wip/record-perfdiag-in-new-relic
Oct 23, 2026
Merged

danoswaltCL merged 1 commit into
devfrom
wip/record-perfdiag-in-new-relic

Conversation

@danoswaltCL

Copy link
Copy Markdown
Collaborator

adds "perfdiag" stats events as a custom event that can be piped directly to new relic instead of using logging.

https://docs.newrelic.com/docs/data-apis/custom-data/custom-events/report-custom-event-data/

this will allow us to query it all in NR, and obviate the need for the app that I created to marry the splunk logs with new relic data.

i'm leaving the logging for now, but that could be removed later if this works.

@danoswaltCL
danoswaltCL requested review from bcb37 and a balanced review from Copilot October 23, 2026 14:18

Copilot AI 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.

🟢 Approval recommended

The additive telemetry preserves existing logging, enablement controls, and failure isolation, with no blocking issues identified.

No open issues 🎉

What changed in this PR

Adds New Relic custom events for backend performance diagnostics, allowing metrics to be queried alongside transaction data while retaining existing JSON logging and enablement controls.

Changes:

  • Emits PerfDiag window reports and PerfDiagCacheWrite slow-write events.
  • Flattens nested event attributes and omits null values through a failure-isolated New Relic wrapper.
  • Adds tests for event payloads, missing fields, and slow-write thresholds.
File Description
packages/​backend/​test/​unit/​lib/​perfDiagnostics.test.ts Tests event emission, flattened attributes, and threshold behavior.
packages/​backend/​src/​lib/​perfDiagnostics.ts Emits custom events alongside existing diagnostic logs.
packages/​backend/​src/​lib/​newrelic.ts Adds a guarded custom-event API wrapper.
packages/​backend/​src/​env.ts Removes “Temporary” from the diagnostics comment; no behavior change.
packages/​backend/​src/​api/​services/​CacheService.ts Clarifies the cache-write instrumentation comment; no behavior change.

Review effort: Balanced

@bcb37 bcb37 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

interesting

@danoswaltCL
danoswaltCL merged commit 1751ef7 into dev Oct 23, 2026
7 checks passed
@danoswaltCL
danoswaltCL deleted the wip/record-perfdiag-in-new-relic branch October 23, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants