Skip to content

feat(koa): Adds support to ignore a span by its layer name #2028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MrFabio
Copy link
Contributor

@MrFabio MrFabio commented Mar 20, 2024

Which problem is this PR solving?

  • Adds ignoreLayersName option to instrumentation constructor config to allow layers to be ignored by its name.
  • Currently we have the ignoreLayersType config, this new one will run after this check.
  • It is useful if we want to ignore some layers like logger, allowedMethods, and some ones with no name. It also helps with reducing the number of spans.

Short description of the changes

  • Defines KoaInstrumentationConfig with ignoreLayersName which is an array of string (layer names):
  • Utils module with isLayerNameIgnored to check if a layer should be ignored by the name
  • Modifies _patchLayer to check if the layer is ignored by the config

@MrFabio MrFabio requested a review from a team March 20, 2024 19:36
Copy link

linux-foundation-easycla bot commented Mar 20, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: MrFabio / name: Fábio Gomes (7f9737f)

@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from 4623e18 to 47bed61 Compare March 26, 2024 22:16
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from f41b872 to a5b3a6e Compare April 2, 2024 13:49
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.70%. Comparing base (11a94b0) to head (7f9737f).

Files with missing lines Patch % Lines
...lemetry-instrumentation-koa/src/instrumentation.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2028      +/-   ##
==========================================
+ Coverage   89.68%   89.70%   +0.01%     
==========================================
  Files         187      187              
  Lines        9059     9082      +23     
  Branches     1858     1865       +7     
==========================================
+ Hits         8125     8147      +22     
- Misses        934      935       +1     
Files with missing lines Coverage Δ
...ode/opentelemetry-instrumentation-koa/src/types.ts 100.00% <ø> (ø)
...ode/opentelemetry-instrumentation-koa/src/utils.ts 100.00% <100.00%> (ø)
...lemetry-instrumentation-koa/src/instrumentation.ts 94.11% <75.00%> (-1.07%) ⬇️
🚀 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.

@MrFabio MrFabio force-pushed the feature/koa-ignore branch 8 times, most recently from 882914e to 57512e3 Compare April 6, 2024 13:55
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from 57512e3 to d5e6c1d Compare April 10, 2024 09:44
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from d5e6c1d to 5cb51b8 Compare April 18, 2024 18:35
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from 8e3b4df to fe52615 Compare May 9, 2024 14:11
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 4 times, most recently from f0e8dd2 to e2b7711 Compare May 21, 2024 21:38
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from ff73355 to 1dce93d Compare May 24, 2024 10:31
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from 882121f to f7565e7 Compare June 4, 2024 15:02
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from f7565e7 to 8dfc847 Compare June 8, 2024 13:22
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from f7079e3 to a7ac489 Compare January 8, 2025 22:54
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 4 times, most recently from c2119dc to 1bc39fb Compare January 23, 2025 10:07
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from 4ebd167 to 7d620ea Compare February 8, 2025 12:07
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from a4ff4a8 to 9dd90be Compare February 17, 2025 21:35
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from a8f600a to 20aed9b Compare March 5, 2025 17:20
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from 0d877ed to 887f208 Compare March 15, 2025 12:08
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from e197f74 to edbaf52 Compare March 28, 2025 18:57
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from edbaf52 to f542500 Compare April 7, 2025 17:57
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from f542500 to 002a7f5 Compare April 22, 2025 09:38
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from 002a7f5 to b93b68e Compare May 13, 2025 21:12
@pichlermarc
Copy link
Member

@trentm - I saw you reviewed this PR before - however this PR is targeting an unmaintained component. Are you sponsoring this feature? 🤔 If yes, please apply the has:sponsor label.

@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from ac13a3c to a474f5c Compare May 23, 2025 08:50
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 4 times, most recently from 2894823 to 50ed50a Compare June 5, 2025 10:19
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from 50ed50a to 7f9737f Compare June 5, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:instrumentation-koa pkg-status:unmaintained:autoclose-scheduled 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.

3 participants