Skip to content

Commit

Permalink
Adjust and debug wrong levelled flags in docs generator, use a workar…
Browse files Browse the repository at this point in the history
…ound by double suppressing docs
  • Loading branch information
alexweav committed Mar 5, 2025
1 parent 5948836 commit 398822f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -4988,10 +4988,9 @@
"kind": "field",
"name": "alertmanager_url",
"required": false,
"desc": "Per-tenant alertmanager client configuration. If not supplied, the tenant's notifications will be sent to the ruler-wide default.",
"desc": "",
"fieldValue": null,
"fieldDefaultValue": "{\"AlertmanagerURL\":\"\",\"NotifierConfig\":{\"TLSEnabled\":false,\"TLS\":{\"CertPath\":\"\",\"KeyPath\":\"\",\"CAPath\":\"\",\"ServerName\":\"\",\"InsecureSkipVerify\":false,\"CipherSuites\":\"\",\"MinVersion\":\"\",\"Reader\":null},\"BasicAuth\":{\"Username\":\"\",\"Password\":{}},\"OAuth2\":{\"ClientID\":\"\",\"ClientSecret\":{},\"TokenURL\":\"\",\"Scopes\":null,\"EndpointParams\":{}},\"ProxyURL\":\"\"}}",
"fieldFlag": "ruler.alertmanager-client-config",
"fieldDefaultValue": "",
"fieldType": "string"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3885,11 +3885,10 @@ The `limits` block configures default and per-tenant limits imposed by component
# CLI flag: -ruler.max-independent-rule-evaluation-concurrency-per-tenant
[ruler_max_independent_rule_evaluation_concurrency_per_tenant: <int> | default = 4]

# Per-tenant alertmanager client configuration. If not supplied, the tenant's
# notifications will be sent to the ruler-wide default.
ruler_alertmanager_client_config:
# Per-tenant alertmanager client configuration. If not supplied, the tenant's
# notifications will be sent to the ruler-wide default.
# CLI flag: -ruler.alertmanager-client-config
[alertmanager_url: <string> | default = "{\"AlertmanagerURL\":\"\",\"NotifierConfig\":{\"TLSEnabled\":false,\"TLS\":{\"CertPath\":\"\",\"KeyPath\":\"\",\"CAPath\":\"\",\"ServerName\":\"\",\"InsecureSkipVerify\":false,\"CipherSuites\":\"\",\"MinVersion\":\"\",\"Reader\":null},\"BasicAuth\":{\"Username\":\"\",\"Password\":{}},\"OAuth2\":{\"ClientID\":\"\",\"ClientSecret\":{},\"TokenURL\":\"\",\"Scopes\":null,\"EndpointParams\":{}},\"ProxyURL\":\"\"}}"]
[alertmanager_url: <string> | default = ""]

# (advanced)
[tls_enabled: <boolean> | default = ]
Expand Down
2 changes: 1 addition & 1 deletion pkg/ruler/notifier/notifier_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var DefaultAlertmanagerClientConfig = AlertmanagerClientConfig{
}

type AlertmanagerClientConfig struct {
AlertmanagerURL string `yaml:"alertmanager_url"`
AlertmanagerURL string `yaml:"alertmanager_url" doc:"nocli"`
NotifierConfig Config `yaml:",inline" json:",inline"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/validation/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ type Limits struct {
RulerMaxRuleGroupsPerTenantByNamespace flagext.LimitsMap[int] `yaml:"ruler_max_rule_groups_per_tenant_by_namespace" json:"ruler_max_rule_groups_per_tenant_by_namespace" category:"experimental"`
RulerProtectedNamespaces flagext.StringSliceCSV `yaml:"ruler_protected_namespaces" json:"ruler_protected_namespaces" category:"experimental"`
RulerMaxIndependentRuleEvaluationConcurrencyPerTenant int64 `yaml:"ruler_max_independent_rule_evaluation_concurrency_per_tenant" json:"ruler_max_independent_rule_evaluation_concurrency_per_tenant" category:"experimental"`
RulerAlertmanagerClientConfig notifier.AlertmanagerClientConfig `yaml:"ruler_alertmanager_client_config" json:"ruler_alertmanager_client_config" category:"experimental"`
RulerAlertmanagerClientConfig notifier.AlertmanagerClientConfig `yaml:"ruler_alertmanager_client_config" json:"ruler_alertmanager_client_config" category:"experimental" doc:"nocli|description=Per-tenant alertmanager client configuration. If not supplied, the tenant's notifications will be sent to the ruler-wide default."`

// Store-gateway.
StoreGatewayTenantShardSize int `yaml:"store_gateway_tenant_shard_size" json:"store_gateway_tenant_shard_size"`
Expand Down
3 changes: 3 additions & 0 deletions tools/doc-generator/parse/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/thanos-io/objstore/providers/s3"

asmodel "github.com/grafana/mimir/pkg/ingester/activeseries/model"
"github.com/grafana/mimir/pkg/ruler/notifier"
"github.com/grafana/mimir/pkg/storage/tsdb"
"github.com/grafana/mimir/pkg/util/configdoc"
"github.com/grafana/mimir/pkg/util/validation"
Expand Down Expand Up @@ -494,6 +495,8 @@ func ReflectType(typ string) reflect.Type {
return reflect.TypeOf([]*validation.BlockedQuery{})
case "blocked_requests_config...":
return reflect.TypeOf([]*validation.BlockedRequest{})
case "ruler_alertmanager_client_config...":
return reflect.TypeOf(notifier.AlertmanagerClientConfig{})
case "map of string to float64":
return reflect.TypeOf(flagext.LimitsMap[float64]{})
case "map of string to int":
Expand Down

0 comments on commit 398822f

Please sign in to comment.