Documentation ¶
Overview ¶
Package http discovery Copyright 2021 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 ¶
var ( // DefaultSDConfig is the default HTTP SD configuration. DefaultSDConfig = SDConfig{ RefreshInterval: model.Duration(60 * time.Second), HTTPClientConfig: config.DefaultHTTPClientConfig, } )
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
Discovery provides service discovery functionality based on HTTP endpoints that return target groups in JSON format.
func NewDiscovery ¶
func NewDiscovery(conf *SDConfig, logger logrus.FieldLogger) (*Discovery, error)
NewDiscovery returns a new HTTP discovery for the given config.
type SDConfig ¶
type SDConfig struct { HTTPClientConfig config.HTTPClientConfig `yaml:",inline"` RefreshInterval model.Duration `yaml:"refresh-interval,omitempty"` URL string `yaml:"url"` }
SDConfig is the configuration for HTTP based discovery.
func (*SDConfig) NewDiscoverer ¶
func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
NewDiscoverer returns a Discoverer for the Config.
func (*SDConfig) SetDirectory ¶
SetDirectory joins any relative file paths with dir.
func (*SDConfig) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.