config

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package config generates Grafana Agent configuration based on Kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeLabelName

func SanitizeLabelName(name string) string

SanitizeLabelName sanitizes a label name for Prometheus.

Types

type AssetReference

type AssetReference struct {
	Namespace string
	Reference prom.SecretOrConfigMap
}

AssetReference is a namespaced Secret or ConfigMap selector.

type Deployment

type Deployment struct {
	// Agent is the root resource that the deployment represents.
	Agent *grafana.GrafanaAgent
	// Prometheis is the set of prometheus instances discovered from the root Agent resource.
	Prometheis []PrometheusInstance
}

Deployment is a set of resources used for one deployment of the Agent.

func (*Deployment) AssetReferences

func (d *Deployment) AssetReferences() []AssetReference

AssetReferences returns all secret or configmap selectors used throughout the deployment. Every used secret and configmap should then be loaded into an assets.SecretStore.

func (*Deployment) BuildConfig

func (d *Deployment) BuildConfig(secrets assets.SecretStore) (string, error)

BuildConfig builds an Agent configuration file.

func (*Deployment) DeepCopy

func (d *Deployment) DeepCopy() *Deployment

DeepCopy creates a deep copy of d.

type FSImporter

type FSImporter struct {
	// contains filtered or unexported fields
}

FSImporter implements jsonnet.Importer for a fs.FS.

func NewFSImporter

func NewFSImporter(f fs.FS) *FSImporter

NewFSImporter creates a new jsonnet VM Importer that uses the given fs.

func (*FSImporter) Import

func (i *FSImporter) Import(importedFrom, importedPath string) (contents jsonnet.Contents, foundAt string, err error)

Import implements jsonnet.Importer.

type PrometheusInstance

type PrometheusInstance struct {
	Instance        *grafana.PrometheusInstance
	ServiceMonitors []*prom.ServiceMonitor
	PodMonitors     []*prom.PodMonitor
	Probes          []*prom.Probe
}

PrometheusInstance is an instance with a set of associated service monitors, pod monitors, and probes, which compose the final configuration of the generated Prometheus instance.

Jump to

Keyboard shortcuts

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