From c6399296dcc059bbc496f40e31aa2c7b7a341951 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Tue, 27 Nov 2018 17:44:29 +0100 Subject: [PATCH] Fix spelling/typos (#4921) * Fix spelling/typos Fix spelling/typos reported by codespell/misspell. * UK -> US spelling changes. Signed-off-by: Ben Kochie --- CHANGELOG.md | 14 +++++++------- CONTRIBUTING.md | 2 +- config/config.go | 2 +- config/config_test.go | 2 +- discovery/README.md | 4 ++-- discovery/azure/azure.go | 2 +- discovery/consul/consul_test.go | 6 +++--- discovery/dns/dns.go | 2 +- discovery/kubernetes/client_metrics.go | 2 +- discovery/kubernetes/endpoints.go | 2 +- discovery/marathon/marathon_test.go | 2 +- docs/querying/operators.md | 2 +- documentation/internal_architecture.md | 2 +- notifier/notifier.go | 2 +- pkg/value/value.go | 2 +- promql/engine.go | 2 +- promql/functions.go | 2 +- promql/testdata/functions.test | 6 +++--- promql/value.go | 4 ++-- rules/alerting.go | 4 ++-- rules/manager_test.go | 2 +- rules/recording.go | 4 ++-- scrape/scrape.go | 2 +- storage/buffer.go | 2 +- storage/remote/queue_manager.go | 2 +- web/api/v1/api.go | 4 ++-- 26 files changed, 41 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8ead7145..87bd96bb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ This release includes multiple bugfixes and features. Further, the WAL implement * [ENHANCEMENT] Send EndsAt along with the alert to Alertmanager #4550 * [ENHANCEMENT] Limit the samples returned by remote read endpoint #4532 * [ENHANCEMENT] Limit the data read in through remote read #4239 -* [ENHANCEMENT] Coalesce identical SD configuations #3912 +* [ENHANCEMENT] Coalesce identical SD configurations #3912 * [ENHANCEMENT] `promtool`: Add new commands for debugging and querying #4247 #4308 #4346 #4454 * [ENHANCEMENT] Update console examples for node_exporter v0.16.0 #4208 * [ENHANCEMENT] Optimize PromQL aggregations #4248 @@ -90,13 +90,13 @@ This release includes multiple bugfixes and features. Further, the WAL implement * [BUGFIX] discovery/kubernetes/ingress: fix scheme discovery #4329 * [BUGFIX] Fix race in zookeeper sd #4355 * [BUGFIX] Better timeout handling in promql #4291 #4300 -* [BUGFIX] Propogate errors when selecting series from the tsdb #4136 +* [BUGFIX] Propagate errors when selecting series from the tsdb #4136 ## 2.3.1 / 2018-06-19 * [BUGFIX] Avoid infinite loop on duplicate NaN values. #4275 * [BUGFIX] Fix nil pointer deference when using various API endpoints #4282 -* [BUGFIX] config: set target group source index during unmarshalling #4245 +* [BUGFIX] config: set target group source index during unmarshaling #4245 * [BUGFIX] discovery/file: fix logging #4178 * [BUGFIX] kubernetes_sd: fix namespace filtering #4285 * [BUGFIX] web: restore old path prefix behavior #4273 @@ -110,7 +110,7 @@ This release includes multiple bugfixes and features. Further, the WAL implement * [FEATURE] Add security headers to HTTP server responses * [FEATURE] Pass query hints via remote read API * [FEATURE] Basic auth passwords can now be configured via file across all configuration -* [ENHANCEMENT] Optimise PromQL and API serialization for memory usage and allocations +* [ENHANCEMENT] Optimize PromQL and API serialization for memory usage and allocations * [ENHANCEMENT] Limit number of dropped targets in web UI * [ENHANCEMENT] Consul and EC2 service discovery allow using server-side filtering for performance improvement * [ENHANCEMENT] Add advanced filtering configuration to EC2 service discovery @@ -133,7 +133,7 @@ This release includes multiple bugfixes and features. Further, the WAL implement * [BUGFIX] Fix data loss in TSDB on compaction * [BUGFIX] Correctly stop timer in remote-write path -* [BUGFIX] Fix deadlock triggerd by loading targets page +* [BUGFIX] Fix deadlock triggered by loading targets page * [BUGFIX] Fix incorrect buffering of samples on range selection queries * [BUGFIX] Handle large index files on windows properly @@ -526,7 +526,7 @@ This is a breaking change to the Kubernetes service discovery. * [ENHANCEMENT] Message on empty Alerts page. * [ENHANCEMENT] Various internal code refactorings and clean-ups. * [ENHANCEMENT] Various improvements in the build system. -* [BUGFIX] Catch errors when unmarshalling delta/doubleDelta encoded chunks. +* [BUGFIX] Catch errors when unmarshaling delta/doubleDelta encoded chunks. * [BUGFIX] Fix data race in lexer and lexer test. * [BUGFIX] Trim stray whitespace from bearer token file. * [BUGFIX] Avoid divide-by-zero panic on query_range?step=0. @@ -1211,4 +1211,4 @@ All changes: * [BUGFIX] Built from Go 1.2.1, which has internal fixes to race conditions in garbage collection handling. * [ENHANCEMENT] Internal storage interface refactoring that allows building e.g. the `rule_checker` tool without LevelDB dynamic library dependencies. * [ENHANCEMENT] Cleanups around shutdown handling. -* [PERFORMANCE] Preparations for better memory reuse during marshalling / unmarshalling. +* [PERFORMANCE] Preparations for better memory reuse during marshaling / unmarshaling. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e5dae17d..fa44263b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,7 @@ go build ./cmd/prometheus/ make test # Make sure all the tests pass before you commit and push :) ``` -All our issues are regularly tagged so that you can also filter down the issues involving the components you want to work on. For our labelling policy refer [the wiki page](https://github.com/prometheus/prometheus/wiki/Label-Names-and-Descriptions). +All our issues are regularly tagged so that you can also filter down the issues involving the components you want to work on. For our labeling policy refer [the wiki page](https://github.com/prometheus/prometheus/wiki/Label-Names-and-Descriptions). ## Pull Request Checklist diff --git a/config/config.go b/config/config.go index 0881d9b29..8ac49209f 100644 --- a/config/config.go +++ b/config/config.go @@ -563,7 +563,7 @@ func (c *RelabelConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -// Regexp encapsulates a regexp.Regexp and makes it YAML marshallable. +// Regexp encapsulates a regexp.Regexp and makes it YAML marshalable. type Regexp struct { *regexp.Regexp original string diff --git a/config/config_test.go b/config/config_test.go index bd992bedb..63ed95125 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -601,7 +601,7 @@ func TestLoadConfig(t *testing.T) { testutil.Equals(t, expectedConf, c) } -// YAML marshalling must not reveal authentication credentials. +// YAML marshaling must not reveal authentication credentials. func TestElideSecrets(t *testing.T) { c, err := LoadFile("testdata/conf.good.yml") testutil.Ok(t, err) diff --git a/discovery/README.md b/discovery/README.md index 366891315..a6db4f009 100644 --- a/discovery/README.md +++ b/discovery/README.md @@ -15,7 +15,7 @@ what makes a good SD and covers some of the common implementation issues. The first question to be asked is does it make sense to add this particular SD? An SD mechanism should be reasonably well established, and at a minimum in -use across multiple organisations. It should allow discovering of machines +use across multiple organizations. It should allow discovering of machines and/or services running somewhere. When exactly an SD is popular enough to justify being added to Prometheus natively is an open question. @@ -140,7 +140,7 @@ type Discoverer interface { } ``` -Prometheus will call the `Run()` method on a provider to initialise the discovery mechanism. The mechanism will then send *all* the `TargetGroup`s into the channel. +Prometheus will call the `Run()` method on a provider to initialize the discovery mechanism. The mechanism will then send *all* the `TargetGroup`s into the channel. Now the mechanism will watch for changes. For each update it can send all `TargetGroup`s, or only changed and new `TargetGroup`s, down the channel. `Manager` will handle both cases. diff --git a/discovery/azure/azure.go b/discovery/azure/azure.go index 17370cde9..6a553af96 100644 --- a/discovery/azure/azure.go +++ b/discovery/azure/azure.go @@ -218,7 +218,7 @@ type virtualMachine struct { func newAzureResourceFromID(id string, logger log.Logger) (azureResource, error) { // Resource IDs have the following format. // /subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/PROVIDER/TYPE/NAME - // or if embeded resource then + // or if embedded resource then // /subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/PROVIDER/TYPE/NAME/TYPE/NAME s := strings.Split(id, "/") if len(s) != 9 && len(s) != 11 { diff --git a/discovery/consul/consul_test.go b/discovery/consul/consul_test.go index b8e61844b..70d8be64a 100644 --- a/discovery/consul/consul_test.go +++ b/discovery/consul/consul_test.go @@ -34,7 +34,7 @@ func TestConfiguredService(t *testing.T) { consulDiscovery, err := NewDiscovery(conf, nil) if err != nil { - t.Errorf("Unexpected error when initialising discovery %v", err) + t.Errorf("Unexpected error when initializing discovery %v", err) } if !consulDiscovery.shouldWatch("configuredServiceName", []string{""}) { t.Errorf("Expected service %s to be watched", "configuredServiceName") @@ -52,7 +52,7 @@ func TestConfiguredServiceWithTag(t *testing.T) { consulDiscovery, err := NewDiscovery(conf, nil) if err != nil { - t.Errorf("Unexpected error when initialising discovery %v", err) + t.Errorf("Unexpected error when initializing discovery %v", err) } if consulDiscovery.shouldWatch("configuredServiceName", []string{""}) { t.Errorf("Expected service %s to not be watched without tag", "configuredServiceName") @@ -73,7 +73,7 @@ func TestNonConfiguredService(t *testing.T) { consulDiscovery, err := NewDiscovery(conf, nil) if err != nil { - t.Errorf("Unexpected error when initialising discovery %v", err) + t.Errorf("Unexpected error when initializing discovery %v", err) } if !consulDiscovery.shouldWatch("nonConfiguredServiceName", []string{""}) { t.Errorf("Expected service %s to be watched", "nonConfiguredServiceName") diff --git a/discovery/dns/dns.go b/discovery/dns/dns.go index 17e7dad0e..dff36f770 100644 --- a/discovery/dns/dns.go +++ b/discovery/dns/dns.go @@ -214,7 +214,7 @@ func (d *Discovery) refresh(ctx context.Context, name string, ch chan<- []*targe // // There are three possible outcomes: // -// 1. One of the permutations of the given name is recognised as +// 1. One of the permutations of the given name is recognized as // "valid" by the DNS, in which case we consider ourselves "done" // and that answer is returned. Note that, due to the way the DNS // handles "name has resource records, but none of the specified type", diff --git a/discovery/kubernetes/client_metrics.go b/discovery/kubernetes/client_metrics.go index 25621f956..37d6924a7 100644 --- a/discovery/kubernetes/client_metrics.go +++ b/discovery/kubernetes/client_metrics.go @@ -241,6 +241,6 @@ func (f *clientGoWorkqueueMetricsProvider) NewWorkDurationMetric(name string) wo }) } func (clientGoWorkqueueMetricsProvider) NewRetriesMetric(name string) workqueue.CounterMetric { - // Retries are not used so the metric is ommited. + // Retries are not used so the metric is omitted. return noopMetric{} } diff --git a/discovery/kubernetes/endpoints.go b/discovery/kubernetes/endpoints.go index c0c3146e6..b201239ad 100644 --- a/discovery/kubernetes/endpoints.go +++ b/discovery/kubernetes/endpoints.go @@ -150,7 +150,7 @@ func (e *Endpoints) process(ctx context.Context, ch chan<- []*targetgroup.Group) namespace, name, err := cache.SplitMetaNamespaceKey(key) if err != nil { - level.Error(e.logger).Log("msg", "spliting key failed", "key", key) + level.Error(e.logger).Log("msg", "splitting key failed", "key", key) return true } diff --git a/discovery/marathon/marathon_test.go b/discovery/marathon/marathon_test.go index 0307efdb6..8764e947a 100644 --- a/discovery/marathon/marathon_test.go +++ b/discovery/marathon/marathon_test.go @@ -332,7 +332,7 @@ func Test500ErrorHttpResponseWithValidJSONBody(t *testing.T) { }() // Setup conf for the test case. conf = SDConfig{Servers: []string{ts.URL}} - // Execute test case and validate behaviour. + // Execute test case and validate behavior. if err := testUpdateServices(client, ch); err == nil { t.Fatalf("Expected error for 5xx HTTP response from marathon server") } diff --git a/docs/querying/operators.md b/docs/querying/operators.md index 71adbb8ef..fc8261f6d 100644 --- a/docs/querying/operators.md +++ b/docs/querying/operators.md @@ -51,7 +51,7 @@ The following binary comparison operators exist in Prometheus: * `<=` (less-or-equal) Comparison operators are defined between scalar/scalar, vector/scalar, -and vector/vector value pairs. By default they filter. Their behaviour can be +and vector/vector value pairs. By default they filter. Their behavior can be modified by providing `bool` after the operator, which will return `0` or `1` for the value rather than filtering. diff --git a/documentation/internal_architecture.md b/documentation/internal_architecture.md index dfa572065..256e14bd1 100644 --- a/documentation/internal_architecture.md +++ b/documentation/internal_architecture.md @@ -75,7 +75,7 @@ Whenever the scrape manager receives an updated list of targets for a given scra ### Target hashing and scrape timing -To spread out scrapes within a scrape pool and in a consistenly slotted way across the `scrape_config`'s scrape interval, each target is [hashed by its label set and its final scrape URL](https://github.com/prometheus/prometheus/blob/v2.3.1/scrape/target.go#L75-L82). This hash is then used to [choose a deterministic offset](https://github.com/prometheus/prometheus/blob/v2.3.1/scrape/target.go#L84-L98) within that interval. +To spread out scrapes within a scrape pool and in a consistently slotted way across the `scrape_config`'s scrape interval, each target is [hashed by its label set and its final scrape URL](https://github.com/prometheus/prometheus/blob/v2.3.1/scrape/target.go#L75-L82). This hash is then used to [choose a deterministic offset](https://github.com/prometheus/prometheus/blob/v2.3.1/scrape/target.go#L84-L98) within that interval. ### Target scrapes diff --git a/notifier/notifier.go b/notifier/notifier.go index 3b31c8fb4..d1c7814ab 100644 --- a/notifier/notifier.go +++ b/notifier/notifier.go @@ -596,7 +596,7 @@ func (s *alertmanagerSet) sync(tgs []*targetgroup.Group) { continue } - // This will initialise the Counters for the AM to 0. + // This will initialize the Counters for the AM to 0. s.metrics.sent.WithLabelValues(us) s.metrics.errors.WithLabelValues(us) diff --git a/pkg/value/value.go b/pkg/value/value.go index a10f8f33c..655ce852d 100644 --- a/pkg/value/value.go +++ b/pkg/value/value.go @@ -21,7 +21,7 @@ const ( // NormalNaN is a quiet NaN. This is also math.NaN(). NormalNaN uint64 = 0x7ff8000000000001 - // StaleNaN is a signalling NaN, due to the MSB of the mantissa being 0. + // StaleNaN is a signaling NaN, due to the MSB of the mantissa being 0. // This value is chosen with many leading 0s, so we have scope to store more // complicated values in the future. It is 2 rather than 1 to make // it easier to distinguish from the NormalNaN by a human when debugging. diff --git a/promql/engine.go b/promql/engine.go index 9d22723a8..1d6620500 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -70,7 +70,7 @@ type ( ErrQueryTimeout string // ErrQueryCanceled is returned if a query was canceled during processing. ErrQueryCanceled string - // ErrTooManySamples is returned if a query would woud load more than the maximum allowed samples into memory. + // ErrTooManySamples is returned if a query would load more than the maximum allowed samples into memory. ErrTooManySamples string // ErrStorage is returned if an error was encountered in the storage layer // during query handling. diff --git a/promql/functions.go b/promql/functions.go index 0a64c32d7..baae0c3fb 100644 --- a/promql/functions.go +++ b/promql/functions.go @@ -43,7 +43,7 @@ type Function struct { // enh.out is a pre-allocated empty vector that you may use to accumulate // output before returning it. The vectors in vals should not be returned.a // Range vector functions need only return a vector with the right value, - // the metric and timestamp are not neded. + // the metric and timestamp are not needed. // Instant vector functions need only return a vector with the right values and // metrics, the timestamp are not needed. // Scalar results should be returned as the value of a sample in a Vector. diff --git a/promql/testdata/functions.test b/promql/testdata/functions.test index fc1668e33..f4d8fed6c 100644 --- a/promql/testdata/functions.test +++ b/promql/testdata/functions.test @@ -498,7 +498,7 @@ eval instant at 0m year(vector(1230767999)) eval instant at 0m year(vector(1230768000)) {} 2009 -# 2016-02-29 23:59:59 Febuary 29th in leap year. +# 2016-02-29 23:59:59 February 29th in leap year. eval instant at 0m month(vector(1456790399)) + day_of_month(vector(1456790399)) / 100 {} 2.29 @@ -506,11 +506,11 @@ eval instant at 0m month(vector(1456790399)) + day_of_month(vector(1456790399)) eval instant at 0m month(vector(1456790400)) + day_of_month(vector(1456790400)) / 100 {} 3.01 -# Febuary 1st 2016 in leap year. +# February 1st 2016 in leap year. eval instant at 0m days_in_month(vector(1454284800)) {} 29 -# Febuary 1st 2017 not in leap year. +# February 1st 2017 not in leap year. eval instant at 0m days_in_month(vector(1485907200)) {} 28 diff --git a/promql/value.go b/promql/value.go index 961f83184..e63c8ce37 100644 --- a/promql/value.go +++ b/promql/value.go @@ -141,7 +141,7 @@ func (vec Vector) String() string { } // ContainsSameLabelset checks if a vector has samples with the same labelset -// Such a behaviour is semantically undefined +// Such a behavior is semantically undefined // https://github.com/prometheus/prometheus/issues/4562 func (vec Vector) ContainsSameLabelset() bool { l := make(map[uint64]struct{}, len(vec)) @@ -184,7 +184,7 @@ func (m Matrix) Less(i, j int) bool { return labels.Compare(m[i].Metric, m[j].Me func (m Matrix) Swap(i, j int) { m[i], m[j] = m[j], m[i] } // ContainsSameLabelset checks if a matrix has samples with the same labelset -// Such a behaviour is semantically undefined +// Such a behavior is semantically undefined // https://github.com/prometheus/prometheus/issues/4562 func (m Matrix) ContainsSameLabelset() bool { l := make(map[uint64]struct{}, len(m)) diff --git a/rules/alerting.go b/rules/alerting.go index 813ff71af..8a16001f8 100644 --- a/rules/alerting.go +++ b/rules/alerting.go @@ -480,7 +480,7 @@ func (r *AlertingRule) String() string { byt, err := yaml.Marshal(ar) if err != nil { - return fmt.Sprintf("error marshalling alerting rule: %s", err.Error()) + return fmt.Sprintf("error marshaling alerting rule: %s", err.Error()) } return string(byt) @@ -515,7 +515,7 @@ func (r *AlertingRule) HTMLSnippet(pathPrefix string) html_template.HTML { byt, err := yaml.Marshal(ar) if err != nil { - return html_template.HTML(fmt.Sprintf("error marshalling alerting rule: %q", html_template.HTMLEscapeString(err.Error()))) + return html_template.HTML(fmt.Sprintf("error marshaling alerting rule: %q", html_template.HTMLEscapeString(err.Error()))) } return html_template.HTML(byt) } diff --git a/rules/manager_test.go b/rules/manager_test.go index 60f25cc52..b52cd8ff2 100644 --- a/rules/manager_test.go +++ b/rules/manager_test.go @@ -558,7 +558,7 @@ func TestStaleness(t *testing.T) { testutil.Equals(t, want, samples) } -// Convert a SeriesSet into a form useable with reflect.DeepEqual. +// Convert a SeriesSet into a form usable with reflect.DeepEqual. func readSeriesSet(ss storage.SeriesSet) (map[string][]promql.Point, error) { result := map[string][]promql.Point{} diff --git a/rules/recording.go b/rules/recording.go index f9c94f387..36af49586 100644 --- a/rules/recording.go +++ b/rules/recording.go @@ -111,7 +111,7 @@ func (rule *RecordingRule) String() string { byt, err := yaml.Marshal(r) if err != nil { - return fmt.Sprintf("error marshalling recording rule: %q", err.Error()) + return fmt.Sprintf("error marshaling recording rule: %q", err.Error()) } return string(byt) @@ -189,7 +189,7 @@ func (rule *RecordingRule) HTMLSnippet(pathPrefix string) template.HTML { byt, err := yaml.Marshal(r) if err != nil { - return template.HTML(fmt.Sprintf("error marshalling recording rule: %q", template.HTMLEscapeString(err.Error()))) + return template.HTML(fmt.Sprintf("error marshaling recording rule: %q", template.HTMLEscapeString(err.Error()))) } return template.HTML(byt) diff --git a/scrape/scrape.go b/scrape/scrape.go index 1eeb447ce..7fcc41d36 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -870,7 +870,7 @@ func (sl *scrapeLoop) endOfRunStaleness(last time.Time, ticker *time.Ticker, int // Scraping has stopped. We want to write stale markers but // the target may be recreated, so we wait just over 2 scrape intervals // before creating them. - // If the context is cancelled, we presume the server is shutting down + // If the context is canceled, we presume the server is shutting down // and will restart where is was. We do not attempt to write stale markers // in this case. diff --git a/storage/buffer.go b/storage/buffer.go index fe89ce200..b2b97967c 100644 --- a/storage/buffer.go +++ b/storage/buffer.go @@ -162,7 +162,7 @@ func (r *sampleRing) reset() { r.f = 0 } -// Returns the current iterator. Invalidates previously retuned iterators. +// Returns the current iterator. Invalidates previously returned iterators. func (r *sampleRing) iterator() SeriesIterator { r.it.r = r r.it.i = -1 diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 85811dbca..2db0e4f9a 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -189,7 +189,7 @@ func NewQueueManager(logger log.Logger, cfg config.QueueConfig, externalLabels m numShards.WithLabelValues(t.queueName).Set(float64(t.numShards)) shardCapacity.WithLabelValues(t.queueName).Set(float64(t.cfg.Capacity)) - // Initialise counter labels to zero. + // Initialize counter labels to zero. sentBatchDuration.WithLabelValues(t.queueName) succeededSamplesTotal.WithLabelValues(t.queueName) failedSamplesTotal.WithLabelValues(t.queueName) diff --git a/web/api/v1/api.go b/web/api/v1/api.go index bb883eefa..e02b62a7d 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -1082,7 +1082,7 @@ func (api *API) respond(w http.ResponseWriter, data interface{}) { Data: data, }) if err != nil { - level.Error(api.logger).Log("msg", "error marshalling json response", "err", err) + level.Error(api.logger).Log("msg", "error marshaling json response", "err", err) http.Error(w, err.Error(), http.StatusInternalServerError) return } @@ -1103,7 +1103,7 @@ func (api *API) respondError(w http.ResponseWriter, apiErr *apiError, data inter Data: data, }) if err != nil { - level.Error(api.logger).Log("msg", "error marshalling json response", "err", err) + level.Error(api.logger).Log("msg", "error marshaling json response", "err", err) http.Error(w, err.Error(), http.StatusInternalServerError) return }