Skip to content

Allow to exclude some console command by configuration #128

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

Closed
Kaspiman opened this issue Jan 27, 2025 · 2 comments · Fixed by #150
Closed

Allow to exclude some console command by configuration #128

Kaspiman opened this issue Jan 27, 2025 · 2 comments · Fixed by #150

Comments

@Kaspiman
Copy link
Contributor

For example, i don't want to trace infra-commands like: cache:clear or assets:install (https://symfony.com/doc/current/console.html).

So, we will have config like this:

open_telemetry:
  instrumentation:
    console:
      exclude:
        - ^cache:clear$
        - ^assets:install$

Also, similar feature already here #126

Could i do this thing?

@gaelreyrol
Copy link
Contributor

Hi @Kaspiman, you can't do this right now but you could do this the other way around by setting the console instrumentation type to attribute in your configuration, and use the #[Traceable] attribute on the commands you want to trace.

Check out the components tracing instrumentation documentation page.

Still, I would indeed like to implement that kind of configuration when the instrumentation type is set to auto but I aim to implement this type of feature when the alpha pre-release milestone is finished as described in the versioning section of the ReadMe.

@gaelreyrol
Copy link
Contributor

Hi @Kaspiman, you should be able to exclude commands with the next pre-release version, please take a look at the documentation issue #149 to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment