Replies: 4 comments 7 replies
-
I am in favor of B, here is why. These are the problems I see with A:
This is the problem I see with C:
Now, I think the common argument against B is that it requires the user to set an environment variable to be able to select the distro if there is more than one distro installed and there is the intention that distros require no further user interaction. I think having to use some mechanism to select the distro when there is more than one available is inevitable. As such, we should just use the standard way of doing so by setting an environment variable. |
Beta Was this translation helpful? Give feedback.
-
Solution B is proposed in #1966. |
Beta Was this translation helpful? Give feedback.
-
I still think we are mixing up two different problems here. Users installing multiple distrosIs there an actual use case that requires end-users to install multiple distros? If so, we should open a feature request for that and discuss if and how we want to enable such a use case. I can't think of any reason why someone would want to install multiple distros but intend to use only one. So far we do not support having multiple distros installed. If users do it, they'll observe undefined behaviour. We should improve this by raising an exception instead when more than one distros are found so users don't get tripped by silent behaviour changes and instead have a deterministic outcome (failure). In a nutshell, this is not supported today and I don't see any real-world scenario where we'd need to support this. We should explicitly call this out in docs and make the instrument command fail-fast in such cases. Sharing common code between distrosThis is probably worth solving but not at the cost of complicating the end-user experience. DRY is good but it has to stop if following DRY results in end-users having to learn, configure and deal with unnecessary stuff. I personally would just copy all this code to every distro and let it live there. It's not like a complex algorithm that needs to work everything exactly the same way. If a distro author copies code to configure a tracer provider, processor and exporter, I doubt it'll need changes/fixes if something changes in the default distro. If things work in Vendor A's distro, they have no real need to keep updating the distro code to match the default distro. It's just glue/config code mostly and does not benefit too much from DRY. If we still wanted to follow DRY for distros, the solution is actually pretty simple. Just move the code as reusable functions to a common package that all distros can import and use. This solves the problem completely in practice. As a result distros by convention would only host very vendor-specific code and it wouldn't even make sense to subclass them. However, if we really wanted to make distros extensible in order to build other distros, I think something like solution C would enable all such use cases without letting the problem "bleed" into the userspace and force the user to learn yet another concept. |
Beta Was this translation helpful? Give feedback.
-
I think @owais argument for using priorities to determine which distro is to be used is motivated by an intention of not requiring the user to make any further changes (like setting an environment variable) after the desired distro is installed. Please correct me if I am wrong in my understanding, @owais. I also understand that the priority system suggested above by @owais attempts to allow the reuse of distro code by other distros. I fundamentally agree with the intention of not requiring further user input after a distro is installed. I also fundamentally agree with the reuse of distro code by other distros. We have been working towards a solution that makes it easy for our users to use OpenTelemetry Python, with the goal being a single action that provides a code-ready environment for instrumentation. What I fundamentally disagree is with making this or any other solution a component that is coupled with spec-defined components. In my opinion, making the experience easy for our users is a goal in itself, separate from spec compliance and must be completely decoupled from the SDK, API, instrumentation, etc. There are many ways in which we can make the experience of using OpenTelemetry Python easier, I can even imagine something like this:
an hypothetical package that installs an Distros are just a tool to make things easier for our users, another in many different tools that we can create for the same purpose. A major part of the discussion above revolves around the actual implementation of distros. I think we need to take a step back first and make a decision regarding if and how will we make the separation between convenience tools like distro and the spec-defined components. Here is my position regarding the if and the how:
The entry point approach linked above provides the user with hooks for doing anything before and after instrumentation happens. In this way distros become just another tool that uses one of these hooks that we provide along with the rest of the spec-defined project for our user convenience and can be used or not by the user. I care much more about the separation between convenience tools from the spec-defined components than with the actual implementation of such tools. |
Beta Was this translation helpful? Give feedback.
-
So far we have several ideas on what to do with distros. They have been discussed in several PRs and issues, so as agreed in the latest SIG, they will be all gathered here.
Right now we automatically select the first distro that is found in the respective entry point list. This is a problem because it is not possible to know which distro will be selected.
A. Force the user to have only one distro installed
B. Define which distro will be used by using environment variables
C. Define a priority system
Beta Was this translation helpful? Give feedback.
All reactions