argoproj-labs / argocd-extension-metrics

An Argo CD extension to enable visualization of metrics in Argo CD UI.
Apache License 2.0
111 stars 25 forks source link

Publish/Validate the jsonschema for the config.json #56

Open leoluz opened 10 months ago

leoluz commented 10 months ago

The metrics extension depends on a complex json object that should be added as a string field named as config.json in the configmap argocd-metrics-server-configmap. As today the expected json format isn't documented anywhere, it makes it hard for users to craft it correctly.

As part of this issue, we should publish the jsonschema based on the json struct defined in the Go code:

type O11yConfig struct {
    Prometheus *MetricsConfigProvider `json:"prometheus"`
    Wavefront  *MetricsConfigProvider `json:"wavefront"`
}

The same published jsonschema should be used to validate the config.json in the configmap during application bootstrap.

Suggested library that could be used to generate the jsonschema: