Skip to content

Conversation

tlindhardt
Copy link

Which problem is this PR solving?

  • During the upgrade of our project from v2 to v3 I noticed that the span name was not correct and the attributes were missing. Upon further inspection I found that the instrumentation was being skipped entirely.

Short description of the changes

  • Switched to ATTR_HTTP_ROUTE from SEMATTRS_HTTP_ROUTE
  • Add support to instrumentation-koa for koa v3
  • Updated tests
    • This includes removing a test to validate the generator middleware is skipped as that is no longer supported and mentioned in the upgrade guide

@tlindhardt tlindhardt requested a review from a team as a code owner July 23, 2025 21:21
Copy link

linux-foundation-easycla bot commented Jul 23, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions bot added pkg:instrumentation-koa pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found. labels Jul 23, 2025
@tlindhardt tlindhardt force-pushed the feat/instrumentation-koa/koa3-support branch from b499b4b to bdcd88a Compare July 23, 2025 21:33
@tlindhardt
Copy link
Author

I wasn't sure of the release process and if I needed to also change the manifest file or not.

Copy link
Contributor

This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature.
Are you familiar with this package? Consider becoming a component owner.

@dyladan
Copy link
Member

dyladan commented Aug 6, 2025

@seemk @JacksonWeber are either of you interested in becoming component owner here?

@tlindhardt tlindhardt force-pushed the feat/instrumentation-koa/koa3-support branch 2 times, most recently from 1e36d6a to 487143e Compare August 20, 2025 15:41
@tlindhardt
Copy link
Author

I went ahead and applied the requested changes.

@@ -13,6 +13,6 @@
koa:
# Testing ^2.7.0 covers at least 97% of the downloaded koa versions
versions:
include: "^2.7.0"
include: "^3.0.1"
Copy link
Contributor

@david-luna david-luna Sep 10, 2025

Choose a reason for hiding this comment

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

With this change only v3 and up are going to be tested. So we won't know if this instrumentation is still compatible with the ^2.7.0 range because it wont be tested anymore.

Suggested change
include: "^3.0.1"
include: ">=2.7.0 <4"

@david-luna
Copy link
Contributor

@tlindhardt

Thanks for contributing to OpenTelemetry. And sorry for getting here after 3 weeks.

I'll have this PR in my radar from now on. Please resolve the conflicts and read my comments

@david-luna david-luna added has:sponsor This package or feature has a sponsor that has volunteered to review PRs and respond to questions and removed pkg-status:unmaintained:autoclose-scheduled labels Sep 10, 2025
@david-luna
Copy link
Contributor

I sponsor this PR.

@tlindhardt
Copy link
Author

@david-luna I went ahead and made the requested changes. I wasn't exactly sure the best way to not run the test in 3.0 but let me know what you think.

Thanks!

@tlindhardt tlindhardt force-pushed the feat/instrumentation-koa/koa3-support branch 2 times, most recently from 2512466 to 76e1b10 Compare September 10, 2025 18:49
@tlindhardt tlindhardt force-pushed the feat/instrumentation-koa/koa3-support branch from 76e1b10 to 795babd Compare September 10, 2025 18:50
Copy link

codecov bot commented Sep 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.44%. Comparing base (d60ff3a) to head (6acb82b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2957   +/-   ##
=======================================
  Coverage   91.44%   91.44%           
=======================================
  Files         146      146           
  Lines        8192     8193    +1     
  Branches     1846     1848    +2     
=======================================
+ Hits         7491     7492    +1     
  Misses        701      701           
Flag Coverage Δ
instrumentation-amqplib 91.25% <ø> (ø)
instrumentation-aws-lambda 94.66% <ø> (ø)
instrumentation-aws-sdk 86.48% <ø> (ø)
instrumentation-bunyan 98.47% <ø> (ø)
instrumentation-cassandra-driver 84.02% <ø> (ø)
instrumentation-connect 98.47% <ø> (ø)
instrumentation-cucumber 92.72% <ø> (ø)
instrumentation-dataloader 98.12% <ø> (ø)
instrumentation-dns 96.87% <ø> (ø)
instrumentation-express 98.14% <ø> (ø)
instrumentation-fastify 93.98% <ø> (ø)
instrumentation-generic-pool 40.54% <ø> (ø)
instrumentation-graphql 93.99% <ø> (ø)
instrumentation-hapi 99.06% <ø> (ø)
instrumentation-ioredis 91.08% <ø> (ø)
instrumentation-kafkajs 97.89% <ø> (ø)
instrumentation-knex 94.61% <ø> (ø)
instrumentation-koa 96.22% <100.00%> (ø)
instrumentation-lru-memoizer 100.00% <ø> (ø)
instrumentation-memcached 92.00% <ø> (ø)
instrumentation-mongodb 88.25% <ø> (ø)
instrumentation-mongoose 90.74% <ø> (ø)
instrumentation-mysql 93.36% <ø> (ø)
instrumentation-mysql2 95.91% <ø> (ø)
instrumentation-nestjs-core 96.11% <ø> (ø)
instrumentation-net 96.55% <ø> (ø)
instrumentation-openai 87.96% <ø> (ø)
instrumentation-oracledb 96.13% <ø> (ø)
instrumentation-pg 95.95% <ø> (ø)
instrumentation-pino 100.00% <ø> (ø)
instrumentation-redis 85.26% <ø> (ø)
instrumentation-restify 91.53% <ø> (ø)
instrumentation-router 97.16% <ø> (ø)
instrumentation-runtime-node 89.47% <ø> (ø)
instrumentation-socket.io 81.13% <ø> (ø)
instrumentation-tedious 92.17% <ø> (+0.06%) ⬆️
instrumentation-typeorm 90.50% <ø> (ø)
instrumentation-undici 91.78% <ø> (ø)
instrumentation-winston 79.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ackages/instrumentation-koa/src/instrumentation.ts 95.18% <ø> (ø)
packages/instrumentation-koa/src/utils.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has:sponsor This package or feature has a sponsor that has volunteered to review PRs and respond to questions pkg:instrumentation-koa pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants