Skip to content

Cloud

クラウドサービス監視


📚 情報ソース

このドキュメントは以下の情報源を基に作成されています:

主要ソース

補足ソース

  • クラウドプロバイダーのベストプラクティス: IAMロール設定、タグ戦略
  • 実運用環境の設定例: マルチアカウント/マルチリージョン構成

このセクションでは、AWS、Azure、GCPなどのクラウドプラットフォームのサービス監視設定を解説します。

共通の設定パターン: - enabled: サービスの有効/無効 - cloudwatch_period: メトリクス収集間隔(秒) - include_tags/exclude_tags: タグベースフィルタリング - include_resource_groups/exclude_resource_groups: リソースグループフィルタリング

AWS Services

📚 公式ドキュメント: AWS Services

AWS認証設定

💡 重要: AWS監視には、適切な権限を持つIAMユーザーまたはIAMロールが必要です。

認証方法: 1. IAMロール(推奨)- EC2インスタンスにIAMロールをアタッチ 2. 環境変数 - AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYを設定 3. 設定ファイル - ~/.aws/credentialsに認証情報を配置

IAMポリシーの作成:

AWS Console > IAM > Policies > Create Policy で以下のJSONを使用:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:GetMetricStatistics",
        "cloudwatch:ListMetrics",
        "ec2:DescribeInstances",
        "ec2:DescribeRegions",
        "ec2:DescribeTags",
        "rds:DescribeDBInstances",
        "lambda:ListFunctions",
        "dynamodb:ListTables",
        "s3:ListAllMyBuckets",
        "sqs:ListQueues",
        "elasticloadbalancing:DescribeLoadBalancers"
      ],
      "Resource": "*"
    }
  ]
}

IAMユーザーの作成: 1. AWS Console > IAM > Users > Add User 2. ユーザー名: instana-monitoring 3. Access type: Programmatic access 4. 上記のポリシーをアタッチ 5. アクセスキーIDとシークレットアクセスキーを保存

環境変数での設定:

1
2
3
export AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
export AWS_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
export AWS_DEFAULT_REGION="us-east-1"

セキュリティのベストプラクティス: - 本番環境ではsecrets.mdのVault統合を使用 - IAMロールを使用する場合は、環境変数や設定ファイルは不要 - アクセスキーは定期的にローテーション

共通設定

1
2
3
4
5
6
com.instana.plugin.aws:
  tagged-services-poll-rate: 300
  include_tags: 'env:prod,team:backend'
  exclude_tags: 'env:dev,temp:true'
  include_untagged: true
  enable_batch_discovery: true

主要サービス

API Gateway:

📚 公式ドキュメント: API Gateway

1
2
3
4
com.instana.plugin.aws.apigateway:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'env:prod'

Lambda:

📚 公式ドキュメント: Lambda

1
2
3
4
com.instana.plugin.aws.lambda:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'env:prod,app:backend'

RDS:

📚 公式ドキュメント: RDS

CloudWatch経由のメトリクス収集:

1
2
3
4
com.instana.plugin.aws.rds:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'env:prod,db:mysql'

💡 ヒント: RDS/Auroraの詳細なクエリ監視(スロークエリ、接続数など)を行う場合は、データベース接続情報を使用した直接監視も可能です。詳細は database.md の「AWS RDS/Aurora」セクションを参照してください。

DynamoDB:

📚 公式ドキュメント: DynamoDB

1
2
3
com.instana.plugin.aws.dynamodb:
  enabled: true
  cloudwatch_period: 300

S3:

📚 公式ドキュメント: S3

1
2
3
com.instana.plugin.aws.s3:
  enabled: true
  cloudwatch_period: 60

SQS:

📚 公式ドキュメント: SQS

1
2
3
com.instana.plugin.aws.sqs:
  enabled: true
  cloudwatch_period: 300

Google Cloud Platform

📚 公式ドキュメント: Google Cloud Platform

GCP認証設定

サービスアカウントの作成:

  1. GCP Console > IAM & Admin > Service Accounts > Create Service Account
  2. サービスアカウント名: instana-monitoring
  3. 以下のロールを付与:
  4. Monitoring Viewer
  5. Cloud SQL Viewer
  6. Compute Viewer
  7. Storage Object Viewer

サービスアカウントキーの作成:

1
2
3
4
5
6
7
# GCP Consoleで作成したサービスアカウントを選択
# Keys > Add Key > Create New Key > JSON
# ダウンロードしたJSONファイルを保存
sudo mkdir -p /opt/instana/credentials
sudo mv ~/Downloads/your-project-xxxxx.json /opt/instana/credentials/cred-gcp.json
sudo chmod 600 /opt/instana/credentials/cred-gcp.json
sudo chown instana:instana /opt/instana/credentials/cred-gcp.json

gcloudコマンドでの作成(CLI):

# サービスアカウント作成
gcloud iam service-accounts create instana-monitoring \
  --display-name="Instana Monitoring"

# ロール付与
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
  --member="serviceAccount:instana-monitoring@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
  --role="roles/monitoring.viewer"

# キー作成
gcloud iam service-accounts keys create /opt/instana/credentials/cred-gcp.json \
  --iam-account=instana-monitoring@YOUR_PROJECT_ID.iam.gserviceaccount.com

1
2
3
4
5
com.instana.plugin.gcp:
  poll_rate: 60
  credentials_path: '/opt/instana/credentials/cred-gcp.json'
  exclude_tags: 'env:dev'
  include_tags: 'env:prod'

設定値の取得方法: - credentials_path: 上記で作成したJSONファイルのパス - JSONファイルにはproject_id, private_key, client_emailが含まれる

Cloud SQL:

📚 公式ドキュメント: GCP Cloud SQL

Pub/Sub:

📚 公式ドキュメント: GCP Pub/Sub

1
2
3
4
5
6
com.instana.plugin.gcp.pubsub:
  enabled: true
  poll_rate: 60
  credentials_path: '/opt/instana/credentials/cred-gcp.json'
  include_tags:
    topic: 'env:prod'

Azure

📚 公式ドキュメント: Azure

Azure認証設定

サービスプリンシパルの作成:

Azure Portal での作成: 1. Azure Portal > Azure Active Directory > App registrations > New registration 2. アプリケーション名: instana-monitoring 3. Supported account types: Single tenant 4. Register をクリック

認証情報の取得:

1
2
3
4
5
6
7
# Application (client) ID を記録 → これが Service-Principal-Id
# Directory (tenant) ID を記録 → これが Your-Tenant-Id

# Certificates & secrets > New client secret
# Description: instana-monitoring-secret
# Expires: 24 months (推奨)
# Add をクリックして、Value を記録 → これが Service-Principal-Secret

サブスクリプションIDの取得:

# Azure Portal > Subscriptions > サブスクリプション名をクリック
# Subscription ID を記録 → これが Your-Subscription-Id

ロールの割り当て:

1
2
3
4
5
6
# Azure Portal > Subscriptions > サブスクリプション選択
# Access control (IAM) > Add > Add role assignment
# Role: Monitoring Reader
# Assign access to: User, group, or service principal
# Select: instana-monitoring
# Save

Azure CLIでの作成:

# サービスプリンシパル作成
az ad sp create-for-rbac --name instana-monitoring \
  --role "Monitoring Reader" \
  --scopes /subscriptions/YOUR_SUBSCRIPTION_ID

# 出力例:
# {
#   "appId": "xxxxx-xxxx-xxxx-xxxx-xxxxx",  ← Service-Principal-Id
#   "displayName": "instana-monitoring",
#   "password": "xxxxx-xxxx-xxxx-xxxx-xxxxx",  ← Service-Principal-Secret
#   "tenant": "xxxxx-xxxx-xxxx-xxxx-xxxxx"  ← Your-Tenant-Id
# }

1
2
3
4
5
6
7
8
9
com.instana.plugin.azure:
  enabled: true
  subscription: '[Your-Subscription-Id]'
  tenant: '[Your-Tenant-Id]'
  principals:
    - id: '[Service-Principal-Id]'
      secret: '[Service-Principal-Secret]'
  include_tags: 'env:prod'
  exclude_tags: 'env:dev'

設定値の取得方法:

項目 取得方法
subscription Azure Portal > Subscriptions > Subscription ID
tenant Azure Portal > Azure AD > Directory (tenant) ID
principals.id App registrations > Application (client) ID
principals.secret App registrations > Certificates & secrets > Client secret Value

セキュリティのベストプラクティス: - Client secretは定期的にローテーション(24ヶ月推奨) - 本番環境ではsecrets.mdのVault統合を使用 - 最小権限の原則に従い、Monitoring Readerロールのみを付与

SQL Database:

📚 公式ドキュメント: Azure SQL Database

1
2
3
4
com.instana.plugin.azure.sqldb:
  enabled: true
  include_tags: 'env:prod'
  enable_replica_monitoring: true

Service Bus:

📚 公式ドキュメント: Azure Service Bus

1
2
3
4
com.instana.plugin.azure.servicebus:
  enabled: true
  queuesRegex: '.*'
  topicsRegex: '.*'

Alibaba Cloud

📚 公式ドキュメント: Alibaba Cloud

1
2
3
4
com.instana.plugin.alicloud:
  enabled: true
  accessKeyId: '[Access-Key-Id]'
  accessKeySecret: '[Access-Key-Secret]'

その他のAWSサービス

AWS AppSync:

📚 公式ドキュメント: AWS AppSync

1
2
3
4
5
com.instana.plugin.aws.appsync:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'env:prod'
  exclude_tags: 'env:dev'

AWS Auto Scaling:

📚 公式ドキュメント: AWS Auto Scaling

1
2
3
4
com.instana.plugin.aws.autoscaling:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'env:prod'

AWS Elastic Beanstalk:

📚 公式ドキュメント: AWS Elastic Beanstalk

1
2
3
4
com.instana.plugin.aws.beanstalk:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'app:webapp'

AWS CloudFront:

📚 公式ドキュメント: AWS CloudFront

1
2
3
4
5
com.instana.plugin.aws.cloudfront:
  enabled: true
  enable_function_monitoring: true
  cloudwatch_period: 60
  include_tags: 'cdn:prod'

AWS EBS (Elastic Block Store):

📚 公式ドキュメント: AWS EBS

1
2
3
4
com.instana.plugin.aws.ebs:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'storage:prod'

AWS ElastiCache:

📚 公式ドキュメント: AWS ElastiCache

1
2
3
4
com.instana.plugin.aws.ec:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'cache:redis'

AWS EC2:

📚 公式ドキュメント: AWS EC2

1
2
3
com.instana.plugin.aws.ec2:
  enabled: true
  tags-poll-rate: 30  # タグ情報の取得間隔(秒)

AWS ELB (Elastic Load Balancer):

📚 公式ドキュメント: AWS ELB

1
2
3
4
com.instana.plugin.aws.elb:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'lb:prod'

AWS EMR (Elastic MapReduce):

📚 公式ドキュメント: AWS EMR

1
2
3
4
com.instana.plugin.aws.emr:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'bigdata:prod'

AWS Elasticsearch Service:

📚 公式ドキュメント: AWS Elasticsearch

1
2
3
4
com.instana.plugin.aws.es:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'search:prod'

AWS IoT Core:

📚 公式ドキュメント: AWS IoT Core

1
2
3
com.instana.plugin.aws.iotcore:
  enabled: true
  cloudwatch_period: 300

AWS Kinesis:

📚 公式ドキュメント: AWS Kinesis

1
2
3
4
com.instana.plugin.aws.kinesis:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'stream:prod'

AWS MQ:

📚 公式ドキュメント: AWS MQ

com.instana.plugin.aws.mq:
  enabled: true
  cloudwatch_period: 300
  BROKER_NAME_ACTIVEMQ:
    queues:
      - 'queue1'
      - 'queue2'
    topics:
      - 'topic1'
  BROKER_NAME_RABBITMQ:
    queues:
      - 'queue1'

AWS MSK (Managed Streaming for Kafka):

📚 公式ドキュメント: AWS MSK

1
2
3
4
com.instana.plugin.aws.msk:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'kafka:prod'

AWS Redshift:

📚 公式ドキュメント: AWS Redshift

1
2
3
4
com.instana.plugin.aws.redshift:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'warehouse:prod'

AWS SNS (Simple Notification Service):

📚 公式ドキュメント: AWS SNS

1
2
3
4
com.instana.plugin.aws.sns:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'notification:prod'

AWS Timestream:

📚 公式ドキュメント: AWS Timestream

1
2
3
com.instana.plugin.aws.timestream:
  enabled: true
  cloudwatch_period: 300

AWS DocumentDB:

📚 公式ドキュメント: AWS DocumentDB

1
2
3
4
com.instana.plugin.aws.documentdb:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'docdb:prod'

AWS X-Ray:

📚 公式ドキュメント: AWS X-Ray

1
2
3
4
com.instana.plugin.aws.xray:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'tracing:enabled'

Google Cloud Platform(詳細)

📚 公式ドキュメント: Google Cloud Platform(詳細)

GCP Datastore:

📚 公式ドキュメント: GCP Datastore

1
2
3
4
com.instana.plugin.gcp.datastore:
  enabled: true
  poll_rate: 60
  credentials_path: '/opt/instana/credentials/gcp-creds.json'

GCP Cloud Run:

📚 公式ドキュメント: GCP Cloud Run

1
2
3
4
5
6
com.instana.plugin.gcp.run:
  enabled: true
  poll_rate: 60
  credentials_path: '/opt/instana/credentials/gcp-creds.json'
  include_tags: 'env:prod'
  exclude_tags: 'env:dev'

GCP Cloud Storage:

📚 公式ドキュメント: GCP Cloud Storage

### Azure(詳細)

📚 **公式ドキュメント:** [Azure(詳細)](https://www.ibm.com/docs/en/instana-observability/azure)

**Azure Managed HSM:**

📚 **公式ドキュメント:** [Azure Managed HSM](https://www.ibm.com/docs/en/instana-observability/azure)

```yaml
com.instana.plugin.azure.managedhsm:
  enabled: true

Azure Application Gateway:

📚 公式ドキュメント: Azure Application Gateway

com.instana.plugin.azure.applicationgateway:
  enabled: true

Azure API Management:

📚 公式ドキュメント: Azure API Management

1
2
3
4
5
com.instana.plugin.azure.apimanagement:
  apis:
    API_MANAGEMENT_SERVICE_NAME:
      - 'api-name-1'
      - 'api-name-2'

Azure Key Vault:

📚 公式ドキュメント: Azure Key Vault

com.instana.plugin.azure.keyvault:
  enabled: true

Azure Purview:

📚 公式ドキュメント: Azure Purview

com.instana.plugin.azure.purview:
  enabled: true

Azure PostgreSQL:

📚 公式ドキュメント: Azure PostgreSQL

com.instana.plugin.azure.postgresql:
  enabled: true

Azure Data Factory:

📚 公式ドキュメント: Azure Data Factory

com.instana.plugin.azure.datafactory:
  enabled: true

Azure Load Balancer:

📚 公式ドキュメント: Azure Load Balancer

com.instana.plugin.azure.loadbalancer:
  enabled: true

Azure SignalR:

📚 公式ドキュメント: Azure SignalR

com.instana.plugin.azure.signalr:
  enabled: true

Azure MySQL:

📚 公式ドキュメント: Azure MySQL

com.instana.plugin.azure.mysql:
  enabled: true

Azure Machine Learning:

📚 公式ドキュメント: Azure Machine Learning

com.instana.plugin.azure.machinelearning:
  enabled: true

Azure Databricks:

📚 公式ドキュメント: Azure Databricks

com.instana.plugin.azure.databricks:
  enabled: true

Azure Event Hub:

📚 公式ドキュメント: Azure Event Hub

com.instana.plugin.azure.eventhub:
  enabled: true

Alibaba Cloud(詳細)

📚 公式ドキュメント: Alibaba Cloud(詳細)

Alibaba Cloud RocketMQ:

📚 公式ドキュメント: Alibaba Cloud RocketMQ

1
2
3
4
5
6
com.instana.plugin.alicloud.rocketmq:
  enabled: true
  accessKeyId: '[Access-Key-Id]'
  accessKeySecret: '[Access-Key-Secret]'
  regionId: 'cn-hangzhou'
  poll_rate: 60

Alibaba Cloud RDS MySQL:

📚 公式ドキュメント: Alibaba Cloud RDS MySQL

1
2
3
4
5
6
com.instana.plugin.alicloud.rds.mysql:
  enabled: true
  accessKeyId: '[Access-Key-Id]'
  accessKeySecret: '[Access-Key-Secret]'
  regionId: 'cn-hangzhou'
  poll_rate: 60

Alibaba Cloud OSS (Object Storage Service):

1
2
3
4
5
6
com.instana.plugin.alicloud.oss:
  enabled: true
  accessKeyId: '[Access-Key-Id]'
  accessKeySecret: '[Access-Key-Secret]'
  regionId: 'cn-hangzhou'
  poll_rate: 60

MySQL

📚 公式ドキュメント: MySQL

1
2
3
4
5
6
7
8
com.instana.plugin.mysql:
  user: 'monitoring_user'
  password: 'secure_password'
  enabled: true
  poll_rate: 6
  schema_excludes: ['INFORMATION_SCHEMA', 'PERFORMANCE_SCHEMA']
  sslTrustStore: '/path/to/truststore.jks'
  sslTrustStorePassword: 'truststore_password'

設定値の取得方法:

項目 取得方法
user/password 下記のSQLで監視ユーザーを作成
schema_excludes SHOW DATABASES;でスキーマ一覧を確認
sslTrustStore MySQL管理者からSSL証明書を取得し、keytoolでJKSに変換

監視ユーザーの作成:

1
2
3
CREATE USER 'monitoring_user'@'%' IDENTIFIED BY 'secure_password';
GRANT SELECT, PROCESS, REPLICATION CLIENT ON *.* TO 'monitoring_user'@'%';
FLUSH PRIVILEGES;

PostgreSQL

📚 公式ドキュメント: PostgreSQL

1
2
3
4
5
com.instana.plugin.postgresql:
  user: 'monitoring_user'
  password: 'secure_password'
  database: 'postgres'
  isRootlessPodman: false

設定値の取得方法:

項目 取得方法
user/password 下記のSQLで監視ユーザーを作成
database \lコマンドでデータベース一覧を確認(通常は'postgres')

監視ユーザーの作成:

CREATE USER monitoring_user WITH PASSWORD 'secure_password';
GRANT pg_monitor TO monitoring_user;

MongoDB

📚 公式ドキュメント: MongoDB

1
2
3
4
5
6
7
8
com.instana.plugin.mongodb:
  enabled: true
  user: 'monitoring_user'
  source: 'admin'
  password: 'secure_password'
  poll_rate:
    general_metrics: 1
    replicaset_metrics: 30

設定値の取得方法:

項目 取得方法
user/password 下記のコマンドで監視ユーザーを作成
source 認証データベース(通常は'admin')

監視ユーザーの作成:

// MongoDBシェルで実行
use admin
db.createUser({
  user: "monitoring_user",
  pwd: "secure_password",
  roles: [
    { role: "clusterMonitor", db: "admin" },
    { role: "read", db: "local" }
  ]
})

MongoDB Atlas:

1
2
3
4
com.instana.plugin.mongodb:
  atlas:
    - publicKey: '[Public-API-Key]'
      privateKey: '[Private-API-Key]'

Atlas APIキーの取得方法: - MongoDB Atlas コンソール > Organization Settings > Access Manager > API Keys > Create API Key

Oracle Database

📚 公式ドキュメント: Oracle Database

com.instana.plugin.oracledb:
  user: 'sys as sysdba'
  password: 'oracle_password'
  host: 'localhost'
  port: '1521'
  poll_rate: 1
  customPolling:
    - poll_rate: 30
      metrics:
        - TOP_CPU_CONSUMING_SESSION_LAST_10_MIN
    - poll_rate: 60
      metrics:
        - TOP_ELAPSED_TIME_QUERIES

設定値の取得方法:

項目 取得方法
user/password 下記のSQLで監視用ユーザーを作成
host/port lsnrctl statusでリスナー情報を確認

監視ユーザーの作成:

1
2
3
4
5
6
7
8
-- Oracle SQLで実行
CREATE USER monitoring_user IDENTIFIED BY oracle_password;
GRANT CREATE SESSION TO monitoring_user;
GRANT SELECT ANY DICTIONARY TO monitoring_user;
GRANT SELECT ON V_$SESSION TO monitoring_user;
GRANT SELECT ON V_$SYSTEM_EVENT TO monitoring_user;
GRANT SELECT ON V_$EVENT_NAME TO monitoring_user;
GRANT SELECT ON V_$RECOVERY_FILE_DEST TO monitoring_user;

Couchbase

📚 公式ドキュメント: Couchbase

1
2
3
4
5
com.instana.plugin.couchbase:
  enabled: true
  user: 'admin'
  password: 'password'
  poll_rate: 1  # 秒単位

設定項目: - user: Couchbase管理者ユーザー名 - password: パスワード - poll_rate: メトリクス収集間隔(デフォルト1秒)

CockroachDB

📚 公式ドキュメント: CockroachDB

1
2
3
com.instana.plugin.cockroachdb:
  enabled: true
  poll_rate: 30  # 秒単位(デフォルト10秒)

特徴: - 分散SQLデータベース - PostgreSQL互換 - 自動スケーリング対応

MariaDB

📚 公式ドキュメント: MariaDB

1
2
3
4
com.instana.plugin.mariadb:
  user: 'monitoring_user'
  password: 'secure_password'
  poll_rate: 10  # 秒単位(デフォルト1秒)

MySQLとの違い: - MySQL互換だが独自の最適化あり - 設定項目はMySQLとほぼ同じ

Memcached

📚 公式ドキュメント: Memcached

1
2
3
4
com.instana.plugin.memcached:
  user: ''  # 認証が必要な場合
  password: ''
  poll_rate: 10  # 秒単位(デフォルト1秒)

用途: - インメモリキャッシュ - セッション管理 - データベースクエリキャッシュ

Redis Enterprise

📚 公式ドキュメント: Redis Enterprise

1
2
3
4
5
com.instana.plugin.redisenterprise:
  enabled: true
  user: 'admin'
  password: 'admin_password'
  poll_rate: 10  # 秒単位

Sybase / SAP SQL Anywhere

📚 公式ドキュメント: Sybase / SAP SQL Anywhere

1
2
3
4
5
6
7
8
9
com.instana.plugin.sybase:
  enabled: true
  servers:
    SERVER_NAME_1:
      port: '2638'  # デフォルトポート
      database: 'demo'  # デフォルトDB
      user: 'DBA'  # デフォルトユーザー
      password: 'sql'
      poll_rate: 1

用途: - SAP環境でのデータベース - 組み込みデータベース用途

Snowflake

📚 公式ドキュメント: Snowflake

com.instana.plugin.snowflake:
  enabled: true
  accounts:
    - account: 'xy12345'
      url: 'https://xy12345.snowflakecomputing.com'
      user: 'monitoring_user'
      password: 'secure_password'
      role: 'ACCOUNTADMIN'
      warehouse: 'COMPUTE_WH'
      poll_rate: 3600
      collectOrganizationData: true
      org_poll_rate: 43200
      availabilityZone: 'Snowflake Production'

設定項目の説明: - account: Snowflakeアカウント識別子 - url: SnowflakeアカウントURL - role: 使用するロール(ACCOUNTADMIN推奨) - warehouse: クエリ実行用ウェアハウス - collectOrganizationData: 組織レベルのデータ収集 - org_poll_rate: 組織データの収集間隔


実践的な使用例

シナリオ1: AWS本番環境の包括的な監視

本番環境で複数のAWSサービスを監視する設定例:

# AWS共通設定
com.instana.plugin.aws:
  access_key:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/aws/monitoring'
        key: 'access_key_id'
  secret_key:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/aws/monitoring'
        key: 'secret_access_key'
  regions:
    - 'us-east-1'
    - 'us-west-2'
    - 'ap-northeast-1'
  tagged-services-poll-rate: 300
  include_tags: 'env:prod,managed-by:terraform'
  exclude_tags: 'env:dev,temp:true'
  enable_batch_discovery: true

# EC2インスタンス監視
com.instana.plugin.aws.ec2:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'env:prod,role:app-server'

# RDS監視
com.instana.plugin.aws.rds:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'env:prod,db-type:mysql'

# Lambda監視
com.instana.plugin.aws.lambda:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'env:prod,runtime:nodejs'

# DynamoDB監視
com.instana.plugin.aws.dynamodb:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'env:prod'

# ELB/ALB監視
com.instana.plugin.aws.elb:
  enabled: true
  cloudwatch_period: 60
  include_tags: 'env:prod'

# S3監視
com.instana.plugin.aws.s3:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'env:prod,backup:enabled'

# SQS監視
com.instana.plugin.aws.sqs:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'env:prod'

# SNS監視
com.instana.plugin.aws.sns:
  enabled: true
  cloudwatch_period: 300
  include_tags: 'env:prod'

# ECS監視

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:GetMetricStatistics",
        "cloudwatch:ListMetrics",
        "ec2:DescribeInstances",
        "ec2:DescribeTags",
        "rds:DescribeDBInstances",
        "rds:ListTagsForResource",
        "lambda:ListFunctions",
        "lambda:ListTags",
        "dynamodb:ListTables",
        "dynamodb:DescribeTable",
        "elasticloadbalancing:DescribeLoadBalancers",
        "elasticloadbalancing:DescribeTags",
        "s3:ListAllMyBuckets",
        "s3:GetBucketTagging",
        "sqs:ListQueues",
        "sqs:GetQueueAttributes",
        "sns:ListTopics",
        "sns:GetTopicAttributes",
        "ecs:ListClusters",
        "ecs:DescribeClusters",
        "eks:ListClusters",
        "eks:DescribeCluster"
      ],
      "Resource": "*"
    }
  ]
}

シナリオ2: Azure本番環境の監視

Azure環境での包括的な監視設定:

# Azure共通設定
com.instana.plugin.azure:
  tenant_id:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/monitoring'
        key: 'tenant_id'
  client_id:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/monitoring'
        key: 'client_id'
  client_secret:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/monitoring'
        key: 'client_secret'
  subscription_id:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/monitoring'
        key: 'subscription_id'
  poll_rate: 300
  include_resource_groups:
    - 'prod-rg-app'
    - 'prod-rg-data'
  include_tags: 'env:prod'

# Virtual Machines監視

# Azure SQL Database監視

# Azure Functions監視

# Azure Kubernetes Service監視

# Azure Storage監視

# Azure Service Bus監視
com.instana.plugin.azure.servicebus:
  enabled: true
  poll_rate: 300
  include_tags: 'env:prod'

Azureサービスプリンシパルの作成:

# サービスプリンシパルの作成
az ad sp create-for-rbac --name "instana-monitoring" \
  --role "Monitoring Reader" \
  --scopes /subscriptions/{subscription-id}

# 出力例
{
  "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "displayName": "instana-monitoring",
  "password": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

シナリオ3: GCP本番環境の監視

Google Cloud Platform環境での監視設定:

# GCP共通設定
com.instana.plugin.gcp:
  project_id: 'my-production-project'
  credentials_path: '/opt/instana/credentials/gcp-prod.json'
  poll_rate: 60
  include_tags: 'env:prod'
  exclude_tags: 'env:dev'

# Compute Engine監視

# Cloud SQL監視

# Cloud Functions監視

# GKE監視

# Cloud Storage監視

# Pub/Sub監視
com.instana.plugin.gcp.pubsub:
  enabled: true
  poll_rate: 300
  include_tags: 'env:prod'

GCPサービスアカウントの作成:

# サービスアカウントの作成
gcloud iam service-accounts create instana-monitoring \
  --display-name="Instana Monitoring"

# 権限の付与
gcloud projects add-iam-policy-binding my-production-project \
  --member="serviceAccount:instana-monitoring@my-production-project.iam.gserviceaccount.com" \
  --role="roles/monitoring.viewer"

# キーの作成
gcloud iam service-accounts keys create gcp-prod.json \
  --iam-account=instana-monitoring@my-production-project.iam.gserviceaccount.com

シナリオ4: マルチクラウド環境の統合監視

AWS、Azure、GCPが混在する環境での設定:

# AWS - 米国リージョン
com.instana.plugin.aws:
  access_key:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/aws/us/monitoring'
        key: 'access_key_id'
  secret_key:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/aws/us/monitoring'
        key: 'secret_access_key'
  regions:
    - 'us-east-1'
    - 'us-west-2'
  include_tags: 'env:prod,cloud:aws,region:us'

# Azure - ヨーロッパリージョン
com.instana.plugin.azure:
  tenant_id:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/eu/monitoring'
        key: 'tenant_id'
  client_id:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/eu/monitoring'
        key: 'client_id'
  client_secret:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/eu/monitoring'
        key: 'client_secret'
  subscription_id:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/azure/eu/monitoring'
        key: 'subscription_id'
  include_resource_groups:
    - 'prod-eu-rg'
  include_tags: 'env:prod,cloud:azure,region:eu'

# GCP - アジアリージョン
com.instana.plugin.gcp:
  project_id: 'my-prod-asia-project'
  credentials_path: '/opt/instana/credentials/gcp-asia-prod.json'
  poll_rate: 60
  include_tags: 'env:prod,cloud:gcp,region:asia'

シナリオ5: コスト最適化を考慮した監視設定

CloudWatchコストを最適化しながら効果的に監視:

# 重要なサービス - 高頻度監視
com.instana.plugin.aws.ec2:
  enabled: true
  cloudwatch_period: 60  # 1分間隔
  include_tags: 'env:prod,tier:critical'

com.instana.plugin.aws.rds:
  enabled: true
  cloudwatch_period: 60  # 1分間隔
  include_tags: 'env:prod,tier:critical'

# 通常のサービス - 標準監視
com.instana.plugin.aws.lambda:
  enabled: true
  cloudwatch_period: 300  # 5分間隔
  include_tags: 'env:prod,tier:standard'

com.instana.plugin.aws.dynamodb:
  enabled: true
  cloudwatch_period: 300  # 5分間隔
  include_tags: 'env:prod,tier:standard'

# 低優先度サービス - 低頻度監視
com.instana.plugin.aws.s3:
  enabled: true
  cloudwatch_period: 900  # 15分間隔
  include_tags: 'env:prod,tier:low'

# 開発環境 - 監視対象外
# exclude_tags: 'env:dev' で除外

ベストプラクティス

1. 認証情報の管理

推奨: - ✅ Vaultを使用して認証情報を管理 - ✅ IAMロール/サービスプリンシパルを使用(可能な場合) - ✅ 最小権限の原則に従う - ✅ 定期的に認証情報をローテーション

AWS IAMロールの使用(EC2インスタンス):

1
2
3
4
5
# IAMロールを使用する場合、access_keyとsecret_keyは不要
com.instana.plugin.aws:
  regions:
    - 'us-east-1'
  # EC2インスタンスに割り当てられたIAMロールを自動使用

2. タグ戦略

効果的なタグ付けで監視対象を管理:

# 推奨タグ構造
include_tags: 'env:prod,team:backend,app:api,tier:critical'

# タグの命名規則
# - env: 環境(prod, staging, dev)
# - team: チーム名
# - app: アプリケーション名
# - tier: 重要度(critical, standard, low)
# - cost-center: コストセンター
# - managed-by: 管理ツール(terraform, cloudformation)

3. リージョン戦略

# 本番環境 - 複数リージョン監視
com.instana.plugin.aws:
  regions:
    - 'us-east-1'      # プライマリ
    - 'us-west-2'      # セカンダリ
    - 'ap-northeast-1' # アジア

# 開発環境 - 単一リージョン
com.instana.plugin.aws:
  regions:
    - 'us-east-1'

4. ポーリング間隔の最適化

サービスタイプ 推奨間隔 理由
EC2, RDS, ECS 60秒 リアルタイム監視が必要
Lambda, Functions 300秒 イベント駆動型、頻繁な変更なし
S3, Storage 900秒 静的リソース、変更頻度低
DynamoDB, Cosmos DB 300秒 中程度の変更頻度

5. コスト最適化

CloudWatchコストの削減:

1
2
3
4
5
6
7
# 不要なメトリクスを除外
com.instana.plugin.aws:
  exclude_tags: 'monitoring:disabled,env:dev,temp:true'

# ポーリング間隔を調整
com.instana.plugin.aws.s3:
  cloudwatch_period: 900  # 15分間隔でコスト削減

推定コスト(AWS CloudWatch): - 1分間隔: $0.30/メトリクス/月 - 5分間隔: $0.10/メトリクス/月 - 15分間隔: $0.05/メトリクス/月

6. 高可用性構成

# 複数のAvailability Zoneを監視
com.instana.plugin.aws.ec2:
  enabled: true
  include_tags: 'env:prod'
  # 自動的に全AZのインスタンスを監視

# フェイルオーバー構成
com.instana.plugin.aws.rds:
  enabled: true
  include_tags: 'env:prod,ha:enabled'
  # プライマリとスタンバイの両方を監視

7. セキュリティ

# VPC内のプライベートリソース監視
com.instana.plugin.aws:
  # VPC Endpointを使用してプライベート接続
  use_vpc_endpoint: true

# 暗号化された認証情報
com.instana.plugin.aws:
  access_key:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/aws/monitoring'
        key: 'access_key_id'

パフォーマンスチューニング

API呼び出しの最適化

1
2
3
4
5
6
7
8
# バッチディスカバリーを有効化
com.instana.plugin.aws:
  enable_batch_discovery: true  # 複数リソースを一度に取得
  tagged-services-poll-rate: 300  # タグ付きサービスの検出間隔

# 不要なサービスを無効化
com.instana.plugin.aws.redshift:
  enabled: false  # 使用していないサービスは無効化

メモリ使用量の最適化

1
2
3
4
# 大規模環境での設定
com.instana.plugin.aws:
  max_resources_per_service: 1000  # サービスごとの最大リソース数
  cache_ttl: 300  # キャッシュTTL(秒)

ネットワーク最適化

1
2
3
4
5
6
# リージョンごとのエンドポイント使用
com.instana.plugin.aws:
  regions:
    - 'us-east-1'
  # 各リージョンのエンドポイントを自動使用
  use_regional_endpoints: true

トラブルシューティング

問題1: 認証エラー

症状:

ERROR: Failed to authenticate with AWS: The security token included in the request is invalid

解決策:

  1. 認証情報の確認

    1
    2
    3
    4
    5
    # AWS CLIでテスト
    aws sts get-caller-identity
    
    # Vaultから取得した値を確認
    vault kv get secret/aws/monitoring
    

  2. IAMポリシーの確認

    # ポリシーの確認
    aws iam get-user-policy --user-name instana-monitoring --policy-name InstanaMonitoring
    

  3. 認証情報のローテーション

    1
    2
    3
    4
    5
    6
    7
    # 新しいアクセスキーの作成
    aws iam create-access-key --user-name instana-monitoring
    
    # Vaultの更新
    vault kv put secret/aws/monitoring \
      access_key_id="new_key" \
      secret_access_key="new_secret"
    

問題2: メトリクスが収集されない

症状: Instanaダッシュボードにクラウドメトリクスが表示されない

解決策:

  1. タグフィルターの確認
    1
    2
    3
    # タグが正しく設定されているか確認
    com.instana.plugin.aws.ec2:
      include_tags: 'env:prod'  # タグが一致するか確認
    
# AWSリソースのタグ確認
aws ec2 describe-instances --filters "Name=tag:env,Values=prod"
  1. CloudWatch APIの制限

    1
    2
    3
    4
    5
    6
    7
    8
    9
    # CloudWatch APIの使用状況確認
    aws cloudwatch get-metric-statistics \
      --namespace AWS/EC2 \
      --metric-name CPUUtilization \
      --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
      --start-time 2024-01-01T00:00:00Z \
      --end-time 2024-01-01T01:00:00Z \
      --period 300 \
      --statistics Average
    

  2. Agentログの確認

    1
    2
    3
    4
    5
    # Instana Agentログの確認
    sudo journalctl -u instana-agent -f | grep -i aws
    
    # エラーメッセージの確認
    tail -f /opt/instana/agent/data/log/agent.log | grep -i cloudwatch
    

問題3: 高いCloudWatchコスト

症状: CloudWatchの請求額が予想より高い

解決策:

  1. ポーリング間隔の調整

    1
    2
    3
    # 重要度の低いサービスの間隔を延長
    com.instana.plugin.aws.s3:
      cloudwatch_period: 900  # 1分から15分に変更
    

  2. 不要なメトリクスの除外

    1
    2
    3
    # 開発環境を除外
    com.instana.plugin.aws:
      exclude_tags: 'env:dev,env:test'
    

  3. コスト分析

    1
    2
    3
    4
    5
    6
    7
    8
    9
    # CloudWatch使用状況の確認
    aws cloudwatch list-metrics --namespace AWS/EC2
    
    # Cost Explorerでコスト分析
    aws ce get-cost-and-usage \
      --time-period Start=2024-01-01,End=2024-01-31 \
      --granularity MONTHLY \
      --metrics BlendedCost \
      --filter file://filter.json
    

問題4: リージョン間の遅延

症状: 特定のリージョンのメトリクス取得が遅い

解決策:

  1. リージョナルエンドポイントの使用

    com.instana.plugin.aws:
      use_regional_endpoints: true
    

  2. ネットワーク接続の確認

    1
    2
    3
    4
    5
    # エンドポイントへの接続テスト
    curl -I https://monitoring.us-east-1.amazonaws.com
    
    # レイテンシの確認
    ping monitoring.us-east-1.amazonaws.com
    

  3. Agentの配置最適化

  4. 各リージョンにAgentを配置
  5. VPC Endpointを使用してプライベート接続

問題5: Azure認証エラー

症状:

ERROR: Failed to authenticate with Azure: AADSTS70011: The provided value for the input parameter 'scope' is not valid

解決策:

  1. サービスプリンシパルの確認

    1
    2
    3
    4
    5
    # サービスプリンシパルの確認
    az ad sp show --id <client-id>
    
    # ロールの確認
    az role assignment list --assignee <client-id>
    

  2. 権限の再付与

    1
    2
    3
    4
    5
    # Monitoring Readerロールの付与
    az role assignment create \
      --assignee <client-id> \
      --role "Monitoring Reader" \
      --scope /subscriptions/<subscription-id>
    

  3. トークンの更新

    # 新しいシークレットの作成
    az ad sp credential reset --id <client-id>
    

問題6: GCP認証エラー

症状:

ERROR: Failed to authenticate with GCP: Invalid JWT Signature

解決策:

  1. サービスアカウントキーの確認

    1
    2
    3
    4
    5
    6
    7
    # キーファイルの検証
    cat /opt/instana/credentials/gcp-prod.json | jq .
    
    # 権限の確認
    gcloud projects get-iam-policy my-production-project \
      --flatten="bindings[].members" \
      --filter="bindings.members:serviceAccount:instana-monitoring@*"
    

  2. 新しいキーの作成

    1
    2
    3
    4
    5
    6
    7
    # 古いキーの削除
    gcloud iam service-accounts keys delete <key-id> \
      --iam-account=instana-monitoring@my-production-project.iam.gserviceaccount.com
    
    # 新しいキーの作成
    gcloud iam service-accounts keys create gcp-prod-new.json \
      --iam-account=instana-monitoring@my-production-project.iam.gserviceaccount.com
    

  3. ファイルパーミッションの確認

    1
    2
    3
    # 適切なパーミッションを設定
    chmod 600 /opt/instana/credentials/gcp-prod.json
    chown instana:instana /opt/instana/credentials/gcp-prod.json
    


よくある質問(FAQ)

Q1: 複数のAWSアカウントを監視できますか?

A: はい、複数のアカウントを監視できます。各アカウントごとに異なる認証情報を設定します。

# アカウント1(本番環境)
com.instana.plugin.aws:
  access_key:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/aws/prod/monitoring'
        key: 'access_key_id'
  regions:
    - 'us-east-1'
  include_tags: 'account:prod'

# アカウント2(開発環境)
com.instana.plugin.aws:
  access_key:
    configuration_from:
      type: vault
      secret_key:
        path: 'secret/aws/dev/monitoring'
        key: 'access_key_id'
  regions:
    - 'us-east-1'
  include_tags: 'account:dev'

Q2: CloudWatchのコストを削減する方法は?

A: 以下の方法でコストを削減できます: - ポーリング間隔を延長(60秒→300秒) - 不要なリソースを除外(タグフィルター使用) - 開発環境を監視対象から除外 - 重要度に応じて監視頻度を調整

Q3: オンプレミスとクラウドの両方を監視できますか?

A: はい、Instana Agentは同一の設定ファイルでオンプレミスとクラウドの両方を監視できます。

Q4: クラウドプロバイダー間でメトリクスを比較できますか?

A: はい、Instanaダッシュボードで統一されたビューで比較できます。タグを使用してクラウドプロバイダーを識別することを推奨します。

Q5: IAMロールとアクセスキー、どちらを使用すべきですか?

A: - EC2インスタンス上のAgent: IAMロールを使用(推奨) - オンプレミスのAgent: アクセスキーを使用(Vault経由) - コンテナ環境: IAM Roles for Service Accounts(IRSA)を使用

Q6: マルチリージョン環境での監視のベストプラクティスは?

A: - 各リージョンにAgentを配置 - リージョナルエンドポイントを使用 - タグでリージョンを識別 - リージョンごとに異なるポーリング間隔を設定可能

Q7: クラウドサービスの新機能はいつサポートされますか?

A: Instanaは定期的にアップデートされ、新しいクラウドサービスのサポートが追加されます。最新情報は公式ドキュメントを確認してください。


参考リンク

AWS

Azure

GCP

マルチクラウド