You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, let me thank you for such a great piece of software, it's really a fun library to work with.
In this issue, I want to talk about the use case where I want the ability to add logging and telemetry to every single tesla request in my application.
As a user of libraries that depend on tesla (1), or libraries that depend on other libraries that depend on tesla (2), it's cumbersome if not impossible to customize middleware.
In this example, we want to configure all Tesla clients with a Logger and Telemetry middleware so we can instrument our application both in development as well as in production.
In the first (1) example, we can look at elixir-google-api, where to customize middleware we have to create our client as seen below. It's a bit cumbersome but doable.
In the second (2) example, if we look into waffle and waffle_gcs which uses elixir-google-api we are completely unable to configure the tesla client (unless I'm missing something).
An argument could be made that library authors need to change their libraries to support configuring of the tesla client, which what I think @josevalim is trying to get to in googleapis/elixir-google-api#98. In that case, there should be more/better documentation around it.
Even in that scenario that some/many library authors allow the end-user to configure the tesla client, there would still be some that don't which invalidate the original use case - the ability to log and instrument every tesla client.
One solution that comes to mind is global and per client middleware configuration as envisioned in #167 and #403.
Any thoughts as to how we could solve for the original use-case?
The text was updated successfully, but these errors were encountered:
All things considered I think this would be a good opt-in feature. We'd need to think of all the corner cases, like e.g. what happens when you put Telemetry into global middlewares but there is one already defined locally etc, but I still think it's worth pursuing.
First of all, let me thank you for such a great piece of software, it's really a fun library to work with.
In this issue, I want to talk about the use case where I want the ability to add logging and telemetry to every single tesla request in my application.
As a user of libraries that depend on tesla (1), or libraries that depend on other libraries that depend on tesla (2), it's cumbersome if not impossible to customize middleware.
In this example, we want to configure all Tesla clients with a Logger and Telemetry middleware so we can instrument our application both in development as well as in production.
In the first (1) example, we can look at elixir-google-api, where to customize middleware we have to create our client as seen below. It's a bit cumbersome but doable.
In the second (2) example, if we look into waffle and waffle_gcs which uses
elixir-google-api
we are completely unable to configure the tesla client (unless I'm missing something).An argument could be made that library authors need to change their libraries to support configuring of the tesla client, which what I think @josevalim is trying to get to in googleapis/elixir-google-api#98. In that case, there should be more/better documentation around it.
Even in that scenario that some/many library authors allow the end-user to configure the tesla client, there would still be some that don't which invalidate the original use case - the ability to log and instrument every tesla client.
One solution that comes to mind is global and per client middleware configuration as envisioned in #167 and #403.
Any thoughts as to how we could solve for the original use-case?
The text was updated successfully, but these errors were encountered: