Skip to content

transform data before logging #33

Open
@edublancas

Description

@edublancas

There are cases where we want to log input parameters but we need to process them before logging them. This happens when they might contain sensitive information. For example, in ploomber-engine, users can pass arbitrary parameters to a notebook. However, the values might contain sensitive data, so we only want to log the parameters' keys.

We can add something like this:

@telemetry.log_call(log_args=True, preprocessors={"parameters": lambda params: list(parameters)})
def do_stuff(parameters):
    pass

Then, when calling:

do_stuff(parameters={"key": "value", "key_another": "value_another"})

We log: ["key", "key_another"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions