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

Advice on local testing strategies #18

Closed
peacing opened this issue Mar 5, 2020 · 5 comments
Closed

Advice on local testing strategies #18

peacing opened this issue Mar 5, 2020 · 5 comments
Labels
documentation Improvements or additions to documentation in progress Someone is actively working on this issue

Comments

@peacing
Copy link

peacing commented Mar 5, 2020

Hello,

I'm experimenting with utilizing embedded metrics in my Lambda functions, which I usually test locally by passing in a sample event to the lambda handler function. This works well, but when using the aws_embedded_metrics package, i get the following error messagewhen running a put_metric call:

Failed to connect to the socket. [Errno 61] Connection refused
Failed to write metrics to the socket. [Errno 32] Broken pipe

Ideas on a way to more gracefully handle this?
Thank you,

@jaredcnance
Copy link
Member

jaredcnance commented Mar 8, 2020

You’re seeing the same behavior that we discussed here: awslabs/aws-embedded-metrics-node#18. I’m planning on implementing the same solution in this repo in the next couple weeks. I’d recommend reading through that discussion and the related PR and let me know if you’d like some other behavior.

I’m the meantime, you can see how we mock in our tests here: https://github.com/awslabs/aws-embedded-metrics-python/blob/master/tests/metric_scope/test_metric_scope.py

@peacing
Copy link
Author

peacing commented Mar 9, 2020

@jaredcnance Thank you for the response! Yes the proposals in the node repo sounds good, setting an environment var to Local is good.
Thanks,
Paul

@jaredcnance jaredcnance added not started documentation Improvements or additions to documentation in progress Someone is actively working on this issue and removed not started labels Mar 28, 2020
@jaredcnance
Copy link
Member

This is available in v1.0.6 now.

@atlasgurus
Copy link

I am using 1.0.7 and this still fails the same way. I thought it was supposed to log metrics using EMF format. Why does it need a socket?

@jaredcnance
Copy link
Member

jaredcnance commented Jun 17, 2021

@atlasgurus are you overriding the environment? The socket is a mode of communication that allows you to use an external agent to buffer the data directly which is currently the recommended option for non-Lambda environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation in progress Someone is actively working on this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants