Documentation ¶
Index ¶
- func AssertMetric(metric *ExpectedMetric, series *monitoringpb.TimeSeries) error
- func NewIntegrationMetadataValidator() *validator.Validate
- func SliceContains(slice []string, toFind string) bool
- func UnmarshalAndValidate(data []byte, i interface{}) error
- type ConfigurationFields
- type ConfigurationOptions
- type ExpectedLog
- type ExpectedMetric
- type ExpectedMetricsContainer
- type GpuPlatform
- type InputConfiguration
- type IntegrationMetadata
- type LogFields
- type MinimumSupportedAgentVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertMetric ¶
func AssertMetric(metric *ExpectedMetric, series *monitoringpb.TimeSeries) error
func NewIntegrationMetadataValidator ¶
func NewIntegrationMetadataValidator() *validator.Validate
func SliceContains ¶
func UnmarshalAndValidate ¶
Types ¶
type ConfigurationFields ¶
type ConfigurationOptions ¶
type ConfigurationOptions struct { LogsConfiguration []*InputConfiguration `yaml:"logs" validate:"required_without=MetricsConfiguration,dive"` MetricsConfiguration []*InputConfiguration `yaml:"metrics" validate:"required_without=LogsConfiguration,dive"` }
type ExpectedLog ¶
type ExpectedMetric ¶
type ExpectedMetric struct { // The metric type, for example workload.googleapis.com/apache.current_connections. Type string `yaml:"type" validate:"required"` // The value type, for example INT64. ValueType string `yaml:"value_type" validate:"required,oneof=BOOL INT64 DOUBLE STRING DISTRIBUTION"` // The kind, for example GAUGE. Kind string `yaml:"kind" validate:"required,oneof=GAUGE DELTA CUMULATIVE"` // The monitored resource, for example gce_instance. // Currently we only test with gce_instance. MonitoredResource string `yaml:"monitored_resource" validate:"required,oneof=gce_instance"` // Mapping of expected label keys to value patterns. // Patterns are RE2 regular expressions. Labels map[string]string `yaml:"labels,omitempty" validate:"omitempty,gt=0"` // If Optional is true, the test for this metric will be skipped. Optional bool `yaml:"optional,omitempty" validate:"excluded_with=Representative"` // Exactly one metric in each expected_metrics.yaml must // have Representative set to true. This metric can be used // to test that the integration is enabled. Representative bool `yaml:"representative,omitempty" validate:"excluded_with=Optional,excluded_with=Platform"` // Exclusive metric to a particular kind of platform. Platform string `yaml:"platform,omitempty" validate:"excluded_with=Representative,omitempty,oneof=linux windows"` // Examples: centos-7,debian-10. Not valid are linux,windows. UnavailableOn []string `yaml:"unavailable_on,omitempty" validate:"excluded_with=Representative"` }
ExpectedMetric encodes a series of assertions about what data we expect to see in the metrics backend.
type ExpectedMetricsContainer ¶
type ExpectedMetricsContainer struct {
ExpectedMetrics []*ExpectedMetric `yaml:"expected_metrics" validate:"onetrue=Representative,unique=Type,dive"`
}
type GpuPlatform ¶
type InputConfiguration ¶
type InputConfiguration struct { Type string `yaml:"type" validate:"required"` Fields []*ConfigurationFields `yaml:"fields" validate:"required,dive"` }
type IntegrationMetadata ¶
type IntegrationMetadata struct { PublicUrl string `yaml:"public_url"` AppUrl string `yaml:"app_url" validate:"required,url"` ShortName string `yaml:"short_name" validate:"required,excludesall=‘’“”"` LongName string `yaml:"long_name" validate:"required,excludesall=‘’“”"` LogoPath string `yaml:"logo_path"` Description string `yaml:"description" validate:"required,excludesall=‘’“”"` ConfigurationOptions *ConfigurationOptions `yaml:"configuration_options" validate:"required"` ConfigureIntegration string `yaml:"configure_integration"` ExpectedLogs []*ExpectedLog `yaml:"expected_logs" validate:"dive"` MinimumSupportedAgentVersion *MinimumSupportedAgentVersion `yaml:"minimum_supported_agent_version"` SupportedAppVersion []string `yaml:"supported_app_version" validate:"required,unique,min=1"` SupportedOperatingSystems string `yaml:"supported_operating_systems" validate:"required,oneof=linux windows linux_and_windows"` PlatformsToSkip []string `yaml:"platforms_to_skip"` GpuPlatforms []GpuPlatform `yaml:"gpu_platforms" validate:"dive"` RestartAfterInstall bool `yaml:"restart_after_install"` Troubleshoot string `yaml:"troubleshoot" validate:"excludesall=‘’“”"` ExpectedMetricsContainer `yaml:",inline"` }
type LogFields ¶
type LogFields struct { Name string `yaml:"name" validate:"required"` ValueRegex string `yaml:"value_regex"` Type string `yaml:"type" validate:"required"` Description string `yaml:"description" validate:"excludesall=‘’“”"` Optional bool `yaml:"optional,omitempty"` // Examples: centos-7,debian-10. UnavailableOn []string `yaml:"unavailable_on,omitempty"` }
Click to show internal directories.
Click to hide internal directories.