Open tejaswiniVadlamudi opened 2 years ago
Hi @tejaswiniVadlamudi! The OTel collector validates its config on startup and logs errors, so one could use the otelcorecol/otelcontribcol executable or the respective Docker image directly to validate the config. The ability to validate instrumentation code at compile time would highly depend on the respective language SDK you're interested in. I recommend asking directly in the respective repo or reaching out to SDK maintainers in the CNCF Slack (see https://github.com/open-telemetry/community#discussions). There is no overall validation tool available or planned as far as I'm aware.
@arminru I was after a tool in OTEL that does similar work to Promtool. Not sure how OTEL-specific config files are planned to be handled today at design time.
Moving to the configuration SIG to see if they're interested in providing this
I'd not used promtool before but it looks like it validates stuff in the prometheus server which would correspond to the collector not the SDK configuration.
It looks like it does much more than just validate rules, I just looked quick, but all seemed outside the scope of configuration of the SDK (and instrumentations). The configuration is validated by the jsonschema which each SDK will perform, or use the tool in https://github.com/open-telemetry/opentelemetry-configuration/pull/94 -- but again, not similar to promtool as far as I can tell.
All the 3 data types can be validated at design time using static analysis and also evaluated at run-time. For metrics exposed in Prometheus exposition format, we have Promtool, an official binary part of Prometheus delivery to verify application instrumentation and also validate the configuration of Prometheus deployment. Check out https://github.com/prometheus/prometheus/tree/main/cmd/promtool for inspiration.
Do we have any handy utility to serve the need in OTel?