Documentation
¶
Index ¶
- func AssertMetric(expectedMetric *ExpectedMetric, series *monitoringpb.TimeSeries) error
- func NewIntegrationMetadataValidator() *validator.Validate
- func SliceContains(slice []string, toFind string) bool
- func UnmarshalAndValidate(fullPath string, data []byte, i interface{}) error
- type ConfigurationFields
- type ConfigurationOptions
- type ExpectedLog
- type ExpectedMetric
- type ExpectedMetricsContainer
- type GpuPlatform
- type InputConfiguration
- type IntegrationMetadata
- type LogField
- type MetricLabel
- type MetricSpec
- type MinimumSupportedAgentVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertMetric ¶
func AssertMetric(expectedMetric *ExpectedMetric, series *monitoringpb.TimeSeries) error
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 being described.
MetricSpec `yaml:",inline"`
// 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: debian-11. 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:"unique=LogName,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 LogField ¶
type LogField 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: debian-11.
UnavailableOn []string `yaml:"unavailable_on,omitempty"`
// Annotations/footnotes about the field.
Notes []string `yaml:"notes,omitempty" validate:"omitempty,unique"`
}
type MetricLabel ¶
type MetricLabel struct {
// The label name, for example state.
Name string `yaml:"name" validate:"required"`
// The label value pattern, as an RE2 regular expression.
ValueRegex string `yaml:"value_regex" validate:"required"`
// The description of the label.
Description string `yaml:"description" validate:"excludesall=‘’“”"`
// Annotations/footnotes about the label.
Notes []string `yaml:"notes,omitempty" validate:"omitempty,unique"`
}
MetricLabel encodes a specification of a metric label in the metrics backend.
type MetricSpec ¶
type MetricSpec 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 value of the point, for example 10.0 (but can be an int64, float64, or distribution).
Value any
// The kind, for example GAUGE.
Kind string `yaml:"kind" validate:"required,oneof=GAUGE DELTA CUMULATIVE"`
// The unit of the metric.
Unit string `yaml:"unit"`
// The description of the metric.
Description string `yaml:"description" validate:"excludesall=‘’“”"`
// The monitored resource, for example gce_instance.
// Currently we only test with gce_instance.
MonitoredResources []string `yaml:"monitored_resources,flow" validate:"required,gt=0,dive,oneof=gce_instance"`
// Mapping of expected label keys to label specs.
Labels []*MetricLabel `yaml:"labels,omitempty" validate:"omitempty,gt=0,unique=Name,dive"`
// Annotations/footnotes about the metric.
Notes []string `yaml:"notes,omitempty" validate:"omitempty,unique"`
}
MetricSpec encodes a specification of a metric in the metrics backend.
Click to show internal directories.
Click to hide internal directories.