You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request for an additional configuration parameter, "softFail". When true, AgentSink would suppress any ECONNREFUSED error occurring when sending a message to the CloudWatch agent and just log it instead.
Here's our rationale for this change: We have code that runs in both Lambda environments (where we always want metrics to be logged), but also in local environments for diagnostics and exploration purposes (where we don't care if metrics are logged). In other words, some of our metric logging is "best effort", not "mission critical".
We know we can configure the environmentOverride to be Local, which will log the metrics to the console and not fail. But those messages are distracting, and doing so via an environment variable is awkward. We can also wrap the library calls to add conditionals to only publish metrics when we detect the right environment, or even just suppress the thrown exception ourselves. But this "best effort" scenario seems like a common enough use case that a configuration parameter could be helpful.
We have a working fork with a rough draft of the changes that suit our needs. Is there interest in including a feature like this in a v4.3+ release? If so, I'd be happy to spin up a pull request.
The text was updated successfully, but these errors were encountered:
This is a feature request for an additional configuration parameter, "softFail". When true,
AgentSink
would suppress anyECONNREFUSED
error occurring when sending a message to the CloudWatch agent and just log it instead.Here's our rationale for this change: We have code that runs in both Lambda environments (where we always want metrics to be logged), but also in local environments for diagnostics and exploration purposes (where we don't care if metrics are logged). In other words, some of our metric logging is "best effort", not "mission critical".
We know we can configure the
environmentOverride
to beLocal
, which will log the metrics to the console and not fail. But those messages are distracting, and doing so via an environment variable is awkward. We can also wrap the library calls to add conditionals to only publish metrics when we detect the right environment, or even just suppress the thrown exception ourselves. But this "best effort" scenario seems like a common enough use case that a configuration parameter could be helpful.We have a working fork with a rough draft of the changes that suit our needs. Is there interest in including a feature like this in a
v4.3+
release? If so, I'd be happy to spin up a pull request.The text was updated successfully, but these errors were encountered: