-
Notifications
You must be signed in to change notification settings - Fork 39
Add LocalEnvironment using stdout #61
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
Conversation
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 for the PR! I'll need to take a closer look at this for breaking changes. 1 other comment below.
@@ -17,14 +17,15 @@ | |||
from aws_embedded_metrics.serializers.log_serializer import LogSerializer | |||
|
|||
|
|||
class LambdaSink(Sink): | |||
class StdoutSink(Sink): |
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.
👍
if self.sink is None: | ||
self.sink = AgentSink(self.get_log_group_name(), Config.log_stream_name) | ||
return self.sink | ||
|
||
|
||
class DefaultStdoutEnvironment(DefaultEnvironment): |
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.
In the other implementations, we provide a LocalEnvironment
for this purpose. Would that meet your needs here? Any particular reason to depart from that pattern?
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.
Oh, I had not seen that (my need is python-only). My thinking was to maximize code re-use as DefaultEnvironment is almost exactly what was needed. I can change it to call it LocalEnvironment to be consistent though 👍
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.
So made this change and now the test is happy as well :)
So far the DefaultEnvironment was hard coded to use the agent sink as that was the recommendation for workloads on-premise. While a fair recommendation, it isn't accurate for all workloads. This adds a similer local environment that uses the StdoutSink instead of the agent sink for such customers.
@jaredcnance if you got some time to have another look would be great |
PR Code Suggestions ✨
|
So far the DefaultEnvironment was hard coded to use the agent sink as that
was the recommendation for workloads on-premise.
While a fair recommendation, it isn't accurate for all workloads. This
adds a similer local environment that uses the StdoutSink instead of the agent sink
for such customers.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.