CloudWatch Observability Admin examples using Amazon CLI - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

This documentation is for Version 1 of the Amazon CLI only. For documentation related to Version 2 of the Amazon CLI, see the Version 2 User Guide.

CloudWatch Observability Admin examples using Amazon CLI

The following code examples show you how to perform actions and implement common scenarios by using the Amazon Command Line Interface with CloudWatch Observability Admin.

Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.

Topics

Actions

The following code example shows how to use get-telemetry-evaluation-status-for-organization.

Amazon CLI

To get telemetry onboarding status for the organization

The following get-telemetry-evaluation-status-for-organization example returns the current onboarding status of the telemetry config feature for the organization.

aws observabilityadmin get-telemetry-evaluation-status-for-organization

Output:

{ "Status": "RUNNING" }

For more information, see Auditing CloudWatch telemetry configurations in the Amazon CloudWatch User Guide.

The following code example shows how to use get-telemetry-evaluation-status.

Amazon CLI

To get telemetry onboarding status for the account

The following get-telemetry-evaluation-status example returns the current onboarding status of the telemetry config feature in the specified account.

aws observabilityadmin get-telemetry-evaluation-status

Output:

{ "Status": "RUNNING" }

For more information, see Auditing CloudWatch telemetry configurations in the Amazon CloudWatch User Guide.

The following code example shows how to use list-resource-telemetry-for-organization.

Amazon CLI

To retrieve the telemetry configurations for the organization

The following list-resource-telemetry-for-organization example returns a list of telemetry configurations in the organization for Amazon resources supported by telemetry config.

aws observabilityadmin list-resource-telemetry-for-organization \ --resource-types AWS::EC2::Instance

Output:

{ "TelemetryConfigurations": [ { "AccountIdentifier": "111111111111", "TelemetryConfigurationState": { "Logs": "NotApplicable", "Metrics": "Disabled", "Traces": "NotApplicable" }, "ResourceType": "AWS::EC2::Instance", "ResourceIdentifier": "i-a166400b", "ResourceTags": { "Name": "dev" }, "LastUpdateTimeStamp": 1733168548521 }, { "AccountIdentifier": "222222222222", "TelemetryConfigurationState": { "Logs": "NotApplicable", "Metrics": "Disabled", "Traces": "NotApplicable" }, "ResourceType": "AWS::EC2::Instance", "ResourceIdentifier": "i-b188560f", "ResourceTags": { "Name": "apache" }, "LastUpdateTimeStamp": 1732744260182 } ] }

For more information, see Auditing CloudWatch telemetry configurations in the Amazon CloudWatch User Guide.

The following code example shows how to use list-resource-telemetry.

Amazon CLI

To retrieve the telemetry configurations for the account

The following list-resource-telemetry example returns a list of telemetry configurations for Amazon resources supported by telemetry config in the specified account.

aws observabilityadmin list-resource-telemetry \ --resource-types AWS::EC2::Instance

Output:

{ "TelemetryConfigurations": [ { "AccountIdentifier": "111111111111", "TelemetryConfigurationState": { "Logs": "NotApplicable", "Metrics": "Disabled", "Traces": "NotApplicable" }, "ResourceType": "AWS::EC2::Instance", "ResourceIdentifier": "i-0e979d278b040f856", "ResourceTags": { "Name": "apache" }, "LastUpdateTimeStamp": 1732744260182 } ] }

For more information, see Auditing CloudWatch telemetry configurations in the Amazon CloudWatch User Guide.

The following code example shows how to use start-telemetry-evaluation-for-organization.

Amazon CLI

To enable the telemetry config feature

The following start-telemetry-evaluation-for-organization example enables the telemetry config feature for the organization.

aws observabilityadmin start-telemetry-evaluation-for-organization

This command produces no output.

For more information, see Turning on CloudWatch telemetry auditing in the Amazon CloudWatch User Guide.

The following code example shows how to use start-telemetry-evaluation.

Amazon CLI

To enable the telemetry config feature

The following start-telemetry-evaluation example enables the telemetry config feature in the specified account.

aws observabilityadmin start-telemetry-evaluation

This command produces no output.

For more information, see Turning on CloudWatch telemetry auditing in the Amazon CloudWatch User Guide.

The following code example shows how to use stop-telemetry-evaluation-for-organization.

Amazon CLI

To disable the telemetry config feature

The following stop-telemetry-evaluation-for-organization example disables the telemetry config feature for the organization.

aws observabilityadmin stop-telemetry-evaluation-for-organization

This command produces no output.

For more information, see Turning off CloudWatch telemetry auditing in the Amazon CloudWatch User Guide.

The following code example shows how to use stop-telemetry-evaluation.

Amazon CLI

To disable the telemetry config feature

The following stop-telemetry-evaluation example disables the telemetry config feature in the specified account.

aws observabilityadmin stop-telemetry-evaluation

This command produces no output.

For more information, see Turning off CloudWatch telemetry auditing in the Amazon CloudWatch User Guide.