Skip to content

Conversation

@tomlongridge
Copy link
Contributor

Goal

Tracks errors and performance of the MCP server.

Design

Uses the OTel Node SDK configured for BugSnag Performance monitoring, with attributes for the transport mode and OS.

The MCP_SERVER_BUGSNAG_API_KEY can still be used to set the destination of the data, but if not specified it will go to SmartBear's instance. The variable can be set to an empty value to disable all instrumentation.

Changeset

I've moved the environment variable reading to a config.ts file so it can be shared.

Release stages are used to have BugSnag enabled for end-users when using a published SDK and not in development. This is updated by a new build:production script that's triggered by the prepare phase and the Docker build.

Testing

Confirmed the data appears (or not) when configured.

* feat(common): add OTEL instrumentation

* fix: ignore bump and telemetry in coverage

* fix: call startActiveSpan without a guard
@tomlongridge tomlongridge requested review from a team as code owners December 12, 2025 23:24
@tomlongridge tomlongridge force-pushed the tom/expand-bugsnag-usage branch from 20dc673 to 7cc5bdc Compare December 12, 2025 23:36
@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

🎯 Coverage Target Met!

📈 Coverage Metrics

Metric Coverage Target Status
Lines 90.0% 80%
Functions 76.2% 80% ⚠️
Branches 85.5% 80%
Statements 90.0% 80%

📊 Test Statistics

  • Total Lines: 17,240 / 19,144
  • Total Functions: 192 / 252
  • Total Branches: 694 / 812
  • Total Statements: 17240 / 19144

🔍 Files Needing Coverage

File Coverage
scripts/set-release-stage.js 0.0%
src/common/register-clients.ts 0.0%
src/common/transport-http.ts 0.0%
src/common/transport-stdio.ts 0.0%
src/qmetry/client/testsuite.ts 10.3%

📝 Report generated on Node.js v24.10.0 • View workflow • Coverage by Vitest + v8

also fixes an issue where the script was triggered for npm install commands too
@tomlongridge tomlongridge requested a review from sazap10 December 15, 2025 18:08
"src/pactflow/client/ai.ts",
"src/pactflow/client/base.ts",
"scripts/post-coverage-comment.js",
"scripts/bump.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

we should just change this to scripts/*.js

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