opentelemetry-collector
opentelemetry-collector copied to clipboard
[WIP] Autogenerate config.go files from Pkl schema
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
This PR was marked stale due to lack of activity. It will be closed in 14 days.
Closed as inactive. Feel free to reopen if this PR is still being worked on.