Remove with_ prefix from prometheus exporter property names#612
Conversation
marcalff
left a comment
There was a problem hiding this comment.
Looks much better without double negations removing the without_ prefix.
A few questions:
-
why still draft, looks ready for review
-
why a boolean property foo_enabled, as opposed to just foo.
I am sure this has been discussed elsewhere, but can not find the reference.
resource_constant_labels is not named resource_constant_labels_enabled, so this looks inconsistent.
I would prefer just scope_info, target_info and resource_constant_labels, unless there is a good reason for the enabled suffix.
No reason for it to be a draft but it shouldn't be merged before corresponding spec PR (link in description).
I'm not sure this has been discussed actually - at least not in the context of the declarative config schema. There has been discussion at the spec level. Currently, the spec guidance for for env vars was to included either The original issue for that PR discusses prior art in the java agent and collector standardizing on So IMO, the realistic options for us in declarative config are:
I will say that names like
|
|
FYI, the upstream spec PR has been merged: open-telemetry/opentelemetry-specification#5071 We could re-open the conversation at the spec level, or adopt a stance in declarative config schema that we generally omit But the simpler approach is just to follow the naming of the upstream spec, which is what I advocate for. |
Here, I change: * without_scope_info -> scope_info_enabled (default true) * without_target_info -> target_info_enabled (default true) * with_resource_constant_labels -> resource_constant_labels (default none are added) The `with` prefix of a few (but not all) prometheus exporter options seems to be a carry over from go functional options pattern. We don't see it in the spec'd property names of any other built in components. It doesn't doesn't contribute to the property's meaning in any way. Omitting it doesn't block a language from using it in their implementation, since that choice falls within maintainer discretion. I think the use of "without" without_scope_info / without_target_info with a default value of false was probably inspired by the "All Boolean environment variables SHOULD be named and defined such that false is the expected safe default behavior." language that we decided is not applicable to other configuration interfaces: open-telemetry#4723 So since there's no env vars for without_scope_info / without_target_info, we don't need to be constrained by that. Originated from: open-telemetry#5056 (comment) Corresponding change in declarative config schema: github.com/open-telemetry/opentelemetry-configuration/pull/612
See open-telemetry/opentelemetry-specification#5056 (review)
without_scope_info->scope_info_enabled(default true)without_target_info/development->target_info_enabled/development(default true)with_resource_constant_labels->resource_constant_labels(default none are added)Corresponding spec PR was merged: open-telemetry/opentelemetry-specification#5071