Skip to content
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

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

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 (66649b9)

@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.15385% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.80%. Comparing base (2dc302c) to head (66649b9).

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   90.78%   90.80%   +0.01%     
==========================================
  Files         169      169              
  Lines        8055     8077      +22     
  Branches     1643     1649       +6     
==========================================
+ Hits         7313     7334      +21     
- Misses        742      743       +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.04% <75.00%> (-1.08%) ⬇️

@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 4 times, most recently from 7c75702 to 791e23f Compare October 18, 2024 13:14
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from 791e23f to 35e39f8 Compare October 22, 2024 09:29
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from 7d78ab1 to 2bf85a9 Compare November 4, 2024 12:20
@MrFabio MrFabio force-pushed the feature/koa-ignore branch from 2bf85a9 to b113855 Compare November 5, 2024 22:57
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from accecb4 to b49bd40 Compare November 8, 2024 17:21
@MrFabio
Copy link
Contributor Author

MrFabio commented Nov 8, 2024

Updated ✅

@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from ff713f3 to f7f30e3 Compare November 8, 2024 23:52
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from b3e927e to 30a395f Compare November 9, 2024 01:43
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from 520fa6b to 3b00e01 Compare November 26, 2024 14:23
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 3 times, most recently from c9904e4 to 7f02777 Compare December 2, 2024 22:43
@MrFabio MrFabio force-pushed the feature/koa-ignore branch 2 times, most recently from 76c8ae5 to c5b8964 Compare December 11, 2024 10:05
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.

2 participants