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

Make it possible to have some namespaces to NOT be processed by default #363

Open
pellared opened this issue Sep 12, 2024 · 3 comments
Open

Comments

@pellared
Copy link
Member

Maybe it would be good to have some namespaces that by default are not processed (like signalr, aspnetcore, etc).
They would need to be added explicitly in the config.

CC @jsuereth

@lquerel
Copy link
Contributor

lquerel commented Sep 12, 2024

If I understand your request correctly, this is already supported. You can refer to the following example: https://github.com/jsuereth/semantic-conventions-java/blob/475a041a92dfc8cb5ea618456d8d4e992b1c273d/buildscripts/templates/registry/java/weaver.yaml

The params section allows you to define parameters like excluded_namespaces, and the predefined JQ filters already account for them. If you’d like to define additional conditions or filters, the system is usually flexible enough to support them without requiring changes to Weaver’s code.

Let me know if you had something different in mind. Thanks!

@pellared
Copy link
Member Author

pellared commented Sep 12, 2024

I propose to add included_namespaces and have it possible to mark namespaces to be excluded by default.
It would be easier if technology-specific namespaces were included explicitly.

@lquerel
Copy link
Contributor

lquerel commented Sep 12, 2024

To mark namespaces to be excluded by default, we could either add a default weaver.yaml configuration in the defaults directory, which is already present in the Weaver repo, or provide a default weaver.yaml file containing the namespaces to exclude. Users could place this file either in their ~/.weaver/ directory or in the parent directory of the one containing the templates. The Weaver configuration will automatically merge based on the rules described here.

Currently, the configuration overriding process does not support removing items from a list, but this feature could be added. For instance, let’s say you have the following declaration in the parent directory of your templates:

# weaver.yaml in parent directory or ~/.weaver/
params:
  excluded_namespace:
    - ios
    - signalr
    - aspnetcore
    - ... 

What you're asking for could be implemented with a "negative" override (a feature not yet supported) as follows:

# weaver.yaml in template directory
params:
  excluded_namespace$remove:
    - signalr

This would remove the signalr namespace from the excluded list.

Alternatively, another approach could be to use a different parameter and implement more complex logic in the JQ filters.

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

No branches or pull requests

2 participants