Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/srikanthccv/otelcol-jsonschema
[JSON Schema](https://json-schema.org/) for the OTEL Collector YAML configuration file.
https://github.com/srikanthccv/otelcol-jsonschema
jsonschema opentelemetry opentelemetry-collector
Last synced: 2 months ago
JSON representation
[JSON Schema](https://json-schema.org/) for the OTEL Collector YAML configuration file.
- Host: GitHub
- URL: https://github.com/srikanthccv/otelcol-jsonschema
- Owner: srikanthccv
- License: apache-2.0
- Created: 2022-04-28T01:50:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-23T13:20:05.000Z (about 1 year ago)
- Last Synced: 2024-10-05T21:21:40.883Z (3 months ago)
- Topics: jsonschema, opentelemetry, opentelemetry-collector
- Language: Go
- Homepage:
- Size: 693 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
_There is a [proposal](https://docs.google.com/document/d/15SMsJAdE1BHAmwf8cLXBvsHDrezXOHniaRZafjO-5e4/edit) and work-in-progress PR for generating the component config from the YAML or JSON Schema [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/27003). I am not working on perfecting this, but it was a fun and good learning experience_
# OpenTelemetry Collector JSON Schema
This repository contains the [JSON Schema](https://json-schema.org/) for the OTEL Collector YAML configuration file.
## Why
- See the status, supported distributions and overview documentation of the component without leaving your editor.
- Get auto-completion and validation of the configuration file.
- And all other benefits of using a JSON Schema.## Demo
https://github.com/srikanthccv/otelcol-jsonschema/assets/22846633/f4150323-e588-4760-85da-88fb8d04b37d
## Usage
The schema is available at https://raw.githubusercontent.com/srikanthccv/otelcol-jsonschema/main/schema.json. Many popular editors and IDEs support YAML validation against a JSON Schema. For example, in VS Code, you can add the following to your `settings.json`:
```json
"yaml.schemas": {
"https://raw.githubusercontent.com/srikanthccv/otelcol-jsonschema/main/schema.json": "otel-collector-config.yaml"
}
```See https://github.com/redhat-developer/yaml-language-server#clients for other choices.
## TODO
- [ ] Autogenerate the /components/...
- [ ] null or reference for the "type" field using "oneOf"
- [ ] Support various distributions of the collector
- [ ] Improve the validation of "service"
- [ ] Workaround for tricky components [filelog, hostmetrics, etc...]Any contributions are welcome. Please open an issue or a pull request.
## Credits
To authors of https://github.com/invopop/jsonschema, which is modified to make it work with the OTEL Collector Config types.