Welcome, Guest Login

Support Center

Collecting data from specific resources only

Last Updated: Oct 02, 2015 12:06PM EDT
If you want Stackdriver to only collect data for a subset of your resources, you can restrict access to them with two methods: adding tags and updating your IAM policy.

Adding Tags


To have the Stackdriver service ignore a specific instance, add a tag named "stackdriver_monitor" with a value of "false". Please make sure to also uninstall the Stackdriver agent if it is running on the instance, otherwise we will continue to collect metrics and include the instance in your account. 

To batch-tag your EC2 instances:
  1. Head to the EC2 dashboard and select Tags
  2. Click Manage
  3. In the Tag Management panel, select your instances by:
    1. filtering for desired instances
    2. by holding the Shift key and clicking on desired instances (these selections will persist through page changes)
  4. Input the Key and Value to add at the bottom of the page ("stackdriver_monitor" and "false" in this case)
  5. Select Add Tag

To tag your RDS instances:
  1. Head to the RDS dashboard and select the instance you would like to tag.
  2. Select Tags

     
  3. Click Add/Edit Tag
  4. Click Add another Tag
  5. Input the Key and Value ("stackdriver_monitor" and "false")
  6. Select Save Tags

To tag your Load Balancers:
  1. Head to the Load Balancers dashboard and select the load balancer you would like to tag.
  2. Select Tags.
  3. Click Add/Edit Tag.
  4. Click Create Tag.
  5. Input the Key and Value ("stackdriver_monitor" and "false")
  6. Select Save. 
To exclude ElastiCache clusters, please ensure that the IAM role associated with Stackdriver in your AWS account excludes the elasticache:List* permission. 


Updating your IAM policy


**This method currently works for SQS queues, SNS topics and DynamoDB tables only

First go to the IAM console and find the role that you added when signing up for Stackdriver (it should be called "Stackdriver"). Then select the Manage Policy action and remove the lines related to either sqs or dynamodb so that the Stackdriver service will not collect data on those resources.

NoteNo matter what, you must first revoke all access to your resource before you can add specific policies. 

If you then want to collect data for a subset of your resources, you can add additional policies. 

For example, to do this for SQS and allow Stackdriver access to collect data on queues named prod*, you would use a policy like the following (replacing 123456789012 with your account id):
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "sqs:Get*",
        "sqs:ListQueues"
      ],
      "Sid": "Stmt1374009937000",
      "Resource": [
        "arn:aws:sqs:us-east-1:123456789012:prod*"
      ],
      "Effect": "Allow"
    },
    {
      "Action": [
        "sqs:ListQueues"
      ],
      "Sid": "Stmt137409937000",
      "Resource": "*",
      "Effect": "Allow"
    }
  ]
}

To do something similar for SNS and allow Stackdriver to only collect data on SNS topics named prod*, you would use a policy like the following (replacing 123456789012 with your account id):
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        “sns:Get*",
        "sns:List*”
      ],
      "Sid": "Stmt1374009937000",
      "Resource": [
        "arn:aws:sns:us-east-1:123456789012:prod*"
      ],
      "Effect": "Allow"
    },
    {
      "Action": [
        "sns:List*”
      ],
      "Sid": "Stmt137409937000",
      "Resource": "*",
      "Effect": "Allow"
    }
  ]
}
 

To do something similar for DynamoDB and allow Stackdriver to only collect data on Dynamo tables named prod*, you would use a policy like the following (replacing 123456789012 with your account id):
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "dynamodb:Describe*"
            ],
            "Sid": "Stmt1374009937000",
            "Resource": [
                "arn:aws:dynamodb:us-east-1:123456789012:table/prod*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "dynamodb:ListTables"
            ],
            "Sid": "Stmt1374009936000",
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        }
    ]
}

 

 

 
 
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete