Spring Boot Actuator + Dropwizard + Cloudwatch

Exporting spring boot metrics to cloudwatch may not be that straightforward. Since I’ve done that for my project, I will show how we can do it easily with the help of a couple of libraries.

First, spring boot is using its own metrics mechanism. The first step to do that is to swap it with dropwizard’s metrics library which is more powerful and has more feature. Thankfully, the actuator has complete support for the library from what it’s written in the documentation. Spring will just swap its interface to use the implementation which wraps the dropwizard metrics.

Read more →

AWS Eb CLI (v3): How to fix ssl_wrap_socket error in Debian Jessie

This is the first time I’m deploying stuff to elasticbeanstalk, and when I’m trying to deploy my private project, I realized the eb cli I download is the version 2 and has different syntax. I installed the version 3, and it seems like it can only be installed using python package manager pip. After installing it, this is what I get:

rowanto@Rowanto-Deb ~ $ eb
Traceback (most recent call last):
  File "/usr/local/bin/eb", line 9, in <module>
    load_entry_point('awsebcli==3.0.10', 'console_scripts', 'eb')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 519, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2630, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2310, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2316, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/dist-packages/ebcli/core/ebcore.py", line 23, in <module>
    from ..controllers.initialize import InitController
  File "/usr/local/lib/python2.7/dist-packages/ebcli/controllers/initialize.py", line 16, in <module>
    from ..core.abstractcontroller import AbstractBaseController
  File "/usr/local/lib/python2.7/dist-packages/ebcli/core/abstractcontroller.py", line 21, in <module>
    from ..core import io, fileoperations, operations
  File "/usr/local/lib/python2.7/dist-packages/ebcli/core/operations.py", line 25, in <module>
    from ..lib import elasticbeanstalk, s3, iam, aws, ec2, elb
  File "/usr/local/lib/python2.7/dist-packages/ebcli/lib/elasticbeanstalk.py", line 25, in <module>
    from ..lib import aws
  File "/usr/local/lib/python2.7/dist-packages/ebcli/lib/aws.py", line 17, in <module>
    import botocore_eb.session
  File "/usr/local/lib/python2.7/dist-packages/botocore_eb/session.py", line 27, in <module>
    import botocore_eb.credentials
  File "/usr/local/lib/python2.7/dist-packages/botocore_eb/credentials.py", line 27, in <module>
    from botocore_eb.utils import InstanceMetadataFetcher, parse_key_val_file
  File "/usr/local/lib/python2.7/dist-packages/botocore_eb/utils.py", line 22, in <module>
    from botocore_eb.vendored import requests
  File "/usr/local/lib/python2.7/dist-packages/botocore_eb/vendored/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/botocore_eb/vendored/requests/packages/urllib3/contrib/pyopenssl.py", line 55, in <module>
    orig_connectionpool_ssl_wrap_socket = connectionpool.ssl_wrap_socket
AttributeError: 'module' object has no attribute 'ssl_wrap_socket'
rowanto@Rowanto-Deb ~ $ 

And I’m like, what? Googling around the last line returns you many result, but not those relevant with the eb cli v3. There’s also a post which suggest that we use the bundle version (it’s a zip file) of aws cli, but I can’t find a bundle version of eb cli. Long story short, I found this post which helped me to fix the problem. Thanks to @guss77!

Read more →