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

Allow for a "softFail" configuration option #170

Open
pwagener opened this issue Dec 17, 2024 · 0 comments
Open

Allow for a "softFail" configuration option #170

pwagener opened this issue Dec 17, 2024 · 0 comments

Comments

@pwagener
Copy link

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.

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

No branches or pull requests

1 participant