-
-
Notifications
You must be signed in to change notification settings - Fork 316
Xray initial support #273
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
base: master
Are you sure you want to change the base?
Xray initial support #273
Changes from 1 commit
276782e
27e1d98
852d35b
1ea38d8
4367ddd
ed2fa69
245d7f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import ( | |
|
|
||
| "github.com/aws/aws-lambda-go/lambda" | ||
| "github.com/aws/aws-sdk-go/aws/endpoints" | ||
| "github.com/aws/aws-xray-sdk-go/strategy/ctxmissing" | ||
| "github.com/aws/aws-xray-sdk-go/xray" | ||
| "github.com/cristim/autospotting/core" | ||
| "github.com/cristim/ec2-instances-info" | ||
|
|
@@ -58,7 +59,10 @@ func run(ctx context.Context) { | |
| conf.TagFilteringMode, | ||
| conf.SpotProductDescription) | ||
|
|
||
| xray.Configure(xray.Config{LogLevel: "error"}) | ||
| xray.Configure(xray.Config{ | ||
| ContextMissingStrategy: ctxmissing.NewDefaultLogErrorStrategy(), | ||
| LogLevel: "error", | ||
| }) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be configurable from an env variable?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What exactly do you want to configure in this place? Log level?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made log level configurable via flag, but it looks like there is a bug in X-Ray SDK. aws/aws-xray-sdk-go#60. At the moment, it will post a particular error message ignoring log level... |
||
| autospotting.Run(ctx, conf.Config) | ||
| log.Println("Execution completed, nothing left to do") | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks much better than I had attempted... I'm just sorry I wasted a few hours trying to fix this myself without any results.
I'll try it out tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked like a charm!