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

Allow renaming keys added by CallsiteParameterAdder #553

Open
Cnoor0171 opened this issue Sep 14, 2023 · 1 comment
Open

Allow renaming keys added by CallsiteParameterAdder #553

Cnoor0171 opened this issue Sep 14, 2023 · 1 comment

Comments

@Cnoor0171
Copy link

Currently, CallsiteParameterAdder always adds each parameter under a predetermined key. It would be nice if the user can specify an alternate key for each parameter instead.

A pretty simple to implement and fully backwards compatible way would be to change the init method from

    def __init__(
        self,
        parameters: Collection[CallsiteParameter] = _all_parameters,
        additional_ignores: list[str] | None = None,
    ) -> None:

to

    def __init__(
        self,
        parameters: Collection[CallsiteParameter] | Mapping[str, CallsiteParameter] = _all_parameters,
        additional_ignores: list[str] | None = None,
    ) -> None:

The user can then instantiate the processor as

CallsiteParameterAdder({"tid": allsiteParameter.THREAD, "pid": allsiteParameter.PROCESS})
@dhirschfeld
Copy link

This would be handy. My use-case is conforming to the field names expected by Elastic:

My (planned) workaround is to have a renaming processor to do a final mapping of names to the ECS equivalents.

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

No branches or pull requests

3 participants