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 instrumentation pluggable #37

Merged
merged 8 commits into from
Oct 30, 2023
Merged

Make instrumentation pluggable #37

merged 8 commits into from
Oct 30, 2023

Conversation

hynek
Copy link
Owner

@hynek hynek commented Oct 25, 2023

Ref #27

Does this look sufficient for you @jdunck (and everybody else)?

Rendered docs here: https://py-stamina--37.org.readthedocs.build/en/37/instrumentation.html

@hynek hynek force-pushed the pluggable-instrumentation branch 2 times, most recently from 1508417 to 303b423 Compare October 26, 2023 07:15
@jdunck
Copy link

jdunck commented Oct 26, 2023

Does this look sufficient for you @jdunck (and everybody else)?

I appreciate the work, will look at this soon, sorry for the delay.

@hynek
Copy link
Owner Author

hynek commented Oct 27, 2023

Does this look sufficient for you @jdunck (and everybody else)?

I appreciate the work, will look at this soon, sorry for the delay.

Thanks! To be clear: I'm not asking for a code review – just whether it does everything you need. :)

@jdunck
Copy link

jdunck commented Oct 30, 2023

Looks good to me - tomorrow I'll try plugging it into datadog.

One small semantic question -

A hook is a callable, like a function, that takes a single argument: a stamina.instrumentation.RetryDetails object. Its return value is ignored.

It looks like if a hook raises, that will raise out of stamina. Is that intentional/desirable?

@hynek
Copy link
Owner Author

hynek commented Oct 30, 2023

A hook is a callable, like a function, that takes a single argument: a stamina.instrumentation.RetryDetails object. Its return value is ignored.

It looks like if a hook raises, that will raise out of stamina. Is that intentional/desirable?

It is, because it's impossible to revert that user-side. You can always add a with suppress(): but vice versa is not possible. If there's need, we can even ship a @stamina.suppress_and_log_errors decorator or something I guess.

@hynek hynek merged commit c5c3424 into main Oct 30, 2023
38 checks passed
@hynek hynek deleted the pluggable-instrumentation branch October 30, 2023 05:51
@hynek
Copy link
Owner Author

hynek commented Oct 30, 2023

Looks good to me - tomorrow I'll try plugging it into datadog.

LMK when you need a third-party extensions wiki page. ;)

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

Successfully merging this pull request may close these issues.

None yet

2 participants