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

Fix prometheus_exporter to method patching compatible with open telemetry #304

Merged
merged 2 commits into from
Jul 4, 2023

Conversation

theseanything
Copy link
Contributor

@theseanything theseanything commented Jul 4, 2023

This switches prometheus_exporter's method patching to use prepend instead of alias_method. Prepend is negligibly slower than alias_method, but is more compatible other libraries.

https://github.com/discourse/prometheus_exporter#choosing-the-style-of-method-patching

https://samsaffron.com/archive/2017/10/18/fastest-way-to-profile-a-method-in-ruby#fastest-way-to-patch-a-method-3

The issues with alias method cause a recursive call between prometheus_exporter and open telemetry sdk when making calls to SQL and redis.

…entation

This switches prometheus_exporter's method patching to use `prepend`
instead of `alias_method`. Prepend is negligibly slower than
alias_method, but is more compatible other libraries.
@theseanything theseanything changed the title Fix recursive call with prometheus_exporter and opentelemetry Fix prometheus_exporter to method patching compatible with open telemetry Jul 4, 2023
@theseanything theseanything merged commit 98b439e into main Jul 4, 2023
5 checks passed
@theseanything theseanything deleted the add-open-telemetry branch July 4, 2023 09:29
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.

2 participants