Documentation ¶
Index ¶
- Constants
- type ConfigSyncMetrics
- func (csm ConfigSyncMetrics) ValidateDeclaredResources(reconciler string, value int) error
- func (csm ConfigSyncMetrics) ValidateErrorMetrics(reconciler string) error
- func (csm ConfigSyncMetrics) ValidateGVKMetrics(reconciler string, gvkMetric GVKMetric) error
- func (csm ConfigSyncMetrics) ValidateGitSyncDepthOverrideCount(count int) error
- func (csm ConfigSyncMetrics) ValidateMetricsCommitApplied(commitHash string) error
- func (csm ConfigSyncMetrics) ValidateNoSSLVerifyCount(count int) error
- func (csm ConfigSyncMetrics) ValidateReconcilerErrors(reconciler string, sourceValue, syncValue int) error
- func (csm ConfigSyncMetrics) ValidateReconcilerManagerMetrics() error
- func (csm ConfigSyncMetrics) ValidateReconcilerMetrics(reconciler string, numResources int) error
- func (csm ConfigSyncMetrics) ValidateResourceOverrideCount(reconciler, containerName, resourceType string, count int) error
- func (csm ConfigSyncMetrics) ValidateResourceOverrideCountMissingTags(tags []tag.Tag) error
- type GVKMetric
- type Measurement
- type Operation
- type Validation
Constants ¶
const ( // MetricsPort is the port where metrics are exposed MetricsPort = ":8675" // OtelDeployment is name of the otel-collector deployment OtelDeployment = "deployment/otel-collector" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigSyncMetrics ¶
type ConfigSyncMetrics map[string][]Measurement
ConfigSyncMetrics is a map from metric names to its measurements.
func ParseMetrics ¶
func ParseMetrics(port int) (ConfigSyncMetrics, error)
ParseMetrics connects to the local port where metrics are being forwarded to and parses the output into a map of metrics and measurements.
func (ConfigSyncMetrics) ValidateDeclaredResources ¶
func (csm ConfigSyncMetrics) ValidateDeclaredResources(reconciler string, value int) error
ValidateDeclaredResources checks that the declared_resources metric is recorded and has the expected value.
func (ConfigSyncMetrics) ValidateErrorMetrics ¶
func (csm ConfigSyncMetrics) ValidateErrorMetrics(reconciler string) error
ValidateErrorMetrics checks for the absence of all the error metrics except for the `reconciler_errors` metric. This metric is aggregated as a LastValue, so we check that the values are 0 instead.
func (ConfigSyncMetrics) ValidateGVKMetrics ¶
func (csm ConfigSyncMetrics) ValidateGVKMetrics(reconciler string, gvkMetric GVKMetric) error
ValidateGVKMetrics validates all the metrics that have a GVK "type" tag key.
func (ConfigSyncMetrics) ValidateGitSyncDepthOverrideCount ¶
func (csm ConfigSyncMetrics) ValidateGitSyncDepthOverrideCount(count int) error
ValidateGitSyncDepthOverrideCount checks that the `git_sync_depth_override_count` metric has the correct value.
func (ConfigSyncMetrics) ValidateMetricsCommitApplied ¶
func (csm ConfigSyncMetrics) ValidateMetricsCommitApplied(commitHash string) error
ValidateMetricsCommitApplied checks that the `last_apply_timestamp` metric has been recorded for a particular commit hash.
func (ConfigSyncMetrics) ValidateNoSSLVerifyCount ¶
func (csm ConfigSyncMetrics) ValidateNoSSLVerifyCount(count int) error
ValidateNoSSLVerifyCount checks that the `no_ssl_verify_count` metric has the correct value.
func (ConfigSyncMetrics) ValidateReconcilerErrors ¶
func (csm ConfigSyncMetrics) ValidateReconcilerErrors(reconciler string, sourceValue, syncValue int) error
ValidateReconcilerErrors checks that the `reconciler_errors` metric is recorded for the correct reconciler with the expected values for each of its component tags.
func (ConfigSyncMetrics) ValidateReconcilerManagerMetrics ¶
func (csm ConfigSyncMetrics) ValidateReconcilerManagerMetrics() error
ValidateReconcilerManagerMetrics validates the `reconcile_duration_seconds` metric from the reconciler manager.
func (ConfigSyncMetrics) ValidateReconcilerMetrics ¶
func (csm ConfigSyncMetrics) ValidateReconcilerMetrics(reconciler string, numResources int) error
ValidateReconcilerMetrics validates the non-error and non-GVK metrics produced by the reconcilers.
func (ConfigSyncMetrics) ValidateResourceOverrideCount ¶
func (csm ConfigSyncMetrics) ValidateResourceOverrideCount(reconciler, containerName, resourceType string, count int) error
ValidateResourceOverrideCount checks that the `resource_override_count` metric is recorded for the correct reconciler, container name, and resource type, and checks the metric value is correct.
func (ConfigSyncMetrics) ValidateResourceOverrideCountMissingTags ¶
func (csm ConfigSyncMetrics) ValidateResourceOverrideCountMissingTags(tags []tag.Tag) error
ValidateResourceOverrideCountMissingTags checks that the `resource_override_count` metric misses the specific the tags.
type GVKMetric ¶
GVKMetric is used for validating the count aggregated metrics that have a GVK type tag (`api_duration_seconds`, `apply_operations`, and `watches`).
func ResourceCreated ¶
ResourceCreated encapsulates the expected metric data when a new resource is created in Config Sync.
func ResourceDeleted ¶
ResourceDeleted encapsulates the expected metric data when a resource is deleted in Config Sync.
func ResourcePatched ¶
ResourcePatched encapsulates the expected metric data when an existing resource is patched in Config Sync.
type Measurement ¶
Measurement is a recorded data point with a list of tags and a value.
type Operation ¶
Operation encapsulates an operation in the applier (create, update, delete) with its count value.
type Validation ¶
type Validation func(metric Measurement) error
Validation evaluates a Measurement, returning an error if it fails validation.