1

Using Stackdriver and trying to create an absence alert for both GCE and AWS instances. GCE instances show up under the dropdown INSTANCE_ID, but we don't see our AWS instances listed in that dropdown even though they are sending logs and show up in the logs viewer.

Does this mean AWS instances that are configured in Stackdriver cannot have absence alerts? How can I get this working?

Justin
  • 5,328
  • 19
  • 64
  • 84
  • Are you able to create other type of alerts for your AWS instances? Although Stackdriver logging and monitoring are closely integrated they are still different products. Monitoring might need some additional [setup](https://cloud.google.com/monitoring/quickstart-aws) – Carlos Apr 17 '17 at 23:47
  • Were you able to configure your AWS account for Stackdriver monitoring as explained in [here](https://cloud.google.com/monitoring/quickstart-aws#configure-sd-acct)?. Did this help you to solve the issue? If this is the case, you might consider posting an answer, so the community can benefit from your experience. – Marilu May 17 '17 at 18:25
  • @Justin were you able to configure the Google Stackdriver alert for AWS instances? If so, please share the resolution so to benefit the community having similar problem. – N Singh Sep 18 '17 at 17:02

1 Answers1

1

We're using Stackdriver services even before they were bought by Google in Legacy Stackdriver.

We're still using it and there are no significant issues with creating alerting policies for custom metrics or metrics coming from the agent.

If you don't see any of your EC2 instances in Stackdriver interfaces like dashboards or when creating alerting policies, you might have problem with linking your AWS account to Stackdriver.

Check that you have the proper IAM role that give to Stackdriver the right permissions to do its job.

Check trust relationship and conditions configuration in the IAM role you're using for linking your AWS account to Stackdriver.

In general;

You have to properly configure your AWS account in Stackdriver.

  1. There is couple of steps you have to take before you even think to install stackdriver agent on your AWS instances.
    • You have to link your AWS account into Stackdriver by following the steps in Quickstart for AWS
    • Note: Do not change GOOGLE_APPLICATION_CREDENTIALS file location. Just leave it as it is: "/etc/google/auth/application_default_credentials.json"
    • I'm adding a note here because I've spend some time debugging this and apparently the agent does not care about this environment variable. (at least at the time I'm writing this)
    • Synchronization between your AWS account and Stackdriver will take some time. Leave it for an hour to take all Cloudwatch metrics, s3 buckets size, etc...
    • Install the agent on your instance and wait 5-10 minutes to start generating metrics like memory/cpu/disk/etc..
  2. Create new alerting policy.
    • Click on Conditions
    • Select Metric Absence
    • Select RESOURCE TYPE: Instance (EC2)
    • Select Single/Group or All. (define who this alert will monitor)
    • Choice TRIGGER IF METRIC that you're sure you should always have.
    • Example: "CPU User (Agent)"
    • Choice "IS ABSENT FOR" - example 20 minutes.
    • Click Save Condition
    • Add Notification method (You can define multiple notification methods)
    • Type Name of the policy and click Save Policy

You can have maximum Conditions in a single alerting policy.

Peycho Dimitrov
  • 1,118
  • 9
  • 10