Documentation ¶
Index ¶
Constants ¶
const DefaultAPIEndpoint = "api/v1/targets"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache retrieves target information from the Prometheus API and caches it. It works reliably and efficiently for configurations where targets are identified unique by job and instance label and an optional but consistent set of additional labels. It only provides best effort matching for configurations where targets are identified by a varying set of labels within a job and instance combination. Implements TargetGetter.
func (*Cache) Get ¶
Get returns a target that matches the job/instance combination of the input labels and has the same labels values for other labels keys they have in common. If multiple targets satisfy this property, it is undefined which one is returned. This is generally a non-issue if the additional label keys are consistently set across all targets for the job/instance combination. If no target is found, nil is returned.