opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[WIP] Autogenerate config.go files from Pkl schema

Open ptodev opened this issue 1 year ago • 1 comments

Description

This is a WIP PR to explore schematising the Collector's config through the Pkl language. Each processor/exporter/receiver/connector would have to have a .pkl file instead of a config.go. The config.go will be automatically generated via the pkl-gen-go command line utility.

The advantages of using Pkl are:

  • Schema can be automatically created from Pkl files. The example in this PR generates an OpenAPI v3 schema.
  • It is possible to use all sorts of types, including nullable ones.
  • There is built-in validation of the configuration parameters via type constraints.

We could also build a utility to generate documentation markdown from the OpenAPI schema. This would improve the quality and consistency of the Collector documentation.

If you believe that this approach has a potential, I would be happy to continue working on it. I would also be happy to collaborate with others who are interested in it :)

Link to tracking issue

Fixes #9769

ptodev avatar Jun 10 '24 18:06 ptodev

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

github-actions[bot] avatar Jun 25 '24 03:06 github-actions[bot]

Closed as inactive. Feel free to reopen if this PR is still being worked on.

github-actions[bot] avatar Jul 09 '24 03:07 github-actions[bot]