How to connect to a Glasnostic instance to view its logs

Even though we’ve made every effort to make the Glasnostic appliance maintenance-free and self-healing, there are reasons why you would want to have a look at its logs. For instance, if your EC2 instances have connectivity issues or if you suspect that a misconfiguration may prevent you from seeing traffic in the UI, it may be helpful to inspect the appliance logs.

Connecting to the EC2 Instance Console

  1. In the AWS EC2 console, click “Instances,” filter for “Glasnostic” and select the instance you want to connect to. Then click “Connect.”
Screenshot of AWS console showing a list of instances
  1. In the dialog that follows, select “Session Manager” and click “Connect”:
Screenshot of AWS console showing 'Connect to instance'

You are now connected as ssm-user to the instance console, where you can issue commands. ssm-user is a special user created by the AWS Session Manager with sudo privileges.

View instance logs

The primary process on the appliance is the router process. The router process logs to /opt/glasnostic/log/router.log:

$ tail -f /opt/glasnostic/log/router.log
[ROUTER][INFO][X3KwkbuTKQAL7KEw]2020-10-29T16:20:09Z request.go:32: Sending metrics for 0 routes at 2020-10-29 16:20:10 +0000 UTC to the cloud.
[ROUTER][INFO][X3KwkbuTKQAL7KEw]2020-10-29T16:20:19Z request.go:32: Sending metrics for 0 routes at 2020-10-29 16:20:20 +0000 UTC to the cloud.
[ROUTER][INFO][X3KwkbuTKQAL7KEw]2020-10-29T16:20:29Z request.go:32: Sending metrics for 0 routes at 2020-10-29 16:20:30 +0000 UTC to the cloud.
[ROUTER][INFO][X3KwkbuTKQAL7KEw]2020-10-29T16:20:39Z request.go:32: Sending metrics for 0 routes at 2020-10-29 16:20:40 +0000 UTC to the cloud.

If everything works as expected, this log merely lists when metrics have been sent to the Glasnostic console at glasnostic.com. Because this can make looking for errors a little tedious, it is often better to explicitly grep for the ERROR keyword:

$ grep ERROR /opt/glasnostic/log/router.log

Most errors will point you directly to the source of the connectivity issue or misconfiguration you are trying to solve. If an error seems to indicate that something more serious may be going on, send the error log, together with the router version, to support@glasnostic.com. You can retrieve the router version by running it with the -version argument:

$ /opt/glasnostic/bin/router -version
Glasnostic Router ga-1.1-272c55f (Build: 3791) 2020-10-29 01:53:35 UTC
Manage the complex behaviors of modern microservice architectures