config

package
v0.1.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// PrometheusURL is the URL of the Prometheus/Thanos Querier endpoint.
	// This field is required. Example: "https://thanos-querier-openshift-monitoring.apps.example.com"
	PrometheusURL string `toml:"prometheus_url,omitempty"`

	// AlertmanagerURL is the URL of the Alertmanager endpoint.
	// This field is optional. Example: "https://alertmanager-main-openshift-monitoring.apps.example.com"
	AlertmanagerURL string `toml:"alertmanager_url,omitempty"`

	// Insecure controls whether to skip TLS certificate verification.
	// Default: false (verify certificates)
	Insecure bool `toml:"insecure,omitempty"`

	// Guardrails controls which query safety checks are enabled.
	// Valid values: "all" (default), "none", or comma-separated list of:
	//   - "disallow-explicit-name-label"
	//   - "require-label-matcher"
	//   - "disallow-blanket-regex"
	Guardrails string `toml:"guardrails,omitempty"`

	// MaxMetricCardinality is the maximum allowed series count per metric.
	// Set to 0 to disable this check.
	// Default: 20000
	MaxMetricCardinality uint64 `toml:"max_metric_cardinality,omitempty"`

	// MaxLabelCardinality is the maximum allowed label value count for blanket regex.
	// Only takes effect if disallow-blanket-regex is enabled.
	// Set to 0 to always disallow blanket regex.
	// Default: 500
	MaxLabelCardinality uint64 `toml:"max_label_cardinality,omitempty"`

	// RangeQueryFullResponse controls whether range queries return full data points
	// instead of summary statistics.
	// Default: false (return summary statistics)
	RangeQueryFullResponse bool `toml:"range_query_full_response,omitempty"`
}

Config holds obs-mcp toolset configuration

func (*Config) GetGuardrails

func (c *Config) GetGuardrails() (*prometheus.Guardrails, error)

GetGuardrails returns the parsed guardrails configuration with cardinality limits applied.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that the configuration values are valid.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL