open-telemetry / opentelemetry-configuration

JSON Schema definitions for OpenTelemetry file configuration
Apache License 2.0
41 stars 17 forks source link

Are there any plans to create a tool for checking deployment configuration and instrumentation patterns? #101

Open tejaswiniVadlamudi opened 2 years ago

tejaswiniVadlamudi commented 2 years ago

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?

arminru commented 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.

tejaswiniVadlamudi commented 1 year ago

@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.

mtwo commented 4 months ago

Moving to the configuration SIG to see if they're interested in providing this

tsloughter commented 4 months ago

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.