Skip to content

chore(metrics): notification about slow graphql operations - #676

Merged
neSpecc merged 7 commits into
masterfrom
notify-slow-operations
Aug 10, 2026
Merged

chore(metrics): notification about slow graphql operations#676
neSpecc merged 7 commits into
masterfrom
notify-slow-operations

Conversation

@neSpecc

@neSpecc neSpecc commented Aug 10, 2026

Copy link
Copy Markdown
Member

Setup alerts for slow GraphQL and MongoDB operations

@neSpecc
neSpecc requested a lite review from Copilot August 10, 2026 19:11

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.

Pull request overview

Adds slow-operation alerting for GraphQL and MongoDB by reporting to Hawk, with supporting helpers to build/redact request context and new unit tests to validate alert behavior.

Changes:

  • Introduces notifySlowOperation helper (threshold-based) and reuses it from GraphQL and MongoDB metrics.
  • Adds buildGraphqlRequestContext to extract/redact variables and highlight key identifiers for alert context.
  • Adds unit tests for slow-operation alerting and GraphQL request context construction.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/metrics/slowOperationAlert.test.ts Adds tests asserting slow operations trigger Hawk alerts and fast/test-env operations do not.
test/metrics/graphqlRequestDetails.test.ts Adds tests for request-context extraction and variable redaction/highlighting.
src/metrics/slowOperationAlert.ts Adds shared slow-operation notification helper and truncation utility.
src/metrics/mongodb.ts Emits slow-command alerts for MongoDB command success/failure paths with relevant context.
src/metrics/graphqlRequestDetails.ts Adds GraphQL request context builder to support richer slow-operation alerts.
src/metrics/graphql.ts Triggers slow-operation alerts for GraphQL operations and includes request/error context.
package.json Bumps package patch version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/metrics/graphqlRequestDetails.ts
Comment thread src/metrics/graphql.ts
@neSpecc
neSpecc merged commit 4b11afa into master Aug 10, 2026
7 checks passed
@neSpecc
neSpecc deleted the notify-slow-operations branch August 10, 2026 19:39
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.

2 participants