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

Central place to configure custom instrumentation #1963

Closed
antonpirker opened this issue Mar 17, 2023 · 1 comment · Fixed by #1960
Closed

Central place to configure custom instrumentation #1963

antonpirker opened this issue Mar 17, 2023 · 1 comment · Fixed by #1960
Assignees
Labels
Enhancement New feature or request

Comments

@antonpirker
Copy link
Member

antonpirker commented Mar 17, 2023

Problem Statement

Having to put decorators all over the code base to monitor their performance can be cumbersome.
A single place to set up custom instrumentation would be nice.

Solution Brainstorm

Have a list of functions that can be passed to "sentry_sdk.init()".
When the SDK starts it goes through the list and instruments all the functions in the list.

Something like this:

functions_to_trace = [
    {"qualified_name": "tests.test_basics._hello_world_counter"},
    {"qualified_name": "time.sleep"},
    {"qualified_name": "collections.Counter.most_common"},
]

sentry_sdk.init(
    dsn="...",
    traces_sample_rate=1.0,
    functions_to_trace=functions_to_trace,
)

This way you have one place to look what functions in your code base are custom instrumented.

@antonpirker
Copy link
Member Author

@sl0thentr0py please add your thoughts about this being a possible attack vector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant