-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce timeout for scrapping IMDS and give instruction when fail to s…
…crape IMDS inside container
- Loading branch information
Showing
68 changed files
with
4,432 additions
and
1,110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
cmd/amazon-cloudwatch-agent/register_event_logger_notwindows.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
//go:build !windows | ||
// +build !windows | ||
|
||
package main | ||
|
||
// RegisterEventLogger is for supporting Windows Event, it should only be created when running on Windows | ||
// To minimize duplicate code for Windows vs non-Windows build amazon-cloudwatch-agent.go main class, | ||
// create this dummy method so amazon-cloudwatch-agent.go can be build independent to the OS. Because of this method is | ||
// invoked inside the if statement of "if runtime.GOOS == "windows" && windowsRunAsService() {" effectively it | ||
// is unreachable, but Go compiler needs to see this exits to build. | ||
func RegisterEventLogger() error { | ||
// Unreachable code, do nothing. | ||
return nil | ||
} |
24 changes: 24 additions & 0 deletions
24
cmd/amazon-cloudwatch-agent/register_event_logger_windows.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
//go:build windows | ||
// +build windows | ||
|
||
package main | ||
|
||
import ( | ||
lumberjack "github.com/aws/amazon-cloudwatch-agent/logger" | ||
"github.com/influxdata/telegraf/logger" | ||
) | ||
|
||
// RegisterEventLogger is for supporting Windows Event | ||
func RegisterEventLogger() error { | ||
// When in service mode, register eventlog target and setup default logging to eventlog | ||
|
||
e := logger.RegisterEventLogger(LogTargetEventLog) | ||
if e != nil { | ||
return e | ||
} | ||
logger.SetupLogging(logger.LogConfig{LogTarget: lumberjack.LogTargetLumberjack}) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.