GetMetricStreamCommand

Returns information about the metric stream that you specify.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CloudWatchClient, GetMetricStreamCommand } from "@aws-sdk/client-cloudwatch"; // ES Modules import
// const { CloudWatchClient, GetMetricStreamCommand } = require("@aws-sdk/client-cloudwatch"); // CommonJS import
const client = new CloudWatchClient(config);
const input = { // GetMetricStreamInput
  Name: "STRING_VALUE", // required
};
const command = new GetMetricStreamCommand(input);
const response = await client.send(command);
// { // GetMetricStreamOutput
//   Arn: "STRING_VALUE",
//   Name: "STRING_VALUE",
//   IncludeFilters: [ // MetricStreamFilters
//     { // MetricStreamFilter
//       Namespace: "STRING_VALUE",
//       MetricNames: [ // MetricStreamFilterMetricNames
//         "STRING_VALUE",
//       ],
//     },
//   ],
//   ExcludeFilters: [
//     {
//       Namespace: "STRING_VALUE",
//       MetricNames: [
//         "STRING_VALUE",
//       ],
//     },
//   ],
//   FirehoseArn: "STRING_VALUE",
//   RoleArn: "STRING_VALUE",
//   State: "STRING_VALUE",
//   CreationDate: new Date("TIMESTAMP"),
//   LastUpdateDate: new Date("TIMESTAMP"),
//   OutputFormat: "json" || "opentelemetry0.7" || "opentelemetry1.0",
//   StatisticsConfigurations: [ // MetricStreamStatisticsConfigurations
//     { // MetricStreamStatisticsConfiguration
//       IncludeMetrics: [ // MetricStreamStatisticsIncludeMetrics // required
//         { // MetricStreamStatisticsMetric
//           Namespace: "STRING_VALUE", // required
//           MetricName: "STRING_VALUE", // required
//         },
//       ],
//       AdditionalStatistics: [ // MetricStreamStatisticsAdditionalStatistics // required
//         "STRING_VALUE",
//       ],
//     },
//   ],
//   IncludeLinkedAccountsMetrics: true || false,
// };

GetMetricStreamCommand Input

See GetMetricStreamCommandInput for more details

Parameter
Type
Description
Name
Required
string | undefined

The name of the metric stream to retrieve information about.

GetMetricStreamCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Arn
string | undefined

The ARN of the metric stream.

CreationDate
Date | undefined

The date that the metric stream was created.

ExcludeFilters
MetricStreamFilter[] | undefined

If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream.

FirehoseArn
string | undefined

The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric stream.

IncludeFilters
MetricStreamFilter[] | undefined

If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream.

IncludeLinkedAccountsMetrics
boolean | undefined

If this is true and this metric stream is in a monitoring account, then the stream includes metrics from source accounts that the monitoring account is linked to.

LastUpdateDate
Date | undefined

The date of the most recent update to the metric stream's configuration.

Name
string | undefined

The name of the metric stream.

OutputFormat
MetricStreamOutputFormat | undefined

The output format for the stream. Valid values are json, opentelemetry1.0, and opentelemetry0.7. For more information about metric stream output formats, see Metric streams output formats .

RoleArn
string | undefined

The ARN of the IAM role that is used by this metric stream.

State
string | undefined

The state of the metric stream. The possible values are running and stopped.

StatisticsConfigurations
MetricStreamStatisticsConfiguration[] | undefined

Each entry in this array displays information about one or more metrics that include additional statistics in the metric stream. For more information about the additional statistics, see CloudWatch statistics definitions .

Throws

Name
Fault
Details
InternalServiceFault
server

Request processing has failed due to some unknown error, exception, or failure.

InvalidParameterCombinationException
client

Parameters were used together that cannot be used together.

InvalidParameterValueException
client

The value of an input parameter is bad or out-of-range.

MissingRequiredParameterException
client

An input parameter that is required is missing.

ResourceNotFoundException
client

The named resource does not exist.

CloudWatchServiceException
Base exception class for all service exceptions from CloudWatch service.