mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
fix typos
revert from less ideal wording more typos
This commit is contained in:
parent
405a55521f
commit
2e82759ca9
7 changed files with 19 additions and 20 deletions
|
|
@ -22,14 +22,14 @@ import (
|
|||
|
||||
// LabelNeq produces a not-equal label selector expression.
|
||||
// Label is passed verbatim, and value is double-quote escaped
|
||||
// using Go's escaping is used on value (as per the PromQL rules).
|
||||
// using Go's escaping (as per the PromQL rules).
|
||||
func LabelNeq(label string, value string) string {
|
||||
return fmt.Sprintf("%s!=%q", label, value)
|
||||
}
|
||||
|
||||
// LabelEq produces a equal label selector expression.
|
||||
// Label is passed verbatim, and value is double-quote escaped
|
||||
// using Go's escaping is used on value (as per the PromQL rules).
|
||||
// using Go's escaping (as per the PromQL rules).
|
||||
func LabelEq(label string, value string) string {
|
||||
return fmt.Sprintf("%s=%q", label, value)
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ func NameMatches(expr string) string {
|
|||
}
|
||||
|
||||
// NameNotMatches produces a label selector expression that checks that the series name doesn't matches the given expression.
|
||||
// It's a convinience wrapper around LabelNotMatches.
|
||||
// It's a convenience wrapper around LabelNotMatches.
|
||||
func NameNotMatches(expr string) string {
|
||||
return LabelNotMatches("__name__", expr)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import (
|
|||
|
||||
// NB: the official prometheus API client at https://github.com/prometheus/client_golang
|
||||
// is rather lackluster -- as of the time of writing of this file, it lacked support
|
||||
// for querying the series metadata, which we need for the adapter. Instead, we use
|
||||
// for querying the series metadata, which we need for the adapter. Instead, we use
|
||||
// this client.
|
||||
|
||||
// Selector represents a series selector
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ import (
|
|||
type MetricsDiscoveryConfig struct {
|
||||
// Rules specifies how to discover and map Prometheus metrics to
|
||||
// custom metrics API resources. The rules are applied independently,
|
||||
// and thus must be mutually exclusive. Rules will the same SeriesQuery
|
||||
// and thus must be mutually exclusive. Rules with the same SeriesQuery
|
||||
// will make only a single API call.
|
||||
Rules []DiscoveryRule `yaml:"rules"`
|
||||
ResourceRules *ResourceRules `yaml:"resourceRules,omitempty"`
|
||||
}
|
||||
|
||||
// DiscoveryRule describes on set of rules for transforming Prometheus metrics to/from
|
||||
// DiscoveryRule describes a set of rules for transforming Prometheus metrics to/from
|
||||
// custom metrics API resources.
|
||||
type DiscoveryRule struct {
|
||||
// SeriesQuery specifies which metrics this rule should consider via a Prometheus query
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ var groupNameSanitizer = strings.NewReplacer(".", "_", "-", "_")
|
|||
// themselves be normalized.
|
||||
type MetricNamer interface {
|
||||
// Selector produces the appropriate Prometheus series selector to match all
|
||||
// series handlable by this namer.
|
||||
// series handable by this namer.
|
||||
Selector() prom.Selector
|
||||
// FilterSeries checks to see which of the given series match any additional
|
||||
// constrains beyond the series query. It's assumed that the series given
|
||||
// already matche the series query.
|
||||
// constraints beyond the series query. It's assumed that the series given
|
||||
// already match the series query.
|
||||
FilterSeries(series []prom.Series) []prom.Series
|
||||
// MetricNameForSeries returns the name (as presented in the API) for a given series.
|
||||
MetricNameForSeries(series prom.Series) (string, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue