Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Contrib to v0.103.0 #1247

Merged
merged 25 commits into from
Aug 5, 2024
Merged

Upgrade Contrib to v0.103.0 #1247

merged 25 commits into from
Aug 5, 2024

Conversation

okankoAMZ
Copy link
Contributor

@okankoAMZ okankoAMZ commented Jul 11, 2024

Description of the issue

Contrib was last updated 2 months ago. Contrib repository PR can be found here. Please do not merge before that PR.

Description of changes

Upgrade contrib to v0.103.0 stable version. To do that I had do:

  • Update CloudWatch agent command, where I am using now passing in the Provider Settings and not just Provider.
  • Update Config Provider because the inputs have changed to Factories and Settings from directly feeding in the Converters and Providers.
  • Update our logger, so when a NewLogger is created now there is a option to retrieve the Logger Options with the Logger itself.
  • component.UnmarshalConfig was deprecated so I had to migrate it to confmap.Unmarshal
  • Updated translator sample configs.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Ran integration test here: https://github.com/aws/amazon-cloudwatch-agent/actions/runs/10063006520
More recent integration test here:https://github.com/aws/amazon-cloudwatch-agent/actions/runs/10101543388

Latest agent logs:

[ec2-user@ip-172-31-46-210 amazon-cloudwatch-agent]$ tail -n 100 /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log 
        logs:
            development: false
            disable_caller: false
            disable_stacktrace: false
            encoding: console
            level: debug
            output_paths:
                - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log
            sampling:
                enabled: true
                initial: 2
                thereafter: 500
                tick: 10s
        metrics:
            address: ""
            level: None
        traces: {}
2024/08/05 18:27:58 Reading json config file path: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json ...
2024/08/05 18:27:58 I! Valid Json input schema.
2024/08/05 18:27:58 I! Detected runAsUser: root
2024/08/05 18:27:58 I! Changing ownership of [/opt/aws/amazon-cloudwatch-agent/logs /opt/aws/amazon-cloudwatch-agent/etc /opt/aws/amazon-cloudwatch-agent/var] to 0:0
2024-08-05T18:27:58Z I! Starting AmazonCloudWatchAgent CWAgent/1.300041.1 (go1.22.4; linux; amd64) with log file /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log with log target lumberjack
2024-08-05T18:27:58Z I! AWS SDK log level not set
2024-08-05T18:27:58Z I! creating new logs agent
2024-08-05T18:27:58Z I! [logagent] starting
2024-08-05T18:27:58Z I! {"caller":"[email protected]/telemetry.go:47","msg":"Skipping telemetry setup.","address":"","level":"None"}
2024-08-05T18:27:58Z D! {"caller":"[email protected]/extension.go:165","msg":"Alpha component. May change in the future.","kind":"extension","name":"agenthealth/metrics"}
2024-08-05T18:27:58Z D! {"caller":"[email protected]/exporter.go:273","msg":"Alpha component. May change in the future.","kind":"exporter","data_type":"metrics","name":"awscloudwatch"}
2024-08-05T18:27:58Z D! {"caller":"[email protected]/receiver.go:308","msg":"Stable component.","kind":"receiver","name":"telegraf_mem","data_type":"metrics"}
2024-08-05T18:27:58Z I! {"caller":"[email protected]/service.go:143","msg":"Starting CWAgent...","Version":"1.300041.1","NumCPU":2}
2024-08-05T18:27:58Z I! {"caller":"extensions/extensions.go:34","msg":"Starting extensions..."}
2024-08-05T18:27:58Z I! {"caller":"extensions/extensions.go:37","msg":"Extension is starting...","kind":"extension","name":"agenthealth/metrics"}
2024-08-05T18:27:58Z I! {"caller":"extensions/extensions.go:52","msg":"Extension started.","kind":"extension","name":"agenthealth/metrics"}
2024-08-05T18:27:58Z D! Fallback shared config file(s): [.aws/credentials]
2024-08-05T18:27:58Z D! Successfully created credential sessions
2024-08-05T18:27:58Z E! Failed to get credential from session: NoCredentialProviders: no valid providers in chain
caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.
SharedCredsLoad: failed to load profile, .
EC2RoleRequestError: no EC2 instance role found
caused by: EC2MetadataError: failed to make EC2Metadata request
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>

        status code: 404, request id: 
2024-08-05T18:27:58Z D! {"caller":"[email protected]/helper.go:18","msg":"Configured middleware on AWS client","kind":"exporter","data_type":"metrics","name":"awscloudwatch","middleware":"agenthealth/metrics"}
2024-08-05T18:27:58Z I! cloudwatch: get unique roll up list []
2024-08-05T18:27:58Z D! {"caller":"adapter/receiver.go:41","msg":"Starting adapter","kind":"receiver","name":"telegraf_mem","data_type":"metrics","receiver":"mem"}
2024-08-05T18:27:58Z I! {"caller":"[email protected]/service.go:169","msg":"Everything is ready. Begin running and processing data."}
2024-08-05T18:27:58Z W! {"caller":"localhostgate/featuregate.go:63","msg":"The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default.","feature gate ID":"component.UseLocalHostAsDefaultHost"}
2024-08-05T18:27:58Z I! cloudwatch: publish with ForceFlushInterval: 1m0s, Publish Jitter: 29.991730558s
2024-08-05T18:27:59Z D! [logagent] open file count, 0
2024-08-05T18:27:59Z D! {"caller":"adapter/receiver.go:61","msg":"Begin scraping metrics with adapter","kind":"receiver","name":"telegraf_mem","data_type":"metrics","receiver":"mem"}
2024-08-05T18:28:00Z D! [logagent] open file count, 0
2024-08-05T18:28:01Z D! [logagent] open file count, 0
2024-08-05T18:28:02Z D! [logagent] open file count, 0
2024-08-05T18:28:03Z D! [logagent] open file count, 0
2024-08-05T18:28:04Z D! [logagent] open file count, 0
2024-08-05T18:28:05Z D! [logagent] open file count, 0
2024-08-05T18:28:06Z D! [logagent] open file count, 0
2024-08-05T18:28:07Z D! [logagent] open file count, 0
2024-08-05T18:28:08Z D! [logagent] open file count, 0
2024-08-05T18:28:09Z D! [logagent] open file count, 0
2024-08-05T18:28:10Z D! [logagent] open file count, 0
2024-08-05T18:28:11Z D! [logagent] open file count, 0
2024-08-05T18:28:12Z D! [logagent] open file count, 0
2024-08-05T18:28:13Z D! [logagent] open file count, 0
2024-08-05T18:28:14Z D! [logagent] open file count, 0
2024-08-05T18:28:15Z D! [logagent] open file count, 0
2024-08-05T18:28:16Z D! [logagent] open file count, 0
2024-08-05T18:28:17Z D! [logagent] open file count, 0
2024-08-05T18:28:18Z D! [logagent] open file count, 0
2024-08-05T18:28:19Z D! [logagent] open file count, 0
2024-08-05T18:28:20Z D! [logagent] open file count, 0
2024-08-05T18:28:21Z D! [logagent] open file count, 0
2024-08-05T18:28:22Z D! [logagent] open file count, 0
2024-08-05T18:28:23Z D! [logagent] open file count, 0
2024-08-05T18:28:24Z D! [logagent] open file count, 0
2024-08-05T18:28:25Z D! [logagent] open file count, 0
2024-08-05T18:28:26Z D! [logagent] open file count, 0
2024-08-05T18:28:27Z D! [logagent] open file count, 0
2024-08-05T18:28:28Z D! [logagent] open file count, 0
2024-08-05T18:28:28Z I! CWAGENT_LOG_LEVEL is set to "DEBUG"

after my changes:

 2024-08-05T20:02:44Z D! Using credential [REDACTED] from EC2RoleProvider
2024-08-05T20:02:44Z I! {"caller":"[email protected]/service.go:182","msg":"Starting CWAgent...","Version":"1.300042.1-32-ge7225958-untracked","NumCPU":2}
2024-08-05T20:02:44Z I! {"caller":"extensions/extensions.go:34","msg":"Starting extensions..."}
2024-08-05T20:02:44Z I! {"caller":"extensions/extensions.go:37","msg":"Extension is starting...","kind":"extension","name":"agenthealth/metrics"}
2024-08-05T20:02:44Z I! {"caller":"extensions/extensions.go:52","msg":"Extension started.","kind":"extension","name":"agenthealth/metrics"}
2024-08-05T20:02:44Z D! Fallback shared config file(s): [/home/cwagent/.aws/credentials]
2024-08-05T20:02:44Z D! Successfully created credential sessions
2024-08-05T20:02:44Z D! Using credential [REDACTED]from EC2RoleProvider
2024-08-05T20:02:44Z I! cloudwatch: get unique roll up list []
2024-08-05T20:02:44Z I! {"caller":"ec2tagger/ec2tagger.go:415","msg":"ec2tagger: Check EC2 Metadata.","kind":"processor","name":"ec2tagger","pipeline":"metrics/host"}
2024-08-05T20:02:44Z I! cloudwatch: publish with ForceFlushInterval: 1m0s, Publish Jitter: 5.078351757s
2024-08-05T20:02:44Z D! Fallback shared config file(s): [/home/cwagent/.aws/credentials]
2024-08-05T20:02:44Z D! Successfully created credential sessions
2024-08-05T20:02:44Z D! Using credential [REDACTED] from EC2RoleProvider
2024-08-05T20:02:44Z I! {"caller":"ec2tagger/ec2tagger.go:333","msg":"ec2tagger: EC2 tagger has started initialization.","kind":"processor","name":"ec2tagger","pipeline":"metrics/host"}
2024-08-05T20:02:44Z I! {"caller":"[email protected]/service.go:208","msg":"Everything is ready. Begin running and processing data."}
2024-08-05T20:02:44Z W! {"caller":"localhostgate/featuregate.go:63","msg":"The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default.","feature gate ID":"component.UseLocalHostAsDefaultHost"}
2024-08-05T20:02:44Z W! {"caller":"ec2tagger/ec2tagger.go:465","msg":"ec2tagger: Unable to describe ec2 tags for initial retrieval","kind":"processor","name":"ec2tagger","pipeline":"metrics/host","error":"UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::956457624121:assumed-role/SSMDefaultRoleForPVREReporting/i-06aad6834bc794769 is not authorized to perform: ec2:DescribeTags because no identity-based policy allows the ec2:DescribeTags action\n\tstatus code: 403, request id: 0b615dc1-b942-4c17-b77d-84ffff632f4d"}
2024-08-05T20:02:45Z D! [logagent] open file count, 0
2024-08-05T20:02:46Z D! [logagent] open file count, 0
2024-08-05T20:02:47Z D! [logagent] open file count, 0
2024-08-05T20:02:48Z D! [logagent] open file count, 0
2024-08-05T20:02:49Z D! [logagent] open file count, 0
2024-08-05T20:02:50Z D! [logagent] open file count, 0
2024-08-05T20:02:51Z D! [logagent] open file count, 0
2024-08-05T20:02:52Z D! [logagent] open file count, 0
2024-08-05T20:02:53Z D! [logagent] open file count, 0
2024-08-05T20:02:54Z D! [logagent] open file count, 0
2024-08-05T20:02:55Z D! [logagent] open file count, 0
2024-08-05T20:02:56Z D! [logagent] open file count, 0
2024-08-05T20:02:57Z D! [logagent] open file count, 0
2024-08-05T20:02:58Z D! [logagent] open file count, 0
2024-08-05T20:02:59Z D! [logagent] open file count, 0
2024-08-05T20:03:00Z D! [logagent] open file count, 0
2024-08-05T20:03:01Z D! [logagent] open file count, 0
2024-08-05T20:03:02Z D! [logagent] open file count, 0
2024-08-05T20:03:03Z D! [logagent] open file count, 0
2024-08-05T20:03:04Z D! [logagent] open file count, 0
2024-08-05T20:03:05Z D! [logagent] open file count, 0
2024-08-05T20:03:06Z D! [logagent] open file count, 0
2024-08-05T20:03:07Z D! [logagent] open file count, 0
2024-08-05T20:03:08Z D! [logagent] open file count, 0
2024-08-05T20:03:09Z D! [logagent] open file count, 0
2024-08-05T20:03:10Z D! [logagent] open file count, 0
2024-08-05T20:03:11Z D! [logagent] open file count, 0
2024-08-05T20:03:12Z D! [logagent] open file count, 0
2024-08-05T20:03:13Z D! [logagent] open file count, 0
2024-08-05T20:03:14Z I! CWAGENT_LOG_LEVEL is set to "DEBUG"

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

@okankoAMZ okankoAMZ changed the title Otel bump v0.102.1 Upgrade Contrib to v0.102.1 Jul 11, 2024
@okankoAMZ okankoAMZ force-pushed the otel-bump-v0.102.1 branch from b402a86 to 29ab202 Compare July 12, 2024 15:54
Copy link
Contributor

This PR was marked stale due to lack of activity.

@github-actions github-actions bot added the Stale label Jul 20, 2024
@okankoAMZ okankoAMZ force-pushed the otel-bump-v0.102.1 branch from 69ff0c6 to adf4ac1 Compare July 23, 2024 16:19
@okankoAMZ okankoAMZ force-pushed the otel-bump-v0.102.1 branch from adf4ac1 to 8d7cf3a Compare July 23, 2024 16:49
@okankoAMZ okankoAMZ changed the title Upgrade Contrib to v0.102.1 Upgrade Contrib to v0.103.0 Jul 23, 2024
@github-actions github-actions bot removed the Stale label Jul 24, 2024
@okankoAMZ okankoAMZ marked this pull request as ready for review July 25, 2024 21:10
@okankoAMZ okankoAMZ requested a review from a team as a code owner July 25, 2024 21:10
@ZhenyuTan-amz
Copy link
Contributor

branch named with v102 but eventually bumped to v103. Is it just us trying to pulling in whatever is the latest? (just curious if it's fully intended, not against it at all)

@okankoAMZ
Copy link
Contributor Author

branch named with v102 but eventually bumped to v103. Is it just us trying to pulling in whatever is the latest? (just curious if it's fully intended, not against it at all)

Initially it we were migrating to v102 but due to parity issue between v102.1 and v102.0 we have decided to bump to v103. I renamed the PR but did not recreate the branch

musa-asad
musa-asad previously approved these changes Jul 30, 2024
@okankoAMZ okankoAMZ force-pushed the otel-bump-v0.102.1 branch from ba5852d to 4e42bbe Compare July 31, 2024 23:00
sky333999
sky333999 previously approved these changes Aug 5, 2024
@okankoAMZ okankoAMZ force-pushed the otel-bump-v0.102.1 branch from e722595 to e24a216 Compare August 5, 2024 20:07
@okankoAMZ okankoAMZ merged commit f9beaec into main Aug 5, 2024
6 checks passed
@okankoAMZ okankoAMZ deleted the otel-bump-v0.102.1 branch August 5, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants