エージェント構成の作成
メトリック・データをカスタム・メトリックに取り込むために、ロギングでエージェント構成を作成します。
エージェント構成の更新が検出され、自動的にロードされます。
新しく作成したエージェント構成が「エージェント構成」ページにリストされます。 エージェント構成を作成するには、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>" }