Skip to content

feat: added support for disable tracing by groups #1755

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

Merged
merged 11 commits into from
Jun 27, 2025

Conversation

aryamohanan
Copy link
Contributor

@aryamohanan aryamohanan commented Jun 5, 2025

Previously, tracing could only be selectively disabled at the package level.
With this changes, tracing can now also be disabled at the group level.

New Configuration Options

1. Environment Variables

  • Disable by group (e.g., logging):
INSTANA_TRACING_DISABLE_GROUPS=logging
  • Disable specific instrumentations (e.g., console, redis):
INSTANA_TRACING_DISABLE_INSTRUMENTATIONS=console,redis #incorporated in last PR
  • Disable both groups and instrumentations (flat format):
INSTANA_TRACING_DISABLE=redis,logging

2. In-Code

To disable specific instrumentations or groups:

require('@instana/collector')({
  tracing: {
    disable: {
      instrumentations: ['redis'],
      groups: ['logging']
    }
  }
});

Or using flat shorthand:

require('@instana/collector')({
  tracing: {
    disable: ['redis', 'logging']
  }
});

TODO


References

@aryamohanan aryamohanan added the WIP label Jun 5, 2025
@aryamohanan aryamohanan force-pushed the feat-disable-logging branch 2 times, most recently from 390a561 to fc32541 Compare June 6, 2025 07:36
@aryamohanan aryamohanan removed the WIP label Jun 11, 2025
@aryamohanan aryamohanan force-pushed the feat-disable-logging branch from 15ef76a to f52ea3f Compare June 17, 2025 04:27
@aryamohanan aryamohanan changed the title feat: added support for disable logging feat: added support for disable trace logging Jun 17, 2025
@aryamohanan aryamohanan force-pushed the feat-disable-logging branch 2 times, most recently from ccf80ce to bcde185 Compare June 17, 2025 12:17
@aryamohanan aryamohanan changed the title feat: added support for disable trace logging feat: added support for disable tracing by category Jun 17, 2025
@aryamohanan aryamohanan requested a review from kirrg001 June 17, 2025 13:08
@aryamohanan aryamohanan marked this pull request as ready for review June 17, 2025 13:08
@aryamohanan aryamohanan requested a review from a team as a code owner June 17, 2025 13:08
@aryamohanan aryamohanan requested a review from kirrg001 June 18, 2025 05:51
@aryamohanan aryamohanan force-pushed the feat-disable-logging branch from 0d4f438 to 017b25e Compare June 25, 2025 06:08
@aryamohanan aryamohanan changed the base branch from main to fix-disabling-env June 25, 2025 06:09
@aryamohanan aryamohanan force-pushed the feat-disable-logging branch from 8c28038 to bf2e7b1 Compare June 25, 2025 16:20
@aryamohanan aryamohanan changed the base branch from fix-disabling-env to main June 26, 2025 03:48
@aryamohanan aryamohanan force-pushed the feat-disable-logging branch from bf2e7b1 to 69e227c Compare June 26, 2025 03:53
@aryamohanan aryamohanan changed the title feat: added support for disable tracing by category feat: added support for disable tracing by groups Jun 26, 2025
@aryamohanan aryamohanan requested a review from kirrg001 June 26, 2025 04:56
if (!normalizedEntry) return;

// The supported groups are predefined in DISABLABLE_INSTRUMENTATION_GROUPS.
// If the entry matches one of these, we classify it as a group, otherwise, considered as an instrumentation.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The disable config can be a flat list like ['redis', 'logging']. Internally, we have two lists: instrumentations and groups. If an entry matches a known group (defined in constants), we add it to the groups list. Everything else goes into the instrumentations list.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense to me

@aryamohanan aryamohanan merged commit 64b6e4a into main Jun 27, 2025
1 check passed
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