エージェント構成の作成

ロギングでエージェント構成を作成し、メトリック・データをカスタム・メトリックに取り込みます。

    1. ナビゲーション・メニューを開き、「監視および管理」をクリックします。「モニタリング」で、「エージェント構成」をクリックします。
    2. 「リスト範囲」で、作業する権限があるコンパートメントを選択します。
    3. 「エージェント構成の作成」をクリックします。
    4. 「エージェント構成の作成」パネルで、構成の名前と説明を入力します。機密情報を入力しないでください。
    5. 構成を作成するコンパートメントを選択します。
    6. 「ホスト・グループの選択」「グループ・タイプ」で、オプションを選択し、目的のグループを選択します。
      たとえば、「動的グループ」を選択し、リソースとエージェント構成に一致する動的グループを選択します。
    7. 「エージェント構成」で、メトリック入力のベースURLを入力します。

      たとえば、Prometheus形式のHTTPエンドポイントを使用して、仮想マシン(VM)からメトリックを公開します。

      http://1.2.3.4:9100/metrics
    8. オプションで、「別のエンドポイント」をクリックして別のエンドポイントを追加します。
      すべてのエンドポイントが同じコンパートメントおよびネームスペースに移動します。
    9. 「メトリック宛先の選択」で、カスタム・メトリックを公開するコンパートメントおよびメトリック・ネームスペースを選択します。
    10. (オプション)「追加オプションの表示」をクリックします。「タグの追加」で、必要に応じてタグを追加します。
    11. 「作成」をクリックします。
    エージェント構成が作成され、「エージェント構成」ページに表示されます。
  • エージェント構成を作成するには、oci logging agent-configuration createコマンドと必要なパラメータを使用します:

    oci logging agent-configuration create compartment-id compartment_ocid --is-enabled [true|false] --service-configuration service_configuration [OPTIONS]
    コマンドおよびJSONファイルの例
    oci logging agent-configuration create --description <description> \
    --display-name <display_name> --group-association file://group-association.json \
    --compartment-id <compartment_id> --is-enabled true \
    --service-configuration file://create-service-configuration.json --wait-for-state SUCCEEDED --max-wait-seconds 60

    group-association.json:

    {
      "groupList": [
        "<dynamic_group_id>"
      ]
    }

    create-service-configuration.json:

    {
        "configurationType": "MONITORING",
        "applicationConfigurations": [
          {
            "sourceType": "KUBERNETES",
            "source": {
              "name": "KUBERNETES-uniqueid",
              "scrapeTargets": [
                {
                  "resourceType": "PODS",
                  "k8sNamespace": "k8s-namespace"
                }
              ]
            },
            "destination": {
              "compartmentId": "<compartment_id>",
              "metricsNamespace": "metricsnamespace"
            },
            "filter": {
              "allowList": [
                "regex-test"
              ],
              "denyList": [],
              "filterType": "KUBERNETES_FILTER",
              "name": "test"
            }
          }
        ]
      }

    CLIコマンドのパラメータおよび値の完全なリストは、CLIコマンド・リファレンスを参照してください。

  • CreateUnifiedAgentConfiguration操作を実行して、エージェント構成を作成します。

    APIリクエストの例
    POST /20200531/unifiedAgentConfigurations
    Host: https://logging.us-phoenix-1.oci.oraclecloud.com
    <authorization and other headers>
    {
      "serviceConfiguration": {
        "configurationType": "MONITORING",
        "applicationConfigurations": [
          {
            "sourceType": "KUBERNETES",
            "source": {
              "name": "KUBERNETES-uniqueid",
              "scrapeTargets": [
                {
                  "resourceType": "PODS",
                  "k8sNamespace": "k8s-namespace"
                }
              ]
            },
            "destination": {
              "compartmentId": "<compartment_id>",
              "metricsNamespace": "metricsnamespace"
            },
            "filter": {
              "allowList": [
                "regex-test"
              ],
              "denyList": [],
              "filterType": "KUBERNETES_FILTER",
              "name": "test"
            }
          }
        ]
      },
      "displayName": "mar-test",
      "isEnabled": true,
      "groupAssociation": {
        "groupList": [
          "<dynamic_group_id>"
        ]
      },
      "description": "test",
      "compartmentId": "<compartment_id>"
    }