Skip to content

Commit

Permalink
Fix typos, wording and grammar (#3410)
Browse files Browse the repository at this point in the history
  • Loading branch information
darxriggs authored Apr 5, 2023
1 parent ed94049 commit 99aba52
Show file tree
Hide file tree
Showing 193 changed files with 313 additions and 322 deletions.
6 changes: 3 additions & 3 deletions .drone/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Drone](https://www.drone.io/) is a CI tool integrated with github that we use for automated testing and building/publishing docker images.
[Drone](https://www.drone.io/) is a CI tool integrated with GitHub that we use for automated testing and building/publishing docker images.

# Table of Contents
1. [Release Preparation](#release-preparation)
Expand All @@ -12,7 +12,7 @@ be regenerated and re-signed using `make drone`. Signing the drone
configuration is limited to Grafana employees for security reasons.

1. [Install Drone](https://docs.drone.io/cli/install/).
2. Setup the Drone environment variables. Their contents are on
2. Set up the Drone environment variables. Their contents are on
[your profile](https://drone.grafana.net/account) in the Grafana Drone web page.
```
export DRONE_SERVER=<url>
Expand Down Expand Up @@ -54,7 +54,7 @@ Run the Drone stack locally following the drone documentation
1. Fork the repo.
2. Start ngrok to get the public endpoint.
3. Create and update the drone config files with the public endpoint.
4. Configure an oath2 app in github with the public endpoint.
4. Configure an oath2 app in GitHub with the public endpoint.
5. Activate the repo in the drone server and configure it to point to `.drone/drone.yml`.

Pros
Expand Down
2 changes: 1 addition & 1 deletion .github/depcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ go_modules:
- go.opentelemetry.io/collector
- sigs.k8s.io/controller-runtime

# List of Github repos to check for newer tags. Only repos that are not listed
# List of GitHub repos to check for newer tags. Only repos that are not listed
# explicitly in go.mod *OR* are in go.mod but replaced with a fork should be
# added here.
#
Expand Down
2 changes: 1 addition & 1 deletion ADOPTERS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is the list of organizations, organized alphebetically, that are using the Grafana Agent in
This is the list of organizations, organized alphabetically, that are using the Grafana Agent in
production environments. Please send PRs to add or remove organizations.

* [AB Tasty](https://www.abtasty.com/)
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ v0.19.0 (2021-09-29)

### Features

- Added [Github exporter](https://github.com/infinityworks/github-exporter)
- Added [GitHub exporter](https://github.com/infinityworks/github-exporter)
integration. (@rgeyer)

- Add TLS config options for tempo `remote_write`s. (@mapno)
Expand Down Expand Up @@ -1535,7 +1535,7 @@ v0.18.0 (2021-07-29)

### Features

- Added [Github exporter](https://github.com/infinityworks/github-exporter)
- Added [GitHub exporter](https://github.com/infinityworks/github-exporter)
integration. (@rgeyer)

- Add support for OTLP HTTP trace exporting. (@mapno)
Expand Down Expand Up @@ -1621,7 +1621,7 @@ v0.15.0 (2021-06-03)
- Update Loki dependency to d88f3996eaa2. This is a non-release build, and was
needed to support exemplars. (@mapno)

- Update Cortex dependency to to d382e1d80eaf. This is a non-release build, and
- Update Cortex dependency to d382e1d80eaf. This is a non-release build, and
was needed to support exemplars. (@mapno)

### Bugfixes
Expand Down Expand Up @@ -2078,7 +2078,7 @@ v0.7.0 (2020-10-23)
- The instance label written from replace_instance_label can now be overwritten
with relabel_configs. This bugfix slightly modifies the behavior of what data
is stored. The final instance label will now be stored in the WAL rather than
computed by remote_write. This change should not negatively effect existing
computed by remote_write. This change should not negatively affect existing
users. (@rfratto)

v0.6.1 (2020-04-11)
Expand Down
2 changes: 1 addition & 1 deletion cmd/grafana-agent/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func NewEntrypoint(logger *server.Logger, cfg *config.Config, reloader Reloader)

ep.wire(ep.srv.HTTP, ep.srv.GRPC)

// Mostly everything should be up to date except for the server, which hasn't
// Mostly everything should be up-to-date except for the server, which hasn't
// been created yet.
if err := ep.ApplyConfig(*cfg); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion cmd/grafana-agent/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func IsWindowsService() bool {
return false
}

// RunService runs the current process as a Windows servce. On non-Windows platforms,
// RunService runs the current process as a Windows service. On non-Windows platforms,
// this is always a no-op.
func RunService() error {
return nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/grafana-agentctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func operatorDetachCmd() *cobra.Command {
continue
}

level.Info(logger).Log("msg", "detatching ownerreferences for object", "resource", gvk.Kind, "namespace", obj.GetNamespace(), "name", obj.GetName())
level.Info(logger).Log("msg", "detaching ownerreferences for object", "resource", gvk.Kind, "namespace", obj.GetNamespace(), "name", obj.GetName())
obj.SetOwnerReferences(filtered)

if err := cli.Update(context.Background(), obj); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion component/common/config/types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package config contains types from github.com/prometheus/common/config,
// but modifiys them to be serializable with River.
// but modifies them to be serializable with River.
package config

import (
Expand Down
2 changes: 1 addition & 1 deletion component/common/loki/positions/positions.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type positions struct {
done chan struct{}
}

// Entry desribes a positions file entry consisting of an absolute file path and
// Entry describes a positions file entry consisting of an absolute file path and
// the matching label set.
// An entry expects the string representation of a LabelSet or a Labels slice
// so that it can be utilized as a YAML key. The caller should make sure that
Expand Down
2 changes: 1 addition & 1 deletion component/common/loki/positions/write_positions_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
yaml "gopkg.in/yaml.v2"
)

// writePositionFile is a fall back for Windows because renameio does not support Windows.
// writePositionFile is a fallback for Windows because renameio does not support Windows.
// See https://github.com/google/renameio#windows-support
func writePositionFile(filename string, positions map[Entry]string) error {
buf, err := yaml.Marshal(File{
Expand Down
4 changes: 2 additions & 2 deletions component/common/loki/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type InstrumentedEntryHandler interface {
}

// EntryHandler is something that can "handle" entries via a channel.
// Stop must be called to gracefully shutdown the EntryHandler
// Stop must be called to gracefully shut down the EntryHandler
type EntryHandler interface {
Chan() chan<- Entry
Stop()
Expand Down Expand Up @@ -77,7 +77,7 @@ func (e entryHandler) Stop() {
e.stop()
}

// NewEntryHandler creates a new EntryHandler using a input channel and a stop function.
// NewEntryHandler creates a new EntryHandler using an input channel and a stop function.
func NewEntryHandler(entries chan<- Entry, stop func()) EntryHandler {
return entryHandler{
stop: stop,
Expand Down
2 changes: 1 addition & 1 deletion component/component_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (ht HealthType) MarshalText() (text []byte, err error) {
return []byte(ht.String()), nil
}

// UnmarshalText implments encoding.TextUnmarshaler.
// UnmarshalText implements encoding.TextUnmarshaler.
func (ht *HealthType) UnmarshalText(text []byte) error {
switch string(text) {
case "healthy":
Expand Down
2 changes: 1 addition & 1 deletion component/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (c *Component) Run(ctx context.Context) error {
}
}

// Update implements component.Compnoent.
// Update implements component.Component.
func (c *Component) Update(args component.Arguments) error {
disc, err := c.creator(args)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion component/discovery/relabel/relabel.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Arguments struct {
// Targets contains the input 'targets' passed by a service discovery component.
Targets []discovery.Target `river:"targets,attr"`

// The relabelling rules to apply to the each target's label set.
// The relabelling rules to apply to each target's label set.
RelabelConfigs []*flow_relabel.Config `river:"rule,block,optional"`
}

Expand Down
2 changes: 1 addition & 1 deletion component/local/file/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (fsn *fsNotify) wait(ctx context.Context) {

case err := <-fsn.watcher.Errors:
// The fsnotify watcher can generate errors for OS-level reasons (watched
// failed, failed when closing the file, etc). We don't know if the error
// failed, failed when closing the file, etc.). We don't know if the error
// is related to the file, so we always treat it as if the file updated.
//
// This will force the component to reload the file and report the error
Expand Down
2 changes: 1 addition & 1 deletion component/local/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (c *Component) readFile() error {
return nil
}

// Update implements component.Compnoent.
// Update implements component.Component.
func (c *Component) Update(args component.Arguments) error {
newArgs := args.(Arguments)

Expand Down
2 changes: 1 addition & 1 deletion component/local/file/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestFile_ImmediateExports(t *testing.T) {
}, tc.Exports())
}

// TestFile_ExistOnLoad ensures that the the configured file must exist on the
// TestFile_ExistOnLoad ensures that the configured file must exist on the
// first load of local.file.
func TestFile_ExistOnLoad(t *testing.T) {
testFile := filepath.Join(t.TempDir(), "testfile")
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/fake/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *Client) Name() string {
return "fake"
}

// Clear is used to cleanup the buffered received entries, so the same client can be re-used between
// Clear is used to clean up the buffered received entries, so the same client can be re-used between
// test cases.
func (c *Client) Clear() {
c.mtx.Lock()
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/metric/counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (c *CounterConfig) UnmarshalRiver(f func(v interface{}) error) error {
return nil
}

// Counters is a vec tor of counters for a each log stream.
// Counters is a vector of counters for a log stream.
type Counters struct {
*metricVec
Cfg *CounterConfig
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/metric/gauges.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (g *GaugeConfig) UnmarshalRiver(f func(v interface{}) error) error {
return nil
}

// Gauges is a vector of gauges for a each log stream.
// Gauges is a vector of gauges for a log stream.
type Gauges struct {
*metricVec
Cfg *GaugeConfig
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/metric/histograms.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (h *HistogramConfig) UnmarshalRiver(f func(v interface{}) error) error {
return nil
}

// Histograms is a vector of histograms for a each log stream.
// Histograms is a vector of histograms for a log stream.
type Histograms struct {
*metricVec
Cfg *HistogramConfig
Expand Down
4 changes: 2 additions & 2 deletions component/loki/process/internal/stages/drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (m *dropStage) shouldDrop(e Entry) bool {
}
}
} else {
// Not found in extact map, don't drop
// Not found in extracted map, don't drop
level.Debug(m.logger).Log("msg", "line will not be dropped, the provided source was not found in the extracted map")
return false
}
Expand All @@ -162,7 +162,7 @@ func (m *dropStage) shouldDrop(e Entry) bool {
// regex match, will be dropped
level.Debug(m.logger).Log("msg", "line met drop criteria, regex matched the value in the extracted map source key")
} else {
// Not found in extact map, don't drop
// Not found in extracted map, don't drop
level.Debug(m.logger).Log("msg", "line will not be dropped, the provided source was not found in the extracted map")
return false
}
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/stages/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (j *jsonStage) Run(in chan Entry) chan Entry {

func (j *jsonStage) processEntry(extracted map[string]interface{}, entry *string) error {
// If a source key is provided, the json stage should process it
// from the extracted map, otherwise should fallback to the entry
// from the extracted map, otherwise should fall back to the entry
input := entry

if j.cfg.Source != nil {
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/stages/logfmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func newLogfmtStage(logger log.Logger, config LogfmtConfig) (Stage, error) {
// Process implements Stage
func (j *logfmtStage) Process(labels model.LabelSet, extracted map[string]interface{}, t *time.Time, entry *string) {
// If a source key is provided, the logfmt stage should process it
// from the extracted map, otherwise should fallback to the entry
// from the extracted map, otherwise should fall back to the entry
input := entry

if j.cfg.Source != "" {
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/stages/regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func parseRegexConfig(config interface{}) (*RegexConfig, error) {
// Process implements Stage
func (r *regexStage) Process(labels model.LabelSet, extracted map[string]interface{}, t *time.Time, entry *string) {
// If a source key is provided, the regex stage should process it
// from the extracted map, otherwise should fallback to the entry
// from the extracted map, otherwise should fall back to the entry
input := entry

if r.config.Source != nil {
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/stages/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func newReplaceStage(logger log.Logger, config ReplaceConfig) (Stage, error) {
// Process implements Stage
func (r *replaceStage) Process(labels model.LabelSet, extracted map[string]interface{}, t *time.Time, entry *string) {
// If a source key is provided, the replace stage should process it
// from the extracted map, otherwise should fallback to the entry
// from the extracted map, otherwise should fall back to the entry
input := entry

if r.cfg.Source != "" {
Expand Down
4 changes: 2 additions & 2 deletions component/loki/process/internal/stages/replace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ stage.replace {
}
`

var testReplaceRiverWithNamedCaputedGroupWithTemplate = `
var testReplaceRiverWithNamedCapturedGroupWithTemplate = `
stage.replace {
expression = "^(?P<ip>\\S+) (?P<identd>\\S+) (?P<user>\\S+) \\[(?P<timestamp>[\\w:/]+\\s[+\\-]\\d{4})\\] \"(?P<action>\\S+)\\s?(?P<path>\\S+)?\\s?(?P<protocol>\\S+)?\" (?P<status>\\d{3}|-) (\\d+|-)\\s?\"?(?P<referer>[^\"]*)\"?\\s?\"?(?P<useragent>[^\"]*)?\"?$"
replace = "{{ if eq .Value \"200\" }}{{ Replace .Value \"200\" \"HttpStatusOk\" -1 }}{{ else }}{{ .Value | ToUpper }}{{ end }}"
Expand Down Expand Up @@ -98,7 +98,7 @@ func TestReplace(t *testing.T) {
`{"time":"2019-01-01T01:00:00.000000001Z", "level": "info", "msg": "11.11.11.11 - \"POST /loki/api/push/ HTTP/1.1\" 200 932 \"-\" \"Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 GTB6\""}`,
},
"successfully run a pipeline with 1 regex stage with named captured group and with template and without source": {
testReplaceRiverWithNamedCaputedGroupWithTemplate,
testReplaceRiverWithNamedCapturedGroupWithTemplate,
testReplaceLogLine,
map[string]interface{}{
"ip": "11.11.11.11",
Expand Down
2 changes: 1 addition & 1 deletion component/loki/process/internal/stages/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func New(logger log.Logger, jobName *string, cfg StageConfig, registerer prometh
return nil, err
}
default:
panic("unreacheable; should have decoded into one of the StageConfig fields")
panic("unreachable; should have decoded into one of the StageConfig fields")
}
return s, nil
}
2 changes: 1 addition & 1 deletion component/loki/process/internal/stages/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *tenantStage) Process(labels model.LabelSet, extracted map[string]interf
tenantID = s.cfg.Value
}

// Skip an empty tenant ID (ie. failed to get the tenant from the source)
// Skip an empty tenant ID (i.e. failed to get the tenant from the source)
if tenantID == "" {
return
}
Expand Down
8 changes: 4 additions & 4 deletions component/loki/process/internal/stages/timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ func validateTimestampConfig(cfg TimestampConfig) (parser, error) {

if len(cfg.FallbackFormats) > 0 {
multiConvertDateLayout := func(input string) (time.Time, error) {
orignalTime, originalErr := convertDateLayout(cfg.Format, loc)(input)
originalTime, originalErr := convertDateLayout(cfg.Format, loc)(input)
if originalErr == nil {
return orignalTime, originalErr
return originalTime, originalErr
}
for i := 0; i < len(cfg.FallbackFormats); i++ {
if t, err := convertDateLayout(cfg.FallbackFormats[i], loc)(input); err == nil {
return t, err
}
}
return orignalTime, originalErr
return originalTime, originalErr
}
return multiConvertDateLayout, nil
}
Expand Down Expand Up @@ -198,7 +198,7 @@ func (ts *timestampStage) processActionOnFailureFudge(labels model.LabelSet, t *
labelsStr := labels.String()
lastTimestamp, ok := ts.lastKnownTimestamps.Get(labelsStr)

// If the last known timestamp is unknown (ie. has not been successfully parsed yet)
// If the last known timestamp is unknown (i.e. has not been successfully parsed yet)
// there's nothing we can do, so we're going to keep the current timestamp
if !ok {
return
Expand Down
4 changes: 2 additions & 2 deletions component/loki/process/internal/stages/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func convertDateLayout(predef string, location *time.Location) parser {

// parseTimestampWithoutYear parses the input timestamp without the year component,
// assuming the timestamp is related to a point in time close to "now", and correctly
// handling the edge cases around new year's eve
// handling the edge cases around New Year's Eve
func parseTimestampWithoutYear(layout string, location *time.Location, timestamp string, now time.Time) (time.Time, error) {
var parsedTime time.Time
var err error
Expand All @@ -154,7 +154,7 @@ func parseTimestampWithoutYear(layout string, location *time.Location, timestamp
return parsedTime, fmt.Errorf(ErrTimestampContainsYear, timestamp)
}

// Handle the case we're crossing the new year's eve midnight
// Handle the case we're crossing the New Year's Eve midnight
if parsedTime.Month() == 12 && now.Month() == 1 {
parsedTime = parsedTime.AddDate(now.Year()-1, 0, 0)
} else if parsedTime.Month() == 1 && now.Month() == 12 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"go.uber.org/atomic"
)

// The minimun window size is 1 minute.
// The minimum window size is 1 minute.
const minDelay = time.Minute

var cloudflareTooEarlyError = regexp.MustCompile(`too early: logs older than \S+ are not available`)
Expand Down Expand Up @@ -116,8 +116,8 @@ func (t *Target) start() {
}
start := end.Add(-time.Duration(t.config.PullRange))
requests := splitRequests(start, end, t.config.Workers)
// Use background context for workers as we don't want to cancel half way through.
// In case of errors we stop the target, each worker has it's own retry logic.
// Use background context for workers as we don't want to cancel halfway through.
// In case of errors we stop the target, each worker has its own retry logic.
if err := concurrency.ForEachJob(context.Background(), len(requests), t.config.Workers, func(ctx context.Context, idx int) error {
request := requests[idx]
return t.pull(ctx, request.start, request.end)
Expand Down
Loading

0 comments on commit 99aba52

Please sign in to comment.