config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2020 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ActivateRPCLog bool      `yaml:"activate_rpc_log"`
	LogFormat      LogFormat `yaml:"log_format"`
	PrometheusURL  string    `yaml:"prometheus_url"`
	RESTAPIPort    uint64    `yaml:"rest_api_port"`
	// MetadataLookbackInterval is the time in second used to retrieve label and metrics from Prometheus
	MetadataLookbackInterval model.Duration `yaml:"metadata_lookback_interval"`
}

Config contains the configuration for a server.

func ReadConfig

func ReadConfig(configFile string) (*Config, error)

ReadConfig gets the GlobalConfig from a configFile (that is a path to the file).

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides a function used internally by the yaml.v3 lib.

func (*Config) Validate

func (c *Config) Validate() error

Validate returns an error if the config is not valid.

type LogFormat

type LogFormat string

LogFormat is the type used for describing the format of logs.

const (
	// JSONFormat is used for JSON logs.
	JSONFormat LogFormat = "json"
	// TextFormat is used of structured text logs.
	TextFormat LogFormat = "text"
)

Jump to

Keyboard shortcuts

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