Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExporterConfig ¶
type ExporterConfig struct { // LogLevel is the log level. LogLevel string `yaml:"log_level"` // HTTPServerConfig is the configuration for the HTTP server. HTTPServerConfig struct { ListenAddress string `yaml:"listen_address"` MetricsPath string `yaml:"metrics_path"` } `yaml:"http_server"` // SamplesPath is the path to the samples. SamplesPath string `yaml:"samples_path"` // SchedulerConfig is the configuration for the scheduler. SchedulerConfig struct { // RefreshSamplesInterval is the interval to refresh the samples. RefreshSamplesInterval time.Duration `yaml:"refresh_samples_interval"` // EnqueueSamplesInterval is the interval to enqueue the samples. EnqueueSamplesInterval time.Duration `yaml:"enqueue_samples_interval"` // GCInterval is the interval to run the garbage collector. GCInterval time.Duration `yaml:"gc_interval"` } `yaml:"scheduler"` WorkerConfig struct { // ParallelJobs is the size of the channel. ParallelJobs int `yaml:"parallel_jobs"` // MaxQueueSize is the max size of the queue. MaxQueueSize int `yaml:"max_queue_size"` // SleepBetweenJobs is the sleep between jobs. SleepBetweenJobs time.Duration `yaml:"sleep_between_jobs"` } `yaml:"worker"` // ReportConfig is the configuration for the report. ReportConfig struct { // Enabled is the flag to enable the report. Enabled bool `yaml:"enabled"` // S3Config is the configuration for the S3. S3Config struct { // Enabled is the flag to enable the S3. Enabled bool `yaml:"enabled"` // Bucket is the bucket name. Bucket string `yaml:"bucket"` // Region is the region. Region string `yaml:"region"` // AccessKeyID is the access key ID. AccessKeyID string `yaml:"access_key_id"` // SecretAccessKey is the secret access key. SecretAccessKey string `yaml:"secret_access_key"` // Endpoint is the endpoint. Endpoint string `yaml:"endpoint"` // ForcePathStyle is the flag to force path style. ForcePathStyle bool `yaml:"force_path_style"` // UseSSL is the flag to use SSL. UseSSL bool `yaml:"use_ssl"` } `yaml:"s3"` } `yaml:"report"` }
ExporterConfig is the configuration for the exporter.
func LoadExporterConfig ¶
func LoadExporterConfig(data []byte) (*ExporterConfig, error)
LoadExporterConfig loads from byte array.
func LoadExporterConfigFromFile ¶
func LoadExporterConfigFromFile(path string) (*ExporterConfig, error)
LoadExporterConfigFromFile loads from file.
type SampleConfig ¶
type SampleConfig struct { // Name is the sample name. Name string `yaml:"name,omitempty"` // Path is the sample path. Path string `yaml:"path,omitempty"` // Description is the description of the sample. Description string `yaml:"description,omitempty"` // Tags is the tags of the sample. Tags map[string]string `yaml:"tags,omitempty"` // ScrapeInterval is the interval to scrape the sample. Interval time.Duration `yaml:"interval,omitempty"` // Timeout is the timeout to scrape the sample. Timeout time.Duration `yaml:"timeout,omitempty"` // Steps is the steps to scrape the sample. Steps []StepConfig `yaml:"steps,omitempty"` // Variables is the variables to scrape the sample Variables []map[string]string `yaml:"variables,omitempty"` }
SampleConfig is the sample configuration.
func LoadSampleConfig ¶
func LoadSampleConfig(data []byte) (*SampleConfig, error)
LoadSampleConfig loads from byte array.
func LoadSampleConfigFromFile ¶
func LoadSampleConfigFromFile(path string) (*SampleConfig, error)
LoadSampleConfigFromFile loads from file.
type StepConfig ¶
type StepConfig struct { // Plugin is the plugin to scrape the sample. If not value given, the latest used plugin will be used. Plugin string `yaml:"plugin,omitempty"` // Action is the action to scrape the sample Action string `yaml:"action,omitempty"` // Parameters is the parameters to scrape the sample Parameters map[string]string `yaml:"parameters,omitempty"` // Negate is the negate to scrape the sample Negate bool `yaml:"negate,omitempty"` }
StepConfig is the step configuration.
Click to show internal directories.
Click to hide internal directories.