Skip to content

[chore] Add implementation details to Component Configuration Management RFC - #14486

Merged
mx-psi merged 14 commits into
open-telemetry:mainfrom
jkoronaAtCisco:extend_schemas_rfc
Jun 9, 2026
Merged

[chore] Add implementation details to Component Configuration Management RFC#14486
mx-psi merged 14 commits into
open-telemetry:mainfrom
jkoronaAtCisco:extend_schemas_rfc

Conversation

@jkoronaAtCisco

@jkoronaAtCisco jkoronaAtCisco commented Jan 27, 2026

Copy link
Copy Markdown
Member

Description

Added implementation details and examples to RFC document

Changes were announced on #otel-collector-dev slack channel.

Link to tracking issue

Extends #14433

@codecov

codecov Bot commented Jan 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.27%. Comparing base (9a8be05) to head (9afeca0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14486   +/-   ##
=======================================
  Coverage   91.27%   91.27%           
=======================================
  Files         709      709           
  Lines       46224    46224           
=======================================
  Hits        42192    42192           
  Misses       2817     2817           
  Partials     1215     1215           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docs/rfcs/component-configuration-schema-roadmap.md Outdated
Comment thread docs/rfcs/component-configuration-schema-roadmap.md Outdated
Comment thread docs/rfcs/component-configuration-schema-roadmap.md
Comment thread docs/rfcs/component-configuration-schema-roadmap.md Outdated
Comment thread docs/rfcs/component-configuration-schema-roadmap.md Outdated
Added descriptions for configuration schema properties and clarified generated code for custom fields.
Change the handling of referenced schemas in JSON Schema.
@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Feb 28, 2026
@dmitryax dmitryax removed the Stale label Mar 4, 2026
@dmitryax

dmitryax commented Mar 4, 2026

Copy link
Copy Markdown
Member

@open-telemetry/collector-approvers PTAL. I guess we need more approvals before merging RFC amendments

@mx-psi

mx-psi commented Mar 4, 2026

Copy link
Copy Markdown
Member

Can you add to the PR description how you have fulfilled the requirements regarding announcing this RFC/RFC Amendment?

@codspeed-hq

This comment was marked as outdated.

in a single JSON Schema file.
- Each referenced schema will be embedded inline.
- The `$id` field will be set to the component's import path for easy identification.
- The custom types will be represented as `any` type in JSON Schema.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about having a way to provide schemas for custom types?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You can still do it. Let's say that you wan to use external type github.com/foo.bar in your config. Then you can do that in your metadata.yaml config:

config:
  type: object
  properties:
    bar:
      go:
         type: github.com/foo.bar
      type: object
      properties:
          x:
             type: integer
          y:
             type: integer

That would generate json schema like:

{
    "type": "object",
    "properties": {
        "bar": {
            "type": "object",
            "properties": {
                "x": {
                    "type": "integer"
                },
                "y": {
                    "type": "integer"
                }
            }
        }
    }
}

But generated go struct would be:

import "github.com/foo.bar"

struct Config {
    bar: foo.Bar `mapstructure:"bar"`
}


**Objective**: Use OCB to bind all components schemas to single schema that describes entire collector config file

**Success Criteria:**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A global $id is needed too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't quite understand this requirement. Can you elaborate?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes. Each component has a $id field.
For the global schema, we need a "global" $id property too. That is needed to differentiate between 2 schema files.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For each component json schema we're going to create $id using following pattern:

<namespace>/<path>/<component_name>

for example: go.opentelemetry.io/collector/cmd/mdatagen/internal/samplescraper

For global id we can use just namespace, e.g. go.opentelemetry.io/collector. What do you think?

}
```

#### Generated JSON Schema details

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some components have an alias now because their old names are deprecated. I think we should support validating with the aliases for the time they are there. So, they need to be added to the schemas.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not familiar with this problem. Can you provide some examples?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can find the full context here open-telemetry/opentelemetry-collector-contrib#45339

}
```

#### Generated JSON Schema details

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We also need to make duration/custom-type validation portable across validators

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Mdatagen would add pattern validator automatically to those fields.

@mx-psi
mx-psi requested a review from iblancasa April 6, 2026 12:13
@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added Stale and removed Stale labels Apr 23, 2026
@mx-psi mx-psi added the rfc:approvals-needed This RFC needs approvals from collector-approvers label May 8, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label May 25, 2026
@mx-psi mx-psi added rfc:final-comment-period This RFC is in the final comment period phase and removed Stale rfc:approvals-needed This RFC needs approvals from collector-approvers labels May 27, 2026
@mx-psi

mx-psi commented May 27, 2026

Copy link
Copy Markdown
Member

This is entering final comment period and will be merged on or after June 2nd if it fulfills all criteria for merging.

@jkoronaAtCisco
So that we can merge this, please ensure that:

  1. All conversations are resolved
  2. You add to the PR description on what Collector SIG meetings this was discussed and when was this shared on #otel-collector-dev

@mx-psi

mx-psi commented May 27, 2026

Copy link
Copy Markdown
Member

We also need to make CI pass to be able to merge this

@mx-psi
mx-psi added this pull request to the merge queue Jun 9, 2026
Merged via the queue into open-telemetry:main with commit 8e000d6 Jun 9, 2026
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfc:final-comment-period This RFC is in the final comment period phase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants