Skip to content

central config: hande disable_instrumentations #510

Merged
xrmx merged 8 commits intomainfrom
disable-instrumentations
Mar 24, 2026
Merged

central config: hande disable_instrumentations #510
xrmx merged 8 commits intomainfrom
disable-instrumentations

Conversation

@xrmx
Copy link
Copy Markdown
Member

@xrmx xrmx commented Mar 19, 2026

What does this pull request do?

This implement disable_instrumentations central config option using a rule based tracer configurator.

Related issues

Fixed #509

This implement disable_instrumentations using a rule based tracer
configurator.
@xrmx xrmx changed the title Add handling for disable_instrumentations central config: hande disable_instrumentations Mar 19, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 19, 2026

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 19, 2026

Comment thread pyproject.toml Outdated
Comment thread src/elasticotel/distro/config.py Outdated
Comment thread src/elasticotel/distro/config.py
Comment thread src/elasticotel/distro/config.py Outdated
@xrmx xrmx marked this pull request as ready for review March 20, 2026 16:58
@xrmx xrmx requested review from a team as code owners March 20, 2026 16:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

This pull request introduces support for dynamically deactivating instrumentations in EDOT Python. The changes add a new updatable tracer configurator system with rule-based configuration that supports glob patterns for instrumentation scope matching. A new remote configuration key deactivate_instrumentations is implemented to parse comma-separated glob patterns and update tracer rules at runtime. Documentation is updated to reflect the new configuration setting, Python 3.14 support, and instrumentation table schema with tracer names. Tests verify the tracer configurator integration with the distro and OPAMP handler flow.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch disable-instrumentations
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/elasticotel/distro/config.py`:
- Around line 204-223: The code assumes deactivate_instrumentations is always a
string; update _rules_from_deactivate_instrumentations to validate the incoming
csv parameter (and the call site in _handle_deactivate_instrumentations) by
checking isinstance(value, str) before calling .split(",") and treating
non-string/None values as the empty string (or returning an empty rules list),
and add the same validation for the related logic referenced at lines ~286-289
so arrays/numbers/nulls won’t raise when parsed; reference
_rules_from_deactivate_instrumentations and _handle_deactivate_instrumentations
to locate where to add the type check and safe fallback.
- Around line 214-237: The handler currently ACKs success and drops the update
when _set_tracer_configurator is missing and unconditionally replaces any custom
configurator with tracer_configurator._updatable_tracer_configurator; change
_handle_deactivate_instrumentations so that if getattr(tracer_provider,
"_set_tracer_configurator", None) is None it returns a failing ConfigUpdate (do
not persist or claim success) and when rules have changed do not blindly call
set_tracer_configurator with _updatable_tracer_configurator if a different
configurator is already active — instead obtain current_tracer_configurator via
tracer_configurator._get_tracer_configurator(), compose a new configurator that
delegates to the existing configurator and applies the updated rules (or else
return a failing ConfigUpdate if composition is not possible), only clear the
cache and call tracer_configurator._updatable_tracer_configurator /
set_tracer_configurator after successful composition, and only then persist via
_get_config().deactivate_instrumentations.update and return a success
ConfigUpdate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5c72610c-9e7a-4805-a1ae-bd923688edf8

📥 Commits

Reviewing files that changed from the base of the PR and between c3abe98 and b5e7939.

📒 Files selected for processing (8)
  • docs/reference/edot-python/configuration.md
  • docs/reference/edot-python/supported-technologies.md
  • pyproject.toml
  • src/elasticotel/distro/__init__.py
  • src/elasticotel/distro/config.py
  • src/elasticotel/sdk/trace/__init__.py
  • src/elasticotel/sdk/trace/tracer_configurator.py
  • tests/distro/test_distro.py

Comment thread src/elasticotel/distro/config.py
Comment thread src/elasticotel/distro/config.py
xrmx added a commit to xrmx/kibana that referenced this pull request Mar 23, 2026
The Python implementation supports globbing and has way longer
instrumentations names.

Refs elastic/elastic-otel-python#510
@xrmx xrmx merged commit 5a2f2cd into main Mar 24, 2026
20 checks passed
xrmx added a commit to elastic/kibana that referenced this pull request Mar 24, 2026
…59003)

## Summary

Make `deactivate_instrumentations`available also to EDOT Python agents.
The Python implementation supports globbing and has way longer
instrumentations names.

Refs elastic/elastic-otel-python#510

<img width="2013" height="743" alt="Schermata del 2026-03-23 09-38-39"
src="https://github.com/user-attachments/assets/7930ee03-4dc7-4f43-bf43-37f926c4f2cf"
/>

The short link resolves to:

<img width="1447" height="540" alt="Schermata del 2026-03-23 09-39-02"
src="https://github.com/user-attachments/assets/25f4621d-23f5-4d7b-a02c-1799c5f440b1"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

<!--Does this PR introduce any risks? For example, consider risks like
hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.-->

No risk introduced

---------

Co-authored-by: kibanamachine <[email protected]>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
…astic#259003)

## Summary

Make `deactivate_instrumentations`available also to EDOT Python agents.
The Python implementation supports globbing and has way longer
instrumentations names.

Refs elastic/elastic-otel-python#510

<img width="2013" height="743" alt="Schermata del 2026-03-23 09-38-39"
src="https://github.com/user-attachments/assets/7930ee03-4dc7-4f43-bf43-37f926c4f2cf"
/>

The short link resolves to:

<img width="1447" height="540" alt="Schermata del 2026-03-23 09-39-02"
src="https://github.com/user-attachments/assets/25f4621d-23f5-4d7b-a02c-1799c5f440b1"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

<!--Does this PR introduce any risks? For example, consider risks like
hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.-->

No risk introduced

---------

Co-authored-by: kibanamachine <[email protected]>
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.

central config: implement deactivate_instrumentations and deactivate_all_instrumentations

2 participants