Skip to content

Commit ff1120b

Browse files
committed
Fix typos
1 parent 1d3baa2 commit ff1120b

File tree

66 files changed

+126
-126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+126
-126
lines changed

RELEASE_NOTES

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Enhancements:
6262
Amazon CloudWatch Agent 1.300044.0 (2024-08-14)
6363
========================================================================
6464
Bug Fixes:
65-
* [ContainerInsights] Update GPU usage metrics emitted
65+
* [ContainerInsights] Update GPU usage metrics emitted
6666
* [ContainerInsights] Deprecate runtime tag from neuron metrics to fix false average calculation
6767

6868
Enhancements:
@@ -199,7 +199,7 @@ Enhancements:
199199
Amazon CloudWatch Agent 1.300033.0 (2024-01-31)
200200
========================================================================
201201

202-
Enchancements:
202+
Enhancements:
203203
* [AppSignals] Log correlation
204204
* [AppSignals] New Metric Rollup
205205
* [AppSignals] Add metrics cardinality control

THIRD-PARTY

+1-1
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17051705

17061706

17071707
-------
1708-
internal/common/binary.go in the gopsutil is copied and modifid from
1708+
internal/common/binary.go in the gopsutil is copied and modified from
17091709
golang/encoding/binary.go.
17101710

17111711

cfg/aws/aws_sdk_logging.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var sdkLogLevel aws.LogLevelType = aws.LogOff
2727
// The levels are a bit field that is OR'd together.
2828
// So the user can specify multiple levels and we OR them together.
2929
// Example: "aws_sdk_log_level": "LogDebugWithSigning | LogDebugWithRequestErrors".
30-
// JSON string value must contain the levels seperated by "|" and optionally whitespace.
30+
// JSON string value must contain the levels separated by "|" and optionally whitespace.
3131
func SetSDKLogLevel(sdkLogLevelString string) {
3232
var temp aws.LogLevelType = aws.LogOff
3333

cfg/aws/refreshable_shared_credentials_provider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Refreshable_shared_credentials_provider struct {
1313
credentials.Expiry
1414
sharedCredentialsProvider *credentials.SharedCredentialsProvider
1515

16-
// Retrival frequency, if the value is 15 minutes, the credentials will be retrieved every 15 minutes.
16+
// Retrieval frequency, if the value is 15 minutes, the credentials will be retrieved every 15 minutes.
1717
ExpiryWindow time.Duration
1818
}
1919

internal/httpclient/httpclient.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (h *HttpClient) request(endpoint string) ([]byte, error) {
8484
}
8585

8686
if len(body) == maxHttpResponseLength {
87-
return nil, fmt.Errorf("response from %s, execeeds the maximum length: %v", endpoint, maxHttpResponseLength)
87+
return nil, fmt.Errorf("response from %s, exceeds the maximum length: %v", endpoint, maxHttpResponseLength)
8888
}
8989
return body, nil
9090
}

internal/k8sCommon/k8sclient/node.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func createNodeListWatch(client kubernetes.Interface) cache.ListerWatcher {
166166
return &cache.ListWatch{
167167
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
168168
opts.ResourceVersion = ""
169-
// Passing emput context as this was not required by old List()
169+
// Passing empty context as this was not required by old List()
170170
return client.CoreV1().Nodes().List(ctx, opts)
171171
},
172172
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {

internal/logscommon/const.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const (
1111

1212
//Field key in metrics indicting if the line is the start of the multiline.
1313
//If this key is not present, it means the multiline mode is not enabled,
14-
// we set it to true, it indicates it is a real event, but not part of a mulltiple line.
14+
// we set it to true, it indicates it is a real event, but not part of a multiple line.
1515
//If this key is false, it means the line is not start line of multiline entry.
1616
//If this key is true, it means the line is the start of multiline entry.
1717
MultiLineStartField = "multi_line_start"

internal/mapWithExpiry/mapWIthExpiry.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,38 @@ type mapEntry struct {
1212

1313
// MapWithExpiry act like a map which provide a method to clean up expired entries
1414
type MapWithExpiry struct {
15-
ttl time.Duration
16-
entris map[string]*mapEntry
15+
ttl time.Duration
16+
entries map[string]*mapEntry
1717
}
1818

1919
func NewMapWithExpiry(ttl time.Duration) *MapWithExpiry {
20-
return &MapWithExpiry{ttl: ttl, entris: make(map[string]*mapEntry)}
20+
return &MapWithExpiry{ttl: ttl, entries: make(map[string]*mapEntry)}
2121
}
2222

2323
func (m *MapWithExpiry) CleanUp(now time.Time) {
24-
for k, v := range m.entris {
24+
for k, v := range m.entries {
2525
if now.Sub(v.creation) >= m.ttl {
26-
delete(m.entris, k)
26+
delete(m.entries, k)
2727
}
2828
}
2929
}
3030

3131
func (m *MapWithExpiry) Get(key string) (interface{}, bool) {
32-
res, ok := m.entris[key]
32+
res, ok := m.entries[key]
3333
if ok {
3434
return res.content, true
3535
}
3636
return nil, false
3737
}
3838

3939
func (m *MapWithExpiry) Set(key string, content interface{}) {
40-
m.entris[key] = &mapEntry{content: content, creation: time.Now()}
40+
m.entries[key] = &mapEntry{content: content, creation: time.Now()}
4141
}
4242

4343
func (m *MapWithExpiry) Size() int {
44-
return len(m.entris)
44+
return len(m.entries)
4545
}
4646

4747
func (m *MapWithExpiry) Delete(key string) {
48-
delete(m.entris, key)
48+
delete(m.entries, key)
4949
}

internal/util/user/userutil.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func changeFileOwner(uid, gid int) error {
5555
}
5656

5757
// chownRecursive would recursively change the ownership of the directory
58-
// similar to `chown -R <dir>`, except it will igore any files that are:
58+
// similar to `chown -R <dir>`, except it will ignore any files that are:
5959
// - Executable
6060
// - With SUID or SGID bit set
6161
// - Allow anyone to write to
@@ -78,7 +78,7 @@ func chownRecursive(uid, gid int, dir string) error {
7878
}
7979

8080
// Do not change ownership of executable files
81-
// Perm() returns the lower 7 bit of permission of file, which represes rwxrwxrws
81+
// Perm() returns the lower 7 bit of permission of file, which represents rwxrwxrws
8282
// 0111 maps to --x--x--x, so it would check any user have the execution right
8383
if fmode.Perm()&0111 != 0 {
8484
return nil

licensing/THIRD-PARTY-LICENSES

+1-1
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17041704

17051705

17061706
-------
1707-
internal/common/binary.go in the gopsutil is copied and modifid from
1707+
internal/common/binary.go in the gopsutil is copied and modified from
17081708
golang/encoding/binary.go.
17091709

17101710

packaging/darwin/amazon-cloudwatch-agent-ctl

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ readonly OTEL_YAML="${CONFDIR}/amazon-cloudwatch-agent.yaml"
3030
readonly JSON="${CONFDIR}/amazon-cloudwatch-agent.json"
3131
readonly JSON_DIR="${CONFDIR}/amazon-cloudwatch-agent.d"
3232
readonly CV_LOG_FILE="${AGENTDIR}/logs/configuration-validation.log"
33-
readonly COMMON_CONIG="${CONFDIR}/common-config.toml"
33+
readonly COMMON_CONFIG="${CONFDIR}/common-config.toml"
3434

3535
readonly ALL_CONFIG='all'
3636

@@ -176,7 +176,7 @@ cwa_config() {
176176
if [ "${config_location}" = "${ALL_CONFIG}" ]; then
177177
rm -rf "${JSON_DIR}"/*
178178
else
179-
runDownloaderCommand=$("${CMDDIR}/config-downloader" --output-dir "${JSON_DIR}" --download-source "${config_location}" --mode ${mode} --config "${COMMON_CONIG}" --multi-config ${multi_config})
179+
runDownloaderCommand=$("${CMDDIR}/config-downloader" --output-dir "${JSON_DIR}" --download-source "${config_location}" --mode ${mode} --config "${COMMON_CONFIG}" --multi-config ${multi_config})
180180
echo "${runDownloaderCommand}"
181181
fi
182182

@@ -185,7 +185,7 @@ cwa_config() {
185185
rm -f "${TOML}"
186186
rm -f "${OTEL_YAML}"
187187
else
188-
runTranslatorCommand=$("${CMDDIR}/config-translator" --input "${JSON}" --input-dir "${JSON_DIR}" --output "${TOML}" --mode ${mode} --config "${COMMON_CONIG}" --multi-config ${multi_config})
188+
runTranslatorCommand=$("${CMDDIR}/config-translator" --input "${JSON}" --input-dir "${JSON_DIR}" --output "${TOML}" --mode ${mode} --config "${COMMON_CONFIG}" --multi-config ${multi_config})
189189
echo "${runTranslatorCommand}"
190190

191191
runAgentSchemaTestCommand="${CMDDIR}/amazon-cloudwatch-agent -schematest -config ${TOML}"

packaging/dependencies/amazon-cloudwatch-agent-ctl

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ readonly OTEL_YAML="${CONFDIR}/amazon-cloudwatch-agent.yaml"
1818
readonly JSON="${CONFDIR}/amazon-cloudwatch-agent.json"
1919
readonly JSON_DIR="${CONFDIR}/amazon-cloudwatch-agent.d"
2020
readonly CV_LOG_FILE="${AGENTDIR}/logs/configuration-validation.log"
21-
readonly COMMON_CONIG="${CONFDIR}/common-config.toml"
21+
readonly COMMON_CONFIG="${CONFDIR}/common-config.toml"
2222
readonly ENV_CONFIG="${CONFDIR}/env-config.json"
2323

2424
readonly CWA_NAME='amazon-cloudwatch-agent'
@@ -263,7 +263,7 @@ cwa_config() {
263263
if [ "${cwa_config_location}" = "${ALL_CONFIG}" ]; then
264264
rm -rf "${JSON_DIR}"/*
265265
else
266-
runDownloaderCommand=$("${CMDDIR}/config-downloader" --output-dir "${JSON_DIR}" --download-source "${cwa_config_location}" --mode ${param_mode} --config "${COMMON_CONIG}" --multi-config ${multi_config})
266+
runDownloaderCommand=$("${CMDDIR}/config-downloader" --output-dir "${JSON_DIR}" --download-source "${cwa_config_location}" --mode ${param_mode} --config "${COMMON_CONFIG}" --multi-config ${multi_config})
267267
echo ${runDownloaderCommand} || return
268268
fi
269269

@@ -273,7 +273,7 @@ cwa_config() {
273273
rm -f "${OTEL_YAML}"
274274
else
275275
echo "Start configuration validation..."
276-
runTranslatorCommand=$("${CMDDIR}/config-translator" --input "${JSON}" --input-dir "${JSON_DIR}" --output "${TOML}" --mode ${param_mode} --config "${COMMON_CONIG}" --multi-config ${multi_config})
276+
runTranslatorCommand=$("${CMDDIR}/config-translator" --input "${JSON}" --input-dir "${JSON_DIR}" --output "${TOML}" --mode ${param_mode} --config "${COMMON_CONFIG}" --multi-config ${multi_config})
277277
echo "${runTranslatorCommand}" || return
278278

279279
runAgentSchemaTestCommand="${CMDDIR}/amazon-cloudwatch-agent -schematest -config ${TOML}"

packaging/windows/amazon-cloudwatch-agent-ctl.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ $TOML="${CWAProgramData}\amazon-cloudwatch-agent.toml"
9191
$OTEL_YAML="${CWAProgramData}\amazon-cloudwatch-agent.yaml"
9292
$JSON="${CWAProgramData}\amazon-cloudwatch-agent.json"
9393
$JSON_DIR = "${CWAProgramData}\Configs"
94-
$COMMON_CONIG="${CWAProgramData}\common-config.toml"
94+
$COMMON_CONFIG="${CWAProgramData}\common-config.toml"
9595
$ENV_CONFIG="${CWAProgramData}\env-config.json"
9696

9797
$EC2 = $false
@@ -301,7 +301,7 @@ Function CWAConfig() {
301301
if ($ConfigLocation -eq $AllConfig) {
302302
Remove-Item -Path "${JSON_DIR}\*" -Force -ErrorAction SilentlyContinue
303303
} else {
304-
& $CWAProgramFiles\config-downloader.exe --output-dir "${JSON_DIR}" --download-source "${ConfigLocation}" --mode "${param_mode}" --config "${COMMON_CONIG}" --multi-config "${multi_config}"
304+
& $CWAProgramFiles\config-downloader.exe --output-dir "${JSON_DIR}" --download-source "${ConfigLocation}" --mode "${param_mode}" --config "${COMMON_CONFIG}" --multi-config "${multi_config}"
305305
CheckCMDResult
306306
}
307307

@@ -313,7 +313,7 @@ Function CWAConfig() {
313313
Remove-Item "${OTEL_YAML}" -Force -ErrorAction SilentlyContinue
314314
} else {
315315
Write-Output "Start configuration validation..."
316-
& cmd /c "`"$CWAProgramFiles\config-translator.exe`" --input ${JSON} --input-dir ${JSON_DIR} --output ${TOML} --mode ${param_mode} --config ${COMMON_CONIG} --multi-config ${multi_config} 2>&1"
316+
& cmd /c "`"$CWAProgramFiles\config-translator.exe`" --input ${JSON} --input-dir ${JSON_DIR} --output ${TOML} --mode ${param_mode} --config ${COMMON_CONFIG} --multi-config ${multi_config} 2>&1"
317317
CheckCMDResult
318318
# Let command pass so we can check return code and give user-friendly error-message
319319
$ErrorActionPreference = "Continue"

plugins/inputs/logfile/fileconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type FileConfig struct {
6161

6262
//Indicate whether to tail the log file from the beginning or not.
6363
//The default value for this field should be set as true in configuration.
64-
//Otherwise, it may skip some log entries for timestampFromLogLine suffix roatated new file.
64+
//Otherwise, it may skip some log entries for timestampFromLogLine suffix rotated new file.
6565
FromBeginning bool `toml:"from_beginning"`
6666
//Indicate whether it is a named pipe.
6767
Pipe bool `toml:"pipe"`

plugins/inputs/logfile/logfile.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (t *LogFile) Start(acc telegraf.Accumulator) error {
137137

138138
func (t *LogFile) Stop() {
139139
// Tailer srcs are stopped by log agent after the output plugin is stopped instead of here
140-
// because the tailersrc would like to record an accurate uploaded offset
140+
// because the tailerSrc would like to record an accurate uploaded offset
141141
close(t.done)
142142
}
143143

@@ -358,7 +358,7 @@ func (t *LogFile) cleanupStateFolder() {
358358
}
359359
for _, file := range files {
360360
if info, err := os.Stat(file); err != nil || info.IsDir() {
361-
t.Log.Debugf("File %v does not exist or is a dirctory: %v, %v", file, err, info)
361+
t.Log.Debugf("File %v does not exist or is a directory: %v, %v", file, err, info)
362362
continue
363363
}
364364

@@ -368,7 +368,7 @@ func (t *LogFile) cleanupStateFolder() {
368368

369369
byteArray, err := os.ReadFile(file)
370370
if err != nil {
371-
t.Log.Errorf("Error happens when reading the content from file %s in clean up state fodler step: %v", file, err)
371+
t.Log.Errorf("Error happens when reading the content from file %s in clean up state folder step: %v", file, err)
372372
continue
373373
}
374374
contentArray := strings.Split(string(byteArray), "\n")

plugins/inputs/logfile/logfile_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ append line`
553553
}
554554

555555
func TestLogsMultilineTimeout(t *testing.T) {
556-
// multline line starter as [^/s]
556+
// multiline line starter as [^/s]
557557
logEntryString1 := `multiline begin
558558
append line
559559
append line`

plugins/inputs/logfile/tail/tail.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type limiter interface {
5252

5353
// Config is used to specify how a file must be tailed.
5454
type Config struct {
55-
// File-specifc
55+
// File-specific
5656
Location *SeekInfo // Seek to this location before tailing
5757
ReOpen bool // Reopen recreated files (tail -F)
5858
MustExist bool // Fail early if the file does not exist
@@ -137,8 +137,8 @@ func TailFile(filename string, config Config) (*Tail, error) {
137137

138138
// Return the file's current position, like stdio's ftell().
139139
// But this value is not very accurate.
140-
// it may readed one line in the chan(tail.Lines),
141-
// so it may lost one line.
140+
// it may read one line in the chan(tail.Lines),
141+
// so it may lose one line.
142142
func (tail *Tail) Tell() (offset int64, err error) {
143143
if tail.file == nil {
144144
return

plugins/inputs/logfile/tailersrc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var (
2727
)
2828

2929
type fileOffset struct {
30-
seq, offset int64 // Seq handles file trucation, when file is trucated, we increase the offset seq
30+
seq, offset int64 // Seq handles file truncation, when file is truncated, we increase the offset seq
3131
}
3232

3333
func (fo *fileOffset) SetOffset(o int64) {

plugins/inputs/nvidia_smi/nvidia_smi_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestErrorBehaviorDefault(t *testing.T) {
3535
require.Error(t, plugin.Init())
3636
}
3737

38-
func TestErorBehaviorIgnore(t *testing.T) {
38+
func TestErrorBehaviorIgnore(t *testing.T) {
3939
// make sure we can't find nvidia-smi in $PATH somewhere
4040
os.Unsetenv("PATH")
4141
plugin := &NvidiaSMI{

plugins/inputs/prometheus/metrics_handler.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (mh *metricsHandler) handle(pmb PrometheusMetricBatch) {
6767
func (mh *metricsHandler) setEmfMetadata(mms []*metricMaterial) {
6868
for _, mm := range mms {
6969
if mh.clusterName != "" {
70-
// Customer can specified the cluster name in the scraping job's relabel_config
70+
// Customer can specify the cluster name in the scraping job's relabel_config
7171
// CWAgent won't overwrite in this case to support cross-cluster monitoring
7272
if _, ok := mm.tags[containerinsightscommon.ClusterNameKey]; !ok {
7373
mm.tags[containerinsightscommon.ClusterNameKey] = mh.clusterName
@@ -76,17 +76,17 @@ func (mh *metricsHandler) setEmfMetadata(mms []*metricMaterial) {
7676

7777
// Historically, for Prometheus pipelines, we use the "job" corresponding to the target in the prometheus config as the log stream name
7878
// https://github.com/aws/amazon-cloudwatch-agent/blob/59cfe656152e31ca27e7983fac4682d0c33d3316/plugins/inputs/prometheus_scraper/metrics_handler.go#L80-L84
79-
// As can be seen, if the "job" tag was available, the log_stream_name would be set to it and if it wasnt available for some reason, the log_stream_name would be set as "default".
79+
// As can be seen, if the "job" tag was available, the log_stream_name would be set to it and if it wasn't available for some reason, the log_stream_name would be set as "default".
8080
// The old cloudwatchlogs exporter had logic to look for log_stream_name and if not found, it would use the log_stream_name defined in the config
8181
// https://github.com/aws/amazon-cloudwatch-agent/blob/60ca11244badf0cb3ae9dd9984c29f41d7a69302/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go#L175-L180
82-
// But as we see above, there should never be a case for Prometheus pipelines where log_stream_name wasnt being set in metrics_handler - so the log_stream_name in the config would have never been used.
82+
// But as we see above, there should never be a case for Prometheus pipelines where log_stream_name wasn't being set in metrics_handler - so the log_stream_name in the config would have never been used.
8383

8484
// Now that we have switched to awsemfexporter, we leverage the token replacement logic to dynamically set the log stream name
8585
// https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/897db04f747f0bda1707c916b1ec9f6c79a0c678/exporter/awsemfexporter/util.go#L29-L37
8686
// Hence we always set the log stream name in the default exporter config as {JobName} during config translation.
8787
// If we have a "job" tag, we do NOT add a tag for "JobName" here since the fallback logic in awsemfexporter while doing pattern matching will fallback from "JobName" -> "job" and use that.
88-
// Only when "job" tag isnt available, we set the "JobName" tag to default to retain same logic as before.
89-
// We do it this way so we dont unnecessarily add an extra tag (that the awsemfexporter wont know to drop) for most cases where "job" will be defined.
88+
// Only when "job" tag isn't available, we set the "JobName" tag to default to retain same logic as before.
89+
// We do it this way so we don't unnecessarily add an extra tag (that the awsemfexporter won't know to drop) for most cases where "job" will be defined.
9090

9191
if _, ok := mm.tags["job"]; !ok {
9292
mm.tags["JobName"] = "default"

plugins/inputs/statsd/graphite/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
const (
1212
// DefaultSeparator is the default join character to use when joining multiple
13-
// measurment parts in a template.
13+
// measurement parts in a template.
1414
DefaultSeparator = "."
1515
)
1616

plugins/inputs/statsd/graphite/errors.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ package graphite
55

66
import "fmt"
77

8-
// An UnsupposedValueError is returned when a parsed value is not
9-
// supposed.
10-
type UnsupposedValueError struct {
8+
// An UnsupportedValueError is returned when a parsed value is not
9+
// supported.
10+
type UnsupportedValueError struct {
1111
Field string
1212
Value float64
1313
}
1414

15-
func (err *UnsupposedValueError) Error() string {
15+
func (err *UnsupportedValueError) Error() string {
1616
return fmt.Sprintf(`field "%s" value: "%v" is unsupported`, err.Field, err.Value)
1717
}

0 commit comments

Comments
 (0)