-
Notifications
You must be signed in to change notification settings - Fork 895
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
[metrics] MeterConfig disabled does not follow Collector enabled
convention
#4344
Comments
The fact that boolean environment variables have a default of See this conversation: |
@marcalff Thanks for the link! This is not an environment variable though, I am not sure I see the relation |
We've carried the boolean env var convention into the naming / defaults of component properties. The boolean env var convention is sensible enough, and following it when introducing new component properties (i.e. not env vars) is the path of least resistance for contributors. Another example of following this guidance where the property doesn't have a standard env variable are these prometheus exporter properties:
By this logic, the collector YAML config you reference is unrelated the For example, we carry many of the characteristics of programmatic and env var properties into declarative config, including naming and defaults. |
I guess the point I didn't understand is that we still intend to add environment variables to configure the SDK even when we have the declarative configuration. If that were not the case, then it could make sense to not consider the "env argument". I think this only makes sense to reconsider if:
I suspect (2) is not the case, but could you confirm? |
Isn't the case for the collector that all usages of
|
No, for example these are all enabled by default:
|
For the same reason the OpenTelemetry .NET Automatic Instrumentation has |
my 2c from #2755 (comment):
|
So there are two questions that seem relevant to answer:
From my perspective, having different conventions for different configuration interfaces (env vars vs. programmatic) is a bad design. I'd like to see us consistent (to the extent it makes sense), which here seems to mean either accepting the convention, or re-litigating the discussion. On re-ligating: the environment variable spec doc along with the boolean convention is stable. The specific sentence that we're arguing about uses normative "SHOULD". Coupled with the fact that there are very few env vars which follow this advice, I think there's technically some wiggle room to reverse course.
With that said, I don't think re-litigating this is a good use of time, so I would personally not participate in that discussion (or block any result). |
We are not just building the specification, we are also building the Collector, the Java Agent, the .NET instrumentation... I think based on your argument, any option is a bad design for OpenTelemetry as a whole, since we are bound to have an inconsistency somewhere (be it within the specification or within the wider official OTel ecosystem). |
Any inconsistency is bad design, IMO. But the degree of bad depends on the component. I.e. its more problematic if we're not even be able to maintain consistency between configuration interfaces defined within the spec. Ideally, SIGs which are not explicitly bound to the guidance of the specification reach the conclusion that consistency is important. |
just sharing a data point, I suspect we won't change (and an additional wrinkle is that we have occasionally changed the default for specific instrumentations from enabled to disabled in major version bumps) |
The
MeterConfig
'sdisabled
parameter (introduced in #3877) conflicts with the Collector convention which is to useenabled
(this is not documented, this search shows many places where this is used in the YAML configuration). Usingenabled
should be considered for consistency across the whole project.Another argument against
disabled: false
is that it has a double negative which is harder to parse. IIRC this is the reason we useenabled
instead in the Collector configuration.disabled: false
however is more idiomatic for Go because offalse
being the zero value of booleans.cc @jack-berg @codeboten
The text was updated successfully, but these errors were encountered: