# MetricOptions

Struct · Stable

Properties of a metric that can be changed.

Extends: [CommonMetricOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.CommonMetricOptions.html)
Used as argument in: [Activity.metric](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.Activity.html#metric), [Activity.metricFailed](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.Activity.html#metricfailed), Activity.metricHeartbeatTimedOut, Activity.metricRunTime, Activity.metricScheduleTime, Activity.metricScheduled, Activity.metricStarted, Activity.metricSucceeded, Activity.metricTime, Activity.metricTimedOut, ApplicationLoadBalancer.metric, ApplicationLoadBalancer.metricActiveConnectionCount, ApplicationLoadBalancer.metricClientTlsNegotiationErrorCount, ApplicationLoadBalancer.metricConsumedLCUs, ApplicationLoadBalancer.metricElbAuthError, ApplicationLoadBalancer.metricElbAuthFailure, ApplicationLoadBalancer.metricElbAuthLatency, ApplicationLoadBalancer.metricElbAuthSuccess, ApplicationLoadBalancer.metricHttpCodeElb, ApplicationLoadBalancer.metricHttpCodeTarget, ApplicationLoadBalancer.metricHttpFixedResponseCount, ApplicationLoadBalancer.metricHttpRedirectCount, ApplicationLoadBalancer.metricHttpRedirectUrlLimitExceededCount, ApplicationLoadBalancer.metricIpv6ProcessedBytes, ApplicationLoadBalancer.metricIpv6RequestCount, ApplicationLoadBalancer.metricNewConnectionCount, ApplicationLoadBalancer.metricProcessedBytes, ApplicationLoadBalancer.metricRejectedConnectionCount, ApplicationLoadBalancer.metricRequestCount, ApplicationLoadBalancer.metricRuleEvaluations, ApplicationLoadBalancer.metricTargetConnectionErrorCount, ApplicationLoadBalancer.metricTargetResponseTime, ApplicationLoadBalancer.metricTargetTLSNegotiationErrorCount, ApplicationTargetGroup.metric, ApplicationTargetGroup.metricHealthyHostCount, ApplicationTargetGroup.metricHttpCodeTarget, ApplicationTargetGroup.metricIpv6RequestCount, ApplicationTargetGroup.metricRequestCount, ApplicationTargetGroup.metricRequestCountPerTarget, ApplicationTargetGroup.metricTargetConnectionErrorCount, ApplicationTargetGroup.metricTargetResponseTime, ApplicationTargetGroup.metricTargetTLSNegotiationErrorCount, ApplicationTargetGroup.metricUnhealthyHostCount, BaseService.metric, BaseService.metricCpuUtilization, BaseService.metricMemoryUtilization, Canary.metricDuration, Canary.metricFailed, Canary.metricSuccessPercent, Cluster.metric, Cluster.metricCpuReservation, Cluster.metricCpuUtilization, Cluster.metricMemoryReservation, Cluster.metricMemoryUtilization, DatabaseCluster.metricACUUtilization, DatabaseCluster.metricServerlessDatabaseCapacity, DatabaseClusterFromSnapshot.metricACUUtilization, DatabaseClusterFromSnapshot.metricServerlessDatabaseCapacity, DatabaseInstanceMetrics.burstBalance, DatabaseInstanceMetrics.cpuUtilization, DatabaseInstanceMetrics.databaseConnections, DatabaseInstanceMetrics.diskQueueDepth, DatabaseInstanceMetrics.freeStorageSpace, DatabaseInstanceMetrics.freeableMemory, DatabaseInstanceMetrics.metric, DatabaseInstanceMetrics.networkReceiveThroughput, DatabaseInstanceMetrics.networkTransmitThroughput, DatabaseInstanceMetrics.readIOPS, DatabaseInstanceMetrics.readLatency, DatabaseInstanceMetrics.readThroughput, DatabaseInstanceMetrics.replicaLag, DatabaseInstanceMetrics.swapUsage, DatabaseInstanceMetrics.writeIOPS, DatabaseInstanceMetrics.writeLatency, DatabaseInstanceMetrics.writeThroughput, Distribution.metric, Distribution.metric401ErrorRate, Distribution.metric403ErrorRate, Distribution.metric404ErrorRate, Distribution.metric4xxErrorRate, Distribution.metric502ErrorRate, Distribution.metric503ErrorRate, Distribution.metric504ErrorRate, Distribution.metric5xxErrorRate, Distribution.metricBytesDownloaded, Distribution.metricBytesUploaded, Distribution.metricCacheHitRate, Distribution.metricOriginLatency, Distribution.metricRequests, Distribution.metricTotalErrorRate, Function.metricAll, Function.metricAllConcurrentExecutions, Function.metricAllDuration, Function.metricAllErrors, Function.metricAllInvocations, Function.metricAllThrottles, Function.metricAllUnreservedConcurrentExecutions, GuardrailBase.metricAll, GuardrailBase.metricAllInvocationLatency, GuardrailBase.metricAllInvocations, GuardrailBase.metricAllInvocationsIntervened, GuardrailBase.metricAllTextUnitCount, IAgent.metricCount, IApi.metric, IApplication.metric, IApplication.metricBackPressuredTimeMsPerSecond, IApplication.metricBusyTimePerMsPerSecond, IApplication.metricCpuUtilization, IApplication.metricCurrentInputWatermark, IApplication.metricCurrentOutputWatermark, IApplication.metricDowntime, IApplication.metricFullRestarts, IApplication.metricHeapMemoryUtilization, IApplication.metricIdleTimeMsPerSecond, IApplication.metricKpus, IApplication.metricLastCheckpointDuration, IApplication.metricLastCheckpointSize, IApplication.metricManagedMemoryTotal, IApplication.metricManagedMemoryUsed, IApplication.metricManagedMemoryUtilization, IApplication.metricNumLateRecordsDropped, IApplication.metricNumRecordsIn, IApplication.metricNumRecordsInPerSecond, IApplication.metricNumRecordsOut, IApplication.metricNumRecordsOutPerSecond, IApplication.metricNumberOfFailedCheckpoints, IApplication.metricOldGenerationGCCount, IApplication.metricOldGenerationGCTime, IApplication.metricThreadsCount, IApplication.metricUptime, IApplicationLoadBalancerMetrics.activeConnectionCount, IApplicationLoadBalancerMetrics.clientTlsNegotiationErrorCount, IApplicationLoadBalancerMetrics.consumedLCUs, IApplicationLoadBalancerMetrics.custom, IApplicationLoadBalancerMetrics.elbAuthError, IApplicationLoadBalancerMetrics.elbAuthFailure, IApplicationLoadBalancerMetrics.elbAuthLatency, IApplicationLoadBalancerMetrics.elbAuthSuccess, IApplicationLoadBalancerMetrics.httpCodeElb, IApplicationLoadBalancerMetrics.httpCodeTarget, IApplicationLoadBalancerMetrics.httpFixedResponseCount, IApplicationLoadBalancerMetrics.httpRedirectCount, IApplicationLoadBalancerMetrics.httpRedirectUrlLimitExceededCount, IApplicationLoadBalancerMetrics.ipv6ProcessedBytes, IApplicationLoadBalancerMetrics.ipv6RequestCount, IApplicationLoadBalancerMetrics.newConnectionCount, IApplicationLoadBalancerMetrics.processedBytes, IApplicationLoadBalancerMetrics.rejectedConnectionCount, IApplicationLoadBalancerMetrics.requestCount, IApplicationLoadBalancerMetrics.ruleEvaluations, IApplicationLoadBalancerMetrics.targetConnectionErrorCount, IApplicationLoadBalancerMetrics.targetResponseTime, IApplicationLoadBalancerMetrics.targetTLSNegotiationErrorCount, IApplicationTargetGroupMetrics.custom, IApplicationTargetGroupMetrics.healthyHostCount, IApplicationTargetGroupMetrics.httpCodeTarget, IApplicationTargetGroupMetrics.ipv6RequestCount, IApplicationTargetGroupMetrics.requestCount, IApplicationTargetGroupMetrics.requestCountPerTarget, IApplicationTargetGroupMetrics.targetConnectionErrorCount, IApplicationTargetGroupMetrics.targetResponseTime, IApplicationTargetGroupMetrics.targetTLSNegotiationErrorCount, IApplicationTargetGroupMetrics.unhealthyHostCount, IBedrockAgentRuntime.metric (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricInvocations (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricInvocationsAggregated (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricLatency (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricSessionCount (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricSessionsAggregated (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricSystemErrors (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricThrottles (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricTotalErrors (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metricUserErrors (@aws-cdk/aws-bedrock-agentcore-alpha), IBedrockAgentRuntime.metric (aws_bedrockagentcore), IBedrockAgentRuntime.metricInvocations (aws_bedrockagentcore), IBedrockAgentRuntime.metricInvocationsAggregated (aws_bedrockagentcore), IBedrockAgentRuntime.metricLatency (aws_bedrockagentcore), IBedrockAgentRuntime.metricSessionCount (aws_bedrockagentcore), IBedrockAgentRuntime.metricSessionsAggregated (aws_bedrockagentcore), IBedrockAgentRuntime.metricSystemErrors (aws_bedrockagentcore), IBedrockAgentRuntime.metricThrottles (aws_bedrockagentcore), IBedrockAgentRuntime.metricTotalErrors (aws_bedrockagentcore), IBedrockAgentRuntime.metricUserErrors (aws_bedrockagentcore), IBridge.metric, IBridge.metricFailoverSwitches, IBridge.metricSourceBitrate, IBridge.metricSourcePacketLossPercent, IBrowserCustom.metric (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricErrorsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricInvocationsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricLatencyForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricSessionDuration (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricSystemErrorsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricTakeOverCount (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricTakeOverDuration (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricTakeOverReleaseCount (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricThrottlesForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metricUserErrorsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IBrowserCustom.metric (aws_bedrockagentcore), IBrowserCustom.metricErrorsForApiOperation (aws_bedrockagentcore), IBrowserCustom.metricForApiOperation (aws_bedrockagentcore), IBrowserCustom.metricInvocationsForApiOperation (aws_bedrockagentcore), IBrowserCustom.metricLatencyForApiOperation (aws_bedrockagentcore), IBrowserCustom.metricSessionDuration (aws_bedrockagentcore), IBrowserCustom.metricSystemErrorsForApiOperation (aws_bedrockagentcore), IBrowserCustom.metricTakeOverCount (aws_bedrockagentcore), IBrowserCustom.metricTakeOverDuration (aws_bedrockagentcore), IBrowserCustom.metricTakeOverReleaseCount (aws_bedrockagentcore), IBrowserCustom.metricThrottlesForApiOperation (aws_bedrockagentcore), IBrowserCustom.metricUserErrorsForApiOperation (aws_bedrockagentcore), ICertificate.metricDaysToExpiry, IChannel.metric (@aws-cdk/aws-medialive-alpha), IChannel.metricActiveAlerts (@aws-cdk/aws-medialive-alpha), IChannel.metricDroppedFrames (@aws-cdk/aws-medialive-alpha), IChannel.metricFillMsec (@aws-cdk/aws-medialive-alpha), IChannel.metricInputLossSeconds (@aws-cdk/aws-medialive-alpha), IChannel.metricInputVideoFrameRate (@aws-cdk/aws-medialive-alpha), IChannel.metricNetworkIn (@aws-cdk/aws-medialive-alpha), IChannel.metricNetworkOut (@aws-cdk/aws-medialive-alpha), IChannel.metricSvqTime (@aws-cdk/aws-medialive-alpha), IChannel.metric (@aws-cdk/aws-mediapackagev2-alpha), IChannel.metricEgressBytes (@aws-cdk/aws-mediapackagev2-alpha), IChannel.metricEgressRequestCount (@aws-cdk/aws-mediapackagev2-alpha), IChannel.metricEgressResponseTime (@aws-cdk/aws-mediapackagev2-alpha), IChannel.metricIngressBytes (@aws-cdk/aws-mediapackagev2-alpha), IChannel.metricIngressRequestCount (@aws-cdk/aws-mediapackagev2-alpha), IChannel.metricIngressResponseTime (@aws-cdk/aws-mediapackagev2-alpha), IChannelGroup.metric, IChannelGroup.metricEgressBytes, IChannelGroup.metricEgressRequestCount, IChannelGroup.metricEgressResponseTime, IChannelGroup.metricIngressBytes, IChannelGroup.metricIngressRequestCount, IChannelGroup.metricIngressResponseTime, ICodeInterpreterCustom.metric (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricErrorsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricInvocationsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricLatencyForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricSessionDuration (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricSystemErrorsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricThrottlesForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metricUserErrorsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), ICodeInterpreterCustom.metric (aws_bedrockagentcore), ICodeInterpreterCustom.metricErrorsForApiOperation (aws_bedrockagentcore), ICodeInterpreterCustom.metricForApiOperation (aws_bedrockagentcore), ICodeInterpreterCustom.metricInvocationsForApiOperation (aws_bedrockagentcore), ICodeInterpreterCustom.metricLatencyForApiOperation (aws_bedrockagentcore), ICodeInterpreterCustom.metricSessionDuration (aws_bedrockagentcore), ICodeInterpreterCustom.metricSystemErrorsForApiOperation (aws_bedrockagentcore), ICodeInterpreterCustom.metricThrottlesForApiOperation (aws_bedrockagentcore), ICodeInterpreterCustom.metricUserErrorsForApiOperation (aws_bedrockagentcore), IDatabaseCluster.metric (@aws-cdk/aws-neptune-alpha), IDatabaseCluster.metric (aws_rds), IDatabaseCluster.metricCPUUtilization (aws_rds), IDatabaseCluster.metricDatabaseConnections (aws_rds), IDatabaseCluster.metricDeadlocks (aws_rds), IDatabaseCluster.metricEngineUptime (aws_rds), IDatabaseCluster.metricFreeLocalStorage (aws_rds), IDatabaseCluster.metricFreeableMemory (aws_rds), IDatabaseCluster.metricNetworkReceiveThroughput (aws_rds), IDatabaseCluster.metricNetworkThroughput (aws_rds), IDatabaseCluster.metricNetworkTransmitThroughput (aws_rds), IDatabaseCluster.metricSnapshotStorageUsed (aws_rds), IDatabaseCluster.metricTotalBackupStorageBilled (aws_rds), IDatabaseCluster.metricVolumeBytesUsed (aws_rds), IDatabaseCluster.metricVolumeReadIOPs (aws_rds), IDatabaseCluster.metricVolumeWriteIOPs (aws_rds), IDatabaseInstance.metric (@aws-cdk/aws-neptune-alpha), IDatabaseInstance.metric (aws_rds), IDatabaseInstance.metricCPUUtilization (aws_rds), IDatabaseInstance.metricDatabaseConnections (aws_rds), IDatabaseInstance.metricFreeStorageSpace (aws_rds), IDatabaseInstance.metricFreeableMemory (aws_rds), IDatabaseInstance.metricReadIOPS (aws_rds), IDatabaseInstance.metricWriteIOPS (aws_rds), IDeliveryStream.metric, IDeliveryStream.metricBackupToS3Bytes, IDeliveryStream.metricBackupToS3DataFreshness, IDeliveryStream.metricBackupToS3Records, IDeliveryStream.metricIncomingBytes, IDeliveryStream.metricIncomingRecords, IDomain.metric (aws_elasticsearch), IDomain.metricAutomatedSnapshotFailure (aws_elasticsearch), IDomain.metricCPUUtilization (aws_elasticsearch), IDomain.metricClusterIndexWritesBlocked (aws_elasticsearch), IDomain.metricClusterStatusRed (aws_elasticsearch), IDomain.metricClusterStatusYellow (aws_elasticsearch), IDomain.metricFreeStorageSpace (aws_elasticsearch), IDomain.metricIndexingLatency (aws_elasticsearch), IDomain.metricJVMMemoryPressure (aws_elasticsearch), IDomain.metricKMSKeyError (aws_elasticsearch), IDomain.metricKMSKeyInaccessible (aws_elasticsearch), IDomain.metricMasterCPUUtilization (aws_elasticsearch), IDomain.metricMasterJVMMemoryPressure (aws_elasticsearch), IDomain.metricNodes (aws_elasticsearch), IDomain.metricSearchLatency (aws_elasticsearch), IDomain.metricSearchableDocuments (aws_elasticsearch), IDomain.metric (aws_opensearchservice), IDomain.metricAutomatedSnapshotFailure (aws_opensearchservice), IDomain.metricCPUUtilization (aws_opensearchservice), IDomain.metricClusterIndexWritesBlocked (aws_opensearchservice), IDomain.metricClusterStatusRed (aws_opensearchservice), IDomain.metricClusterStatusYellow (aws_opensearchservice), IDomain.metricFreeStorageSpace (aws_opensearchservice), IDomain.metricIndexingLatency (aws_opensearchservice), IDomain.metricJVMMemoryPressure (aws_opensearchservice), IDomain.metricKMSKeyError (aws_opensearchservice), IDomain.metricKMSKeyInaccessible (aws_opensearchservice), IDomain.metricMasterCPUUtilization (aws_opensearchservice), IDomain.metricMasterJVMMemoryPressure (aws_opensearchservice), IDomain.metricNodes (aws_opensearchservice), IDomain.metricSearchLatency (aws_opensearchservice), IDomain.metricSearchableDocuments (aws_opensearchservice), IEndpointInstanceProductionVariant.metric, IEndpointInstanceProductionVariant.metricCpuUtilization, IEndpointInstanceProductionVariant.metricDiskUtilization, IEndpointInstanceProductionVariant.metricGpuMemoryUtilization, IEndpointInstanceProductionVariant.metricGpuUtilization, IEndpointInstanceProductionVariant.metricInvocationResponseCode, IEndpointInstanceProductionVariant.metricInvocations, IEndpointInstanceProductionVariant.metricInvocationsPerInstance, IEndpointInstanceProductionVariant.metricMemoryUtilization, IEndpointInstanceProductionVariant.metricModelLatency, IEndpointInstanceProductionVariant.metricOverheadLatency, IFleet.metric, IFleet.metricActiveInstances, IFleet.metricDesiredInstances, IFleet.metricIdleInstances, IFleet.metricInstanceInterruptions, IFleet.metricMaxInstances, IFleet.metricMinInstances, IFleet.metricPercentIdleInstances, IFlow.metric, IFlow.metricSourceBitrate, IFlow.metricSourceConnected, IFlow.metricSourceDisconnections, IFlow.metricSourceDroppedPackets, IFlow.metricSourceJitter, IFlow.metricSourceNotRecoveredPackets, IFlow.metricSourcePacketLossPercent, IFlow.metricSourceRoundTripTime, IFlow.metricSourceSelected, IFlow.metricSourceTotalPackets, IFunction.metric, IFunction.metricDuration, IFunction.metricErrors, IFunction.metricInvocations, IFunction.metricThrottles, IGameServerGroup.metric, IGameSessionQueue.metric, IGameSessionQueue.metricAverageWaitTime, IGameSessionQueue.metricPlacementsCanceled, IGameSessionQueue.metricPlacementsFailed, IGameSessionQueue.metricPlacementsStarted, IGameSessionQueue.metricPlacementsSucceeded, IGameSessionQueue.metricPlacementsTimedOut, IGateway.metric (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricDuration (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricInvocations (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricLatency (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricSystemErrors (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricTargetExecutionTime (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricTargetType (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricThrottles (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metricUserErrors (@aws-cdk/aws-bedrock-agentcore-alpha), IGateway.metric (@aws-cdk/aws-mediaconnect-alpha), IGateway.metricEgressBridgeDroppedPackets (@aws-cdk/aws-mediaconnect-alpha), IGateway.metricEgressBridgeTotalPackets (@aws-cdk/aws-mediaconnect-alpha), IGateway.metricIngressBridgeDroppedPackets (@aws-cdk/aws-mediaconnect-alpha), IGateway.metricIngressBridgeTotalPackets (@aws-cdk/aws-mediaconnect-alpha), IGateway.metric (aws_bedrockagentcore), IGateway.metricDuration (aws_bedrockagentcore), IGateway.metricInvocations (aws_bedrockagentcore), IGateway.metricLatency (aws_bedrockagentcore), IGateway.metricSystemErrors (aws_bedrockagentcore), IGateway.metricTargetExecutionTime (aws_bedrockagentcore), IGateway.metricTargetType (aws_bedrockagentcore), IGateway.metricThrottles (aws_bedrockagentcore), IGateway.metricUserErrors (aws_bedrockagentcore), IGuardrail.metric, IGuardrail.metricInvocationClientErrors, IGuardrail.metricInvocationLatency, IGuardrail.metricInvocationServerErrors, IGuardrail.metricInvocationThrottles, IGuardrail.metricInvocations, IGuardrail.metricInvocationsIntervened, IGuardrail.metricTextUnitCount, IHttpApi.metricClientError, IHttpApi.metricCount, IHttpApi.metricDataProcessed, IHttpApi.metricIntegrationLatency, IHttpApi.metricLatency, IHttpApi.metricServerError, IHttpStage.metricClientError, IHttpStage.metricCount, IHttpStage.metricDataProcessed, IHttpStage.metricIntegrationLatency, IHttpStage.metricLatency, IHttpStage.metricServerError, IJob.metric, IJob.metricFailure, IJob.metricSuccess, IJob.metricTimeout, ILogGroup.metric, ILogGroup.metricIncomingBytes, ILogGroup.metricIncomingLogEvents, IMatchmakingConfiguration.metric, IMatchmakingConfiguration.metricCurrentTickets, IMatchmakingConfiguration.metricMatchesAccepted, IMatchmakingConfiguration.metricMatchesCreated, IMatchmakingConfiguration.metricMatchesPlaced, IMatchmakingConfiguration.metricMatchesRejected, IMatchmakingConfiguration.metricPlayersStarted, IMatchmakingConfiguration.metricTimeToMatch, IMatchmakingRuleSet.metric, IMatchmakingRuleSet.metricRuleEvaluationsFailed, IMatchmakingRuleSet.metricRuleEvaluationsPassed, IMemory.metric (@aws-cdk/aws-bedrock-agentcore-alpha), IMemory.metricErrorsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IMemory.metricEventCreationCount (@aws-cdk/aws-bedrock-agentcore-alpha), IMemory.metricForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IMemory.metricInvocationsForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IMemory.metricLatencyForApiOperation (@aws-cdk/aws-bedrock-agentcore-alpha), IMemory.metric (aws_bedrockagentcore), IMemory.metricErrorsForApiOperation (aws_bedrockagentcore), IMemory.metricEventCreationCount (aws_bedrockagentcore), IMemory.metricForApiOperation (aws_bedrockagentcore), IMemory.metricInvocationsForApiOperation (aws_bedrockagentcore), IMemory.metricLatencyForApiOperation (aws_bedrockagentcore), INetworkLoadBalancerMetrics.activeFlowCount, INetworkLoadBalancerMetrics.consumedLCUs, INetworkLoadBalancerMetrics.custom, INetworkLoadBalancerMetrics.newFlowCount, INetworkLoadBalancerMetrics.processedBytes, INetworkLoadBalancerMetrics.tcpClientResetCount, INetworkLoadBalancerMetrics.tcpElbResetCount, INetworkLoadBalancerMetrics.tcpTargetResetCount, INetworkTargetGroupMetrics.custom, INetworkTargetGroupMetrics.healthyHostCount, INetworkTargetGroupMetrics.unHealthyHostCount, IOriginEndpoint.metric, IOriginEndpoint.metricEgressBytes, IOriginEndpoint.metricEgressRequestCount, IOriginEndpoint.metricEgressResponseTime, IOriginEndpoint.metricIngressBytes, IOriginEndpoint.metricIngressRequestCount, IOriginEndpoint.metricIngressResponseTime, IPolicy.metric (@aws-cdk/aws-bedrock-agentcore-alpha), IPolicy.metricEvaluationLatency (@aws-cdk/aws-bedrock-agentcore-alpha), IPolicy.metricEvaluations (@aws-cdk/aws-bedrock-agentcore-alpha), IPolicy.metric (aws_bedrockagentcore), IPolicy.metricEvaluationLatency (aws_bedrockagentcore), IPolicy.metricEvaluations (aws_bedrockagentcore), IPolicyEngine.metric (@aws-cdk/aws-bedrock-agentcore-alpha), IPolicyEngine.metricAuthorizationLatency (@aws-cdk/aws-bedrock-agentcore-alpha), IPolicyEngine.metricDeniedRequests (@aws-cdk/aws-bedrock-agentcore-alpha), IPolicyEngine.metricErrors (@aws-cdk/aws-bedrock-agentcore-alpha), IPolicyEngine.metric (aws_bedrockagentcore), IPolicyEngine.metricAuthorizationLatency (aws_bedrockagentcore), IPolicyEngine.metricDeniedRequests (aws_bedrockagentcore), IPolicyEngine.metricErrors (aws_bedrockagentcore), IProject.metric, IProject.metricBuilds, IProject.metricDuration, IProject.metricFailedBuilds, IProject.metricSucceededBuilds, IQueue.metric, IQueue.metricApproximateAgeOfOldestMessage, IQueue.metricApproximateNumberOfMessagesDelayed, IQueue.metricApproximateNumberOfMessagesNotVisible, IQueue.metricApproximateNumberOfMessagesOutstanding, IQueue.metricApproximateNumberOfMessagesVisible, IQueue.metricNumberOfEmptyReceives, IQueue.metricNumberOfMessagesDeleted, IQueue.metricNumberOfMessagesReceived, IQueue.metricNumberOfMessagesSent, IQueue.metricSentMessageSize, IRouterInput.metric, IRouterInput.metricBitrate, IRouterInput.metricConnected, IRouterInput.metricContinuityCounterErrors, IRouterInput.metricFailoverSwitches, IRouterInput.metricLatency, IRouterInput.metricNotRecoveredPackets, IRouterInput.metricTotalPackets, IRouterOutput.metric, IRouterOutput.metricArqRequests, IRouterOutput.metricBitrate, IRouterOutput.metricConnected, IRouterOutput.metricTotalPackets, IScheduleGroup.metric, IScheduleGroup.metricAttempts, IScheduleGroup.metricDropped, IScheduleGroup.metricFailedToBeSentToDLQ, IScheduleGroup.metricSentToDLQ, IScheduleGroup.metricSentToDLQTruncated, IScheduleGroup.metricTargetErrors, IScheduleGroup.metricTargetThrottled, IScheduleGroup.metricThrottled, IServerlessCache.metric, IServerlessCache.metricActiveConnections, IServerlessCache.metricCacheHitCount, IServerlessCache.metricCacheHitRate, IServerlessCache.metricCacheMissCount, IServerlessCache.metricDataStored, IServerlessCache.metricNetworkBytesIn, IServerlessCache.metricNetworkBytesOut, IServerlessCache.metricProcessingUnitsConsumed, IServerlessCache.metricReadRequestLatency, IServerlessCache.metricWriteRequestLatency, ISlackChannelConfiguration.metric, IStage.metric, IStateMachine.metric, IStateMachine.metricAborted, IStateMachine.metricFailed, IStateMachine.metricStarted, IStateMachine.metricSucceeded, IStateMachine.metricThrottled, IStateMachine.metricTime, IStateMachine.metricTimedOut, IStream.metric, IStream.metricGetRecords, IStream.metricGetRecordsBytes, IStream.metricGetRecordsIteratorAgeMilliseconds, IStream.metricGetRecordsLatency, IStream.metricGetRecordsSuccess, IStream.metricIncomingBytes, IStream.metricIncomingRecords, IStream.metricPutRecordBytes, IStream.metricPutRecordLatency, IStream.metricPutRecordSuccess, IStream.metricPutRecordsBytes, IStream.metricPutRecordsFailedRecords, IStream.metricPutRecordsLatency, IStream.metricPutRecordsSuccess, IStream.metricPutRecordsSuccessfulRecords, IStream.metricPutRecordsThrottledRecords, IStream.metricPutRecordsTotalRecords, IStream.metricReadProvisionedThroughputExceeded, IStream.metricWriteProvisionedThroughputExceeded, ITable.metric, ITable.metricConditionalCheckFailedRequests, ITable.metricConsumedReadCapacityUnits, ITable.metricConsumedWriteCapacityUnits, ITable.metricSuccessfulRequestLatency, ITable.metricThrottledRequests, ITable.metricUserErrors, ITopic.metric, ITopic.metricNumberOfMessagesPublished, ITopic.metricNumberOfNotificationsDelivered, ITopic.metricNumberOfNotificationsFailed, ITopic.metricNumberOfNotificationsFilteredOut, ITopic.metricNumberOfNotificationsFilteredOutInvalidAttributes, ITopic.metricNumberOfNotificationsFilteredOutNoMessageAttributes, ITopic.metricPublishSize, ITopic.metricSMSMonthToDateSpentUSD, ITopic.metricSMSSuccessRate, IVpnConnection.metric, IVpnConnection.metricTunnelDataIn, IVpnConnection.metricTunnelDataOut, IVpnConnection.metricTunnelState, MemoryBase.metricMemoryRecordCreationCount (@aws-cdk/aws-bedrock-agentcore-alpha), MemoryBase.metricMemoryRecordCreationCount (aws_bedrockagentcore), Method.metric, Method.metricCacheHitCount, Method.metricCacheMissCount, Method.metricClientError, Method.metricCount, Method.metricIntegrationLatency, Method.metricLatency, Method.metricServerError, Metric.with, MetricFilter.metric, NetworkLoadBalancer.metric, NetworkLoadBalancer.metricActiveFlowCount, NetworkLoadBalancer.metricConsumedLCUs, NetworkLoadBalancer.metricNewFlowCount, NetworkLoadBalancer.metricProcessedBytes, NetworkLoadBalancer.metricTcpClientResetCount, NetworkLoadBalancer.metricTcpElbResetCount, NetworkLoadBalancer.metricTcpTargetResetCount, NetworkTargetGroup.metricHealthyHostCount, NetworkTargetGroup.metricUnHealthyHostCount, PolicyEngineBase.metricAuthorizations (@aws-cdk/aws-bedrock-agentcore-alpha), PolicyEngineBase.metricAuthorizations (aws_bedrockagentcore), RestApiBase.metric, RestApiBase.metricCacheHitCount, RestApiBase.metricCacheMissCount, RestApiBase.metricClientError, RestApiBase.metricCount, RestApiBase.metricIntegrationLatency, RestApiBase.metricLatency, RestApiBase.metricServerError, Schedule.metricAll, Schedule.metricAllAttempts, Schedule.metricAllDropped, Schedule.metricAllErrors, Schedule.metricAllFailedToBeSentToDLQ, Schedule.metricAllSentToDLQ, Schedule.metricAllSentToDLQTruncated, Schedule.metricAllTargetThrottled, Schedule.metricAllThrottled, SlackChannelConfiguration.metricAll, StageBase.metric, StageBase.metricCacheHitCount, StageBase.metricCacheMissCount, StageBase.metricClientError, StageBase.metricCount, StageBase.metricIntegrationLatency, StageBase.metricLatency, StageBase.metricServerError, StateTransitionMetric.metric, StateTransitionMetric.metricConsumedCapacity, StateTransitionMetric.metricProvisionedBucketSize, StateTransitionMetric.metricProvisionedRefillRate, StateTransitionMetric.metricThrottledEvents, TableBase.metricSystemErrors, TableBase.metricThrottledRequestsForOperation, TableBaseV2.metricSystemErrors, TaskStateBase.metric, TaskStateBase.metricFailed, TaskStateBase.metricHeartbeatTimedOut, TaskStateBase.metricRunTime, TaskStateBase.metricScheduleTime, TaskStateBase.metricScheduled, TaskStateBase.metricStarted, TaskStateBase.metricSucceeded, TaskStateBase.metricTime, TaskStateBase.metricTimedOut, VpnConnection.metricAll, VpnConnection.metricAllTunnelDataIn, VpnConnection.metricAllTunnelDataOut, VpnConnection.metricAllTunnelState

- Source: [`aws-cloudwatch/lib/metric.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts#L177)

## Example

TypeScript:

```ts
declare const channel: medialive.Channel;
declare const stack: Stack;

channel.metricDroppedFrames(medialive.Pipeline.PIPELINE_0).createAlarm(stack, 'DroppedFrames', {
  threshold: 1,
  evaluationPeriods: 2,
});

channel.metricSvqTime(medialive.Pipeline.PIPELINE_0).createAlarm(stack, 'SvqTime', {
  threshold: 0,
  evaluationPeriods: 1,
});

// Custom metric by name with sum statistic
channel.metric('Output4xxErrors', medialive.Pipeline.PIPELINE_0, { statistic: 'sum' });
```

Python:

```python
# channel: medialive.Channel
# stack: Stack

channel.metric_dropped_frames(medialive.Pipeline.PIPELINE_0).create_alarm(stack, "DroppedFrames",
    threshold=1,
    evaluation_periods=2
)

channel.metric_svq_time(medialive.Pipeline.PIPELINE_0).create_alarm(stack, "SvqTime",
    threshold=0,
    evaluation_periods=1
)

# Custom metric by name with sum statistic
channel.metric("Output4xxErrors", medialive.Pipeline.PIPELINE_0, statistic="sum")
```

Java:

```java
Channel channel;
Stack stack;

channel.metricDroppedFrames(Pipeline.PIPELINE_0).createAlarm(stack, "DroppedFrames", CreateAlarmOptions.builder()
        .threshold(1)
        .evaluationPeriods(2)
        .build());

channel.metricSvqTime(Pipeline.PIPELINE_0).createAlarm(stack, "SvqTime", CreateAlarmOptions.builder()
        .threshold(0)
        .evaluationPeriods(1)
        .build());

// Custom metric by name with sum statistic
channel.metric("Output4xxErrors", Pipeline.PIPELINE_0, MetricOptions.builder().statistic("sum").build());
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Channel channel;
Stack stack;

channel.MetricDroppedFrames(Pipeline.PIPELINE_0).CreateAlarm(stack, "DroppedFrames", new CreateAlarmOptions {
    Threshold = 1,
    EvaluationPeriods = 2
});

channel.MetricSvqTime(Pipeline.PIPELINE_0).CreateAlarm(stack, "SvqTime", new CreateAlarmOptions {
    Threshold = 0,
    EvaluationPeriods = 1
});

// Custom metric by name with sum statistic
channel.Metric("Output4xxErrors", Pipeline.PIPELINE_0, new MetricOptions { Statistic = "sum" });
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var channel Channel
var stack Stack

channel.metricDroppedFrames(medialive.Pipeline_PIPELINE_0()).CreateAlarm(stack, jsii.String("DroppedFrames"), &CreateAlarmOptions{
	Threshold: jsii.Number(1),
	EvaluationPeriods: jsii.Number(2),
})

channel.metricSvqTime(medialive.Pipeline_PIPELINE_0()).CreateAlarm(stack, jsii.String("SvqTime"), &CreateAlarmOptions{
	Threshold: jsii.Number(0),
	EvaluationPeriods: jsii.Number(1),
})

// Custom metric by name with sum statistic
channel.metric(jsii.String("Output4xxErrors"), medialive.Pipeline_PIPELINE_0(), &MetricOptions{
	Statistic: jsii.String("sum"),
})
```

## Properties

- `account`: string — Account which this metric comes from.

  **Default:** Deployment account.

- `color`: string — The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The `Color` class has a set of standard colors that can be used here.

  **Default:** Automatic color

- `dimensionsMap`: { [key: string]: string } — Dimensions of the metric.

  **Default:** No dimensions.

- `id`: string — Unique identifier for this metric when used in dashboard widgets.

  **Default:** No ID

  The id can be used as a variable to represent this metric in math expressions.
  Valid characters are letters, numbers, and underscore. The first character
  must be a lowercase letter.

- `label`: string — Label for this metric when added to a Graph in a Dashboard.

  **Default:** No label

  You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
  to show summary information about the entire displayed time series
  in the legend. For example, if you use:

  ```
  [max: ${MAX}] MyMetric
  ```

  As the metric label, the maximum value in the visible range will
  be shown next to the time series name in the graph's legend.

- `period`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.minutes(5) — The period over which the specified statistic is applied.

- `region`: string — Region which this metric comes from.

  **Default:** Deployment region.

- `stackAccount`: string — Account of the stack this metric is attached to.

  **Default:** Deployment account.

- `stackRegion`: string — Region of the stack this metric is attached to.

  **Default:** Deployment region.

- `statistic`: string = Average — What function to use for aggregating.

  Use the `aws_cloudwatch.Stats` helper class to construct valid input strings.

  Can be one of the following:

  - "Minimum" | "min"
  - "Maximum" | "max"
  - "Average" | "avg"
  - "Sum" | "sum"
  - "SampleCount | "n"
  - "pNN.NN"
  - "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
  - "iqm"
  - "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
  - "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
  - "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

- `unit`: [Unit](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.Unit.html) — Unit used to filter the metric stream.

  **Default:** All metric datums in the given metric stream

  Only refer to datums emitted to the metric stream with the given unit and
  ignore all others. Only useful when datums are being emitted to the same
  metric stream under different units.

  The default is to use all matric datums in the stream, regardless of unit,
  which is recommended in nearly all cases.

  CloudWatch does not honor this property for graphs.

- `visible`: boolean = true — Whether this metric should be visible in dashboard graphs.

  Setting this to false is useful when you want to hide raw metrics
  that are used in math expressions, and show only the expression results.
