Skip to content

Conversation

@mx-psi
Copy link
Member

@mx-psi mx-psi commented Nov 5, 2025

Updates #4344

Changes

Clarifies that environment variable guidance regarding boolean values is not applicable to other configuration interfaces. This does not explicitly state what the guidance should be in other cases.

…uidance is not applicable to other configuration interfaces
@mx-psi mx-psi force-pushed the mx-psi/not-applicable branch from a7872e5 to 2e2811e Compare November 5, 2025 13:08
Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the intent of the change, but it seems like it will create more confusion to me, as it implies (but doesn't specify) that the rest of the document applies to declarative configuration. I would prefer splitting the env var spec into a "common" config spec (excluding the boolean spec), and the env var spec with the current bool spec + anything else that only applies to env vars.

@mx-psi
Copy link
Member Author

mx-psi commented Nov 6, 2025

Makes sense, I will wait for a few more days and apply the suggested change if there is no dissent :)

github-merge-queue bot pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Nov 7, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number if applicable -->

Marks `configoptional.AddEnabledField` as beta. I have verified that it
would work correctly for cookies configuration and made a PoC for
keepalives (I will push a PR for it after this PR has been merged).

I spent some time updating
open-telemetry/opentelemetry-specification/issues/4344 and filed
open-telemetry/opentelemetry-specification/pull/4723 as a way to
explicitly state that the guidance only applies to environment
variables. The issue remains unresolved, but given the current usages of
`enabled` (see
open-telemetry/opentelemetry-specification#4344 (comment))
I don't see a reason to not go forward with this.

#### Link to tracking issue
Updates #14021
@mx-psi
Copy link
Member Author

mx-psi commented Nov 14, 2025

I agree with the intent of the change, but it seems like it will create more confusion to me, as it implies (but doesn't specify) that the rest of the document applies to declarative configuration. I would prefer splitting the env var spec into a "common" config spec (excluding the boolean spec), and the env var spec with the current bool spec + anything else that only applies to env vars.

@dashpole I pushed an attempt to split the guidance:

  1. I renamed "configuration type" to " Type-specific guidance"
  2. I moved type-specific guidance that is not applicable to env variables into a new common.md document. I kept in the SDK env variables one:
  • The guidance about boolean variables
  • The guidance about fail to parse for numeric variables (I assume failure to parse is going to lead to an error and not a warning in implementations since it will be handled by the JSON/YAML parsing library)

Other parts of the spec were using these sections as "here are the type definitions" and now the links for "type definitions" are split among two documents. We were never too consistent with this, so I feel like it is okay to do this

@mx-psi mx-psi requested a review from trask November 25, 2025 10:28
@trask
Copy link
Member

trask commented Nov 25, 2025

cc @open-telemetry/configuration-approvers

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple small comments but I agree with the direction 👍

The goal of this specification is to describe common guidance that is applicable
to all OpenTelemetry SDK configuration sources.

Implementations MAY choose to allow configuration via any source in this specification, but are not required to.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"via any source in this specification" What does this refer to? The other configuration interfaces?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that this sentence was adapted from the env var spec:

Implementations MAY choose to allow configuration via the environment variables in this specification, but are not required to. If they do, they SHOULD use the names listed in this document.

In which case, "source" refers to a data type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any 'configuration source' was the intended meaning. Do you have suggestions on how to reword this to make it clearer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added 'configuration' to that sentence let me know if that is clearer


#### Enum

Enum values SHOULD be interpreted in a case-insensitive manner.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not be possible in declarative config. In JSON schema, an enum type is specified as part of the schema (for example). The validation of a config file's adherence to the schema is often done with 3rd party JSON schema tools, and since there is no way to specify a case-insensitive enum in JSON schema, there's (likely) no way for the 3rd party JSON schema tools to ignore case.

Case insensitive enums are also problematic for the programmatic config interface.

Consider moving this back to the env var specific section.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I also move the sentence that says:

When reporting configuration errors, implementations SHOULD display the original
user-provided value to aid debugging.

It seems to be there only because of the case in-sensitiveness and I think it is hard to apply in all contexts (does it mean that if I set a: "foo" I should get a different message than when I set a: 'foo' or a: !!str foo?)

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.

7 participants