prom

package
v0.0.0-...-8b28c38 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AllocationContextName is the name we assign the allocation query context [metadata]
	AllocationContextName = "allocation"

	// ClusterContextName is the name we assign the cluster query context [metadata]
	ClusterContextName = "cluster"

	// ClusterContextName is the name we assign the optional cluster query context [metadata]
	ClusterOptionalContextName = "cluster-optional"

	// ComputeCostDataContextName is the name we assign the compute cost data query context [metadata]
	ComputeCostDataContextName = "compute-cost-data"

	// ComputeCostDataContextName is the name we assign the compute cost data range query context [metadata]
	ComputeCostDataRangeContextName = "compute-cost-data-range"

	// ClusterMapContextName is the name we assign the cluster map query context [metadata]
	ClusterMapContextName = "cluster-map"

	// FrontendContextName is the name we assign queries proxied from the frontend [metadata]
	FrontendContextName = "frontend"

	// DiagnosticContextName is the name we assign queries that check the state of the prometheus connection
	DiagnosticContextName = "diagnostic"

	// ContainerStatsContextName is the name we assign queries that build
	// container stats aggregations.
	ContainerStatsContextName = "container-stats"
)
View Source
const (
	// CAdvisorDiagnosticMetricID is the identifier of the metric used to determine if cAdvisor is being scraped.
	CAdvisorDiagnosticMetricID = "cadvisorMetric"

	// CAdvisorLabelDiagnosticMetricID is the identifier of the metric used to determine if cAdvisor labels are correct.
	CAdvisorLabelDiagnosticMetricID = "cadvisorLabel"

	// KSMDiagnosticMetricID is the identifier for the metric used to determine if KSM metrics are being scraped.
	KSMDiagnosticMetricID = "ksmMetric"

	// KSMVersionDiagnosticMetricID is the identifier for the metric used to determine if KSM version is correct.
	KSMVersionDiagnosticMetricID = "ksmVersion"

	// KubecostDiagnosticMetricID is the identifier for the metric used to determine if Kubecost metrics are being scraped.
	KubecostDiagnosticMetricID = "kubecostMetric"

	// NodeExporterDiagnosticMetricID is the identifier for the metric used to determine if NodeExporter metrics are being scraped.
	NodeExporterDiagnosticMetricID = "neMetric"

	// ScrapeIntervalDiagnosticMetricID is the identifier for the metric used to determine if prometheus has its own self-scraped
	// metrics.
	ScrapeIntervalDiagnosticMetricID = "scrapeInterval"

	// CPUThrottlingDiagnosticMetricID is the identifier for the metric used to determine if CPU throttling is being applied to the
	// cost-model container.
	CPUThrottlingDiagnosticMetricID = "cpuThrottling"

	// KubecostRecordingRuleCPUUsageID is the identifier for the query used to
	// determine of the CPU usage recording rule is set up correctly.
	KubecostRecordingRuleCPUUsageID = "kubecostRecordingRuleCPUUsage"

	// CAdvisorWorkingSetBytesMetricID is the identifier for the query used to determine
	// if cAdvisor working set bytes data is being scraped
	CAdvisorWorkingSetBytesMetricID = "cadvisorWorkingSetBytesMetric"

	// KSMCPUCapacityMetricID is the identifier for the query used to determine if
	// KSM CPU capacity data is being scraped
	KSMCPUCapacityMetricID = "ksmCpuCapacityMetric"

	// KSMAllocatableCPUCoresMetricID is the identifier for the query used to determine
	// if KSM allocatable CPU core data is being scraped
	KSMAllocatableCPUCoresMetricID = "ksmAllocatableCpuCoresMetric"
)

Prometheus Metric Diagnostic IDs

View Source
const (
	// PrometheusClientID is the identifier used when creating the client that
	// targets prometheus. This can be used to check a specific client instance
	// by calling prom.IsClientID(client, prom.PrometheusClientID)
	PrometheusClientID string = "Prometheus"

	// ThanosClientID is the identifier used when creating the client that
	// targets thanos. This can be used to check a specific client instance
	// by calling prom.IsClientID(client, prom.ThanosClientID)
	ThanosClientID string = "Thanos"
)
View Source
const DocumentationBaseURL = "https://github.com/kubecost/docs/blob/master/diagnostics.md"
View Source
const HeaderXScopeOrgId = "X-Scope-OrgID"

Default header key for Mimir/Cortex-Tenant API requests

View Source
const MaxRetryAfterDuration = 10 * time.Second

MaxRetryAfterDuration is the maximum amount of time we should ever wait during a retry. This is to prevent starvation on the request threads

View Source
const NoStoreAPIWarning string = "No StoreAPIs matched for this query"

NoStoreAPIWarning is a warning that we would consider an error. It returns partial data relating only to the store apis which were reachable. In order to ensure integrity of data across all clusters, we'll need to identify this warning and convert it to an error.

View Source
const PrometheusTroubleshootingURL = "http://docs.kubecost.com/custom-prom#troubleshoot"

Variables

View Source
var (
	// Static Warnings for data point parsing
	InfWarning warning = newWarning("Found Inf value parsing vector data point for metric")
	NaNWarning warning = newWarning("Found NaN value parsing vector data point for metric")
)
View Source
var UserAgent = fmt.Sprintf("Openghg/%s", version.Version)

Functions

func AllErrorsFor

func AllErrorsFor(collection QueryErrorCollection) []error

func AnyToLabels

func AnyToLabels(a interface{}) (map[string]string, error)

AnyToLabels will create prometheus labels based on the fields of the interface passed. Note that this method is quite expensive and should only be used when absolutely necessary.

func DataFieldFormatErr

func DataFieldFormatErr(query string) error

func DataPointFormatErr

func DataPointFormatErr(query string) error

func IsClientID

func IsClientID(cli prometheus.Client, id string) bool

IsClientID returns true if the client has an identifier of the specific type.

func IsCommError

func IsCommError(err error) bool

IsCommError returns true if the given error is a CommError

func IsErrorCollection

func IsErrorCollection(err error) bool

IsErrorCollection returns true if the provided error is an ErrorCollection

func IsNoDataError

func IsNoDataError(err error) bool

IsNoDataError returns true if the given error is a NoDataError

func IsNoStoreAPIWarning

func IsNoStoreAPIWarning(warning string) bool

IsNoStoreAPIWarning checks a warning to determine if it is equivalent to a no store API query.

func IsPrometheus

func IsPrometheus(cli prometheus.Client) bool

IsPrometheus returns true if the client provided is used to target prometheus

func IsThanos

func IsThanos(cli prometheus.Client) bool

IsThanos returns true if the client provided is used to target thanos

func KubeAnnotationsToLabels

func KubeAnnotationsToLabels(labels map[string]string) ([]string, []string)

Converts kubernetes annotations into prometheus labels.

func KubeLabelsToLabels

func KubeLabelsToLabels(labels map[string]string) ([]string, []string)

Converts kubernetes labels into prometheus labels.

func KubePrependQualifierToLabels

func KubePrependQualifierToLabels(m map[string]string, qualifier string) ([]string, []string)

Prepends a qualifier string to the keys provided in the m map and returns the new keys and values.

func LabelNamesFrom

func LabelNamesFrom(labels map[string]string) []string

LabelNamesFrom accepts a mapping of labels to values and returns the label names.

func LogPrometheusClientState

func LogPrometheusClientState(client prometheus.Client)

LogPrometheusClientState logs the current state, with respect to outbound requests, if that information is available.

func LogQueryRequest

func LogQueryRequest(l *golog.Logger, req *http.Request, queueTime time.Duration, sendTime time.Duration)

LogQueryRequest logs the query that was send to prom/thanos with the time in queue and total time after being sent

func MapToLabels

func MapToLabels(m interface{}) map[string]string

MapToLabels accepts a map type, and will return a new map containing all the nested fields separated by _ with string versions of the values.

func MetricFieldDoesNotExistErr

func MetricFieldDoesNotExistErr(query string) error

func MetricFieldFormatErr

func MetricFieldFormatErr(query string) error

func NewPrometheusClient

func NewPrometheusClient(address string, config *PrometheusClientConfig) (prometheus.Client, error)

NewPrometheusClient creates a new rate limited client which limits by outbound concurrent requests.

func NewRateLimitedClient

func NewRateLimitedClient(
	id string,
	client prometheus.Client,
	maxConcurrency int,
	auth *ClientAuth,
	decorator QueryParamsDecorator,
	rateLimitRetryOpts *RateLimitRetryOpts,
	queryLogFile string,
	headerXScopeOrgId string) (prometheus.Client, error)

NewRateLimitedClient creates a prometheus client which limits the number of concurrent outbound prometheus requests.

func NoDataErr

func NoDataErr(query string) error

func PromUnexpectedResponseErr

func PromUnexpectedResponseErr(query string) error

func QueryResultNilErr

func QueryResultNilErr(query string) error

func ResultFieldDoesNotExistErr

func ResultFieldDoesNotExistErr(query string) error

func ResultFieldFormatErr

func ResultFieldFormatErr(query string) error

func ResultFormatErr

func ResultFormatErr(query string) error

func SanitizeLabelName

func SanitizeLabelName(s string) string

Replaces all illegal prometheus label characters with _

func SanitizeLabels

func SanitizeLabels(labels map[string]string) map[string]string

SanitizeLabels sanitizes all label names in the given map. This may cause collisions, which is intentional as collisions that are not caught prior to attempted emission will cause fatal errors. In the case of a collision, the last value seen will be set, and all previous values will be overwritten.

func ScrapeIntervalFor

func ScrapeIntervalFor(client prometheus.Client, jobName string) (time.Duration, error)

ScrapeIntervalFor uses the provided prometheus client to locate a scrape interval for a specific job name

func ValueFieldDoesNotExistErr

func ValueFieldDoesNotExistErr(query string) error

func ValueFieldFormatErr

func ValueFieldFormatErr(query string) error

func WrapError

func WrapError(err error, msg string) error

WrapError wraps the given error with the given message, usually for adding context, but persists the existing type of error.

Types

type ClientAuth

type ClientAuth struct {
	Username    string
	Password    string
	BearerToken string
}

ClientAuth is used to authenticate outgoing client requests.

func (*ClientAuth) Apply

func (auth *ClientAuth) Apply(req *http.Request)

Apply Applies the authentication data to the request headers

type CommError

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

CommError describes an error communicating with Prometheus

func CommErrorf

func CommErrorf(format string, args ...interface{}) CommError

CommErrorf creates a new CommError using a string formatter

func NewCommError

func NewCommError(messages ...string) CommError

NewCommError creates a new CommError

func (CommError) Error

func (pce CommError) Error() string

Error prints the error as a string

func (CommError) Wrap

func (pce CommError) Wrap(message string) CommError

Wrap wraps the error with the given message, but persists the error type.

type Context

type Context struct {
	Client prometheus.Client
	// contains filtered or unexported fields
}

Context wraps a Prometheus client and provides methods for querying and parsing query responses and errors.

func NewContext

func NewContext(client prometheus.Client) *Context

NewContext creates a new Prometheus querying context from the given client

func NewNamedContext

func NewNamedContext(client prometheus.Client, name string) *Context

NewNamedContext creates a new named Prometheus querying context from the given client

func (*Context) ErrorCollection

func (ctx *Context) ErrorCollection() error

ErrorCollection returns the aggregation of errors if there exists errors. Otherwise, nil is returned

func (*Context) Errors

func (ctx *Context) Errors() []*QueryError

Errors returns the errors collected from the Context's ErrorCollector.

func (*Context) HasErrors

func (ctx *Context) HasErrors() bool

HasErrors returns true if the ErrorCollector has errors

func (*Context) HasWarnings

func (ctx *Context) HasWarnings() bool

HasWarnings returns true if the ErrorCollector has warnings.

func (*Context) ProfileQuery

func (ctx *Context) ProfileQuery(query string, profileLabel string) QueryResultsChan

ProfileQuery returns a QueryResultsChan, then runs the given query with a profile label and sends the results on the provided channel. Receiver is responsible for closing the channel, preferably using the Read method.

func (*Context) ProfileQueryAll

func (ctx *Context) ProfileQueryAll(queries ...string) []QueryResultsChan

ProfileQueryAll returns one QueryResultsChan for each query provided, then runs each ProfileQuery concurrently and returns results on each channel, respectively, in the order they were provided; i.e. the response to queries[1] will be sent on channel resChs[1].

func (*Context) ProfileQueryRange

func (ctx *Context) ProfileQueryRange(query string, start, end time.Time, step time.Duration, profileLabel string) QueryResultsChan

func (*Context) Query

func (ctx *Context) Query(query string) QueryResultsChan

Query returns a QueryResultsChan, then runs the given query and sends the results on the provided channel. Receiver is responsible for closing the channel, preferably using the Read method.

func (*Context) QueryAll

func (ctx *Context) QueryAll(queries ...string) []QueryResultsChan

QueryAll returns one QueryResultsChan for each query provided, then runs each query concurrently and returns results on each channel, respectively, in the order they were provided; i.e. the response to queries[1] will be sent on channel resChs[1].

func (*Context) QueryAtTime

func (ctx *Context) QueryAtTime(query string, t time.Time) QueryResultsChan

QueryAtTime returns a QueryResultsChan, then runs the given query at the given time (see time parameter here: https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries) and sends the results on the provided channel. Receiver is responsible for closing the channel, preferably using the Read method.

func (*Context) QueryRange

func (ctx *Context) QueryRange(query string, start, end time.Time, step time.Duration) QueryResultsChan

func (*Context) QueryRangeSync

func (ctx *Context) QueryRangeSync(query string, start, end time.Time, step time.Duration) ([]*QueryResult, v1.Warnings, error)

func (*Context) QueryRangeURL

func (ctx *Context) QueryRangeURL() *url.URL

QueryRangeURL returns the URL used to query_range Prometheus

func (*Context) QuerySync

func (ctx *Context) QuerySync(query string) ([]*QueryResult, v1.Warnings, error)

func (*Context) QueryURL

func (ctx *Context) QueryURL() *url.URL

QueryURL returns the URL used to query Prometheus

func (*Context) RawQuery

func (ctx *Context) RawQuery(query string, t time.Time) ([]byte, error)

RawQuery is a direct query to the prometheus client and returns the body of the response

func (*Context) RawQueryRange

func (ctx *Context) RawQueryRange(query string, start, end time.Time, step time.Duration) ([]byte, error)

RawQuery is a direct query to the prometheus client and returns the body of the response

func (*Context) Warnings

func (ctx *Context) Warnings() []*QueryWarning

Warnings returns the warnings collected from the Context's ErrorCollector

type ErrorsAndWarningStrings

type ErrorsAndWarningStrings struct {
	Errors   []string
	Warnings []string
}

ErrorsAndWarningStrings is a container struct for string representation storage/caching

type NoDataError

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

NoDataError indicates that no data was returned by Prometheus. This should be treated like an EOF error, in that it may be expected.

func NewNoDataError

func NewNoDataError(messages ...string) NoDataError

NewNoDataError creates a new NoDataError

func (NoDataError) Error

func (nde NoDataError) Error() string

Error prints the error as a string

func (NoDataError) Wrap

func (nde NoDataError) Wrap(message string) NoDataError

Wrap wraps the error with the given message, but persists the error type.

type PrometheusClientConfig

type PrometheusClientConfig struct {
	Timeout               time.Duration
	KeepAlive             time.Duration
	TLSHandshakeTimeout   time.Duration
	TLSInsecureSkipVerify bool
	RateLimitRetryOpts    *RateLimitRetryOpts
	Auth                  *ClientAuth
	QueryConcurrency      int
	QueryLogFile          string
	HeaderXScopeOrgId     string
}

PrometheusClientConfig contains all configurable options for creating a new prometheus client

type PrometheusConfig

type PrometheusConfig struct {
	ScrapeConfigs []ScrapeConfig `yaml:"scrape_configs,omitempty"`
}

PrometheusConfig is the minimalized view of a prometheus configuration

func GetPrometheusConfig

func GetPrometheusConfig(pcfg string) (PrometheusConfig, error)

GetPrometheusConfig uses the provided yaml string to parse the minimalized prometheus config

type PrometheusDiagnostic

type PrometheusDiagnostic struct {
	ID          string         `json:"id"`
	Query       string         `json:"query"`
	Label       string         `json:"label"`
	Description string         `json:"description"`
	DocLink     string         `json:"docLink"`
	Result      []*QueryResult `json:"result"`
	Passed      bool           `json:"passed"`
}

PrometheusDiagnostic holds information about a metric and the query to ensure it is functional

type PrometheusDiagnostics

type PrometheusDiagnostics []*PrometheusDiagnostic

PrometheusDiagnostics is a PrometheusDiagnostic container with helper methods.

func GetPrometheusMetrics

func GetPrometheusMetrics(client prometheus.Client, offset string) PrometheusDiagnostics

GetPrometheusMetrics returns a list of the state of Prometheus metric used by kubecost using the provided client

func GetPrometheusMetricsByID

func GetPrometheusMetricsByID(ids []string, client prometheus.Client, offset string) PrometheusDiagnostics

GetPrometheusMetricsByID returns a list of the state of specific Prometheus metrics by identifier.

func (PrometheusDiagnostics) HasFailure

func (pd PrometheusDiagnostics) HasFailure() bool

HasFailure returns true if any of the diagnostic tests didn't pass.

type PrometheusMetadata

type PrometheusMetadata struct {
	Running            bool `json:"running"`
	KubecostDataExists bool `json:"kubecostDataExists"`
}

PrometheusMetadata represents a validation result for prometheus/thanos running kubecost.

func Validate

func Validate(cli prometheus.Client) (*PrometheusMetadata, error)

Validate tells the model what data prometheus has on it.

type PrometheusQueueState

type PrometheusQueueState struct {
	QueuedRequests      []*QueuedPromRequest `json:"queuedRequests"`
	OutboundRequests    int                  `json:"outboundRequests"`
	TotalRequests       int                  `json:"totalRequests"`
	MaxQueryConcurrency int                  `json:"maxQueryConcurrency"`
}

PrometheusQueueState contains diagnostic information concerning the state of the prometheus request queue

func GetPrometheusQueueState

func GetPrometheusQueueState(client prometheus.Client) (*PrometheusQueueState, error)

GetPrometheusQueueState is a diagnostic function that probes the prometheus request queue and gathers query, context, and queue statistics.

type QueryError

type QueryError struct {
	Query      string `json:"query"`
	Error      error  `json:"error"`
	ParseError error  `json:"parseError"`
}

func (*QueryError) String

func (qe *QueryError) String() string

String returns a string representation of the QueryError

type QueryErrorCollection

type QueryErrorCollection interface {
	// Warnings is a slice of the QueryWarning instances
	Warnings() []*QueryWarning

	// Errors is a slice of the QueryError instances
	Errors() []*QueryError

	// ToErrorAndWarningStrings returns the errors and warnings in the collection
	// as two string slices.
	ToErrorAndWarningStrings() (errors []string, warnings []string)
}

QueryErrorCollection represents a collection of query errors and warnings made via context.

type QueryErrorCollector

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

QueryErrorCollector is used to collect prometheus query errors and warnings, and also meets the Error interface

func (*QueryErrorCollector) As

func (ec *QueryErrorCollector) As(target interface{}) bool

As is a special method that implicitly works with the `errors.As()` go helper to locate the _first_ instance of the provided target type in the collection.

func (*QueryErrorCollector) Error

func (ec *QueryErrorCollector) Error() string

Implement the error interface to allow returning as an aggregated error

func (*QueryErrorCollector) Errors

func (ec *QueryErrorCollector) Errors() []*QueryError

Errors caught by the collector

func (*QueryErrorCollector) IsError

func (ec *QueryErrorCollector) IsError() bool

Whether or not the collector caught errors

func (*QueryErrorCollector) IsWarning

func (ec *QueryErrorCollector) IsWarning() bool

Whether or not the collector caught any warnings

func (*QueryErrorCollector) Report

func (ec *QueryErrorCollector) Report(query string, warnings []string, requestError error, parseError error)

Reports an error to the collector. Ignores if the error is nil and the warnings are empty

func (*QueryErrorCollector) ToErrorAndWarningStrings

func (ec *QueryErrorCollector) ToErrorAndWarningStrings() (errors []string, warnings []string)

ToErrorAndWarningStrings returns the errors and warnings in the collection as two string slices.

func (*QueryErrorCollector) Warnings

func (ec *QueryErrorCollector) Warnings() []*QueryWarning

Warnings caught by the collector

type QueryParamsDecorator

type QueryParamsDecorator = func(path string, values url.Values) url.Values

QueryParamsDecorator is used to decorate and return query parameters for outgoing requests

type QueryResult

type QueryResult struct {
	Metric map[string]interface{} `json:"metric"`
	Values []*util.Vector         `json:"values"`
}

QueryResult contains a single result from a prometheus query. It's common to refer to query results as a slice of QueryResult

func (*QueryResult) GetAnnotations

func (qr *QueryResult) GetAnnotations() map[string]string

GetAnnotations returns all annotations and their values from the query result

func (*QueryResult) GetLabels

func (qr *QueryResult) GetLabels() map[string]string

GetLabels returns all labels and their values from the query result

func (*QueryResult) GetString

func (qr *QueryResult) GetString(field string) (string, error)

GetString returns the requested field, or an error if it does not exist

func (*QueryResult) GetStrings

func (qr *QueryResult) GetStrings(fields ...string) (map[string]string, error)

GetStrings returns the requested fields, or an error if it does not exist

type QueryResults

type QueryResults struct {
	Query   string
	Error   error
	Results []*QueryResult
}

QueryResults contains all of the query results and the source query string.

func NewQueryResults

func NewQueryResults(query string, queryResult interface{}) *QueryResults

NewQueryResults accepts the raw prometheus query result and returns an array of QueryResult objects

type QueryResultsChan

type QueryResultsChan chan *QueryResults

QueryResultsChan is a channel of query results

func (QueryResultsChan) Await

func (qrc QueryResultsChan) Await() ([]*QueryResult, error)

Await returns query results, blocking until they are made available, and deferring the closure of the underlying channel

type QueryWarning

type QueryWarning struct {
	Query    string   `json:"query"`
	Warnings []string `json:"warnings"`
}

func (*QueryWarning) String

func (qw *QueryWarning) String() string

String returns a string representation of the QueryWarning

type QueuedPromRequest

type QueuedPromRequest struct {
	Context   string `json:"context"`
	Query     string `json:"query"`
	QueueTime int64  `json:"queueTime"`
}

QueuedPromRequest is a representation of a request waiting to be sent by the prometheus client.

type RateLimitResponseStatus

type RateLimitResponseStatus struct {
	RetriesRemaining int
	WaitTime         time.Duration
}

RateLimitResponseStatus contains the status of the rate limited retries

func (*RateLimitResponseStatus) String

func (rtrs *RateLimitResponseStatus) String() string

String creates a string representation of the rate limit status

type RateLimitRetryOpts

type RateLimitRetryOpts struct {
	MaxRetries       int
	DefaultRetryWait time.Duration
}

RateLimitRetryOpts contains retry options

type RateLimitedPrometheusClient

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

RateLimitedPrometheusClient is a prometheus client which limits the total number of concurrent outbound requests allowed at a given moment.

func (*RateLimitedPrometheusClient) Do

Rate limit and passthrough to prometheus client API

func (*RateLimitedPrometheusClient) ID

ID is used to identify the type of client

func (*RateLimitedPrometheusClient) TotalOutboundRequests

func (rlpc *RateLimitedPrometheusClient) TotalOutboundRequests() int

TotalOutboundRequests returns the total number of concurrent outbound requests, which have been sent to the server and are awaiting response.

func (*RateLimitedPrometheusClient) TotalQueuedRequests

func (rlpc *RateLimitedPrometheusClient) TotalQueuedRequests() int

TotalRequests returns the total number of requests that are either waiting to be sent and/or are currently outbound.

func (*RateLimitedPrometheusClient) URL

func (rlpc *RateLimitedPrometheusClient) URL(ep string, args map[string]string) *url.URL

Passthrough to the prometheus client API

type RateLimitedResponseError

type RateLimitedResponseError struct {
	RateLimitStatus []*RateLimitResponseStatus
}

RateLimitedError contains a list of retry statuses that occurred during retries on a rate limited response

func (*RateLimitedResponseError) Error

func (rlre *RateLimitedResponseError) Error() string

Error returns a string representation of the error, including the rate limit status reports

type ScrapeConfig

type ScrapeConfig struct {
	JobName        string `yaml:"job_name,omitempty"`
	ScrapeInterval string `yaml:"scrape_interval,omitempty"`
}

ScrapeConfig is the minimalized view of a prometheus scrape configuration

Jump to

Keyboard shortcuts

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