• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Serverless Framework Logo

Serverless Framework

Intro
SetupUpgrading To V4ConceptsTutorialAWS CredentialsLicense Keys
DeployingPackagingBuildingTestingDev ModeServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
LayersManaged InstancesWeb Apps (Lambda Web Functions)Sandboxes (Lambda MicroVMs)MCP ServersAlertsVersion PruningDomainsIAM Function PermissionsParameters
OverviewSelf-reference serverless.ymlServerless CoreEnvironment VariablesCLI OptionsExternal YAML/JSON FilesJavascript propertiesGitDoppler
OverviewS3 ObjectsSSM Parameter Store & Secrets ManagerCloudFormation Stack Outputs
OverviewVaultTerraform State Output
ResourcesComposing ServicesDeployment BucketStateAgent SkillsPython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsSubstitutionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewagent docsagent inspectagent setupagent skills installagent skills list / readdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionusage
OverviewConcepts
OverviewMetricsTracesTroubleshoot
OverviewNode.jsPython
OutputsProviders
OverviewBranch DeploymentsPreview DeploymentsCustom ScriptsTestingPrivate PackagesNotificationsMono ReposDeploy in your own CI/CDBest PracticesTroubleshootingFAQ
OverviewSetupToolsAWS Integration
Serverless.yml Reference
Examples and TutorialsConfiguration Validation
  1. CLI Reference
  2. Metrics

serverless metrics

serverless metrics prints four Amazon CloudWatch metrics of a deployed service's Lambda functions over a time range, the last 24 hours by default: invocations, throttles, errors and average duration. It only reads metrics. Without --function it adds up all functions in the service; with --function it reports one. For the log lines behind the numbers, use serverless logs.

serverless metrics

The command prints the scope, the time range in your local time, and the totals:

Service Metrics
October 30, 2026 2:00 PM - October 31, 2026 2:00 PM

Invocations: 1042
Throttles: 0
Errors: 3
Average Duration: 118.42ms

Options

serverless metrics accepts these options:

OptionAliasValueDefaultRequiredDescription
--function-fstringAll functionsNoFunction to report, as named under functions in serverless.yml.
--startTime30m, 2h, 3d or an ISO 8601 date24 hours agoNoStart of the time range.
--endTimeISO 8601 dateNowNoEnd of the time range. Relative times are not accepted.
--stage-sstringprovider.stage, else devNoStage of the deployed service.
--region-rstringprovider.region, else us-east-1NoAWS Region of the deployed service.
--aws-profilestringprovider.profileNoAWS profile whose credentials the command uses.
--config-cfile pathserverless.ymlNoService configuration file to use.

The command also accepts the options every command takes: --param="key=value" (repeatable), --org, --app, --verbose, --debug and --help (-h).

Metrics that serverless metrics reports

serverless metrics reads these Lambda metrics from the AWS/Lambda namespace, per function, and combines them:

LineMetricHow it is combined
InvocationsInvocationsSum over the range and the functions.
ThrottlesThrottlesSum over the range and the functions.
ErrorsErrorsSum over the range and the functions.
Average DurationDurationMean of the period averages, in milliseconds.

The metrics are fetched in one-hour periods for a range of up to 24 hours, and in one-day periods for a longer range. When CloudWatch returns no data, the command prints zeros (Invocations: 0, Average Duration: 0ms); No metrics found appears only for a service without functions. Metrics reach CloudWatch with a short delay, so the latest invocations can be missing from the totals.

Time range formats

The serverless metrics --startTime option takes a relative time (30m, 2h, 3d) or an ISO 8601 date; --endTime takes only a date. A date alone, such as 2026-10-01, is read as midnight UTC; a date and time without a time zone, such as 2026-10-01T09:00, as your local time; add Z or an offset to set the zone.

Side effects and CI use

  • serverless metrics only reads metrics, with cloudwatch:GetMetricStatistics, and is safe to re-run.
  • The command does not prompt and returns after one read, so it can run in scripts and CI.

Provided lifecycle events

  • metrics:metrics

Examples

Print service-wide metrics for a date range

serverless metrics --startTime 2026-10-01 --endTime 2026-10-02

Print one function's metrics for the last 24 hours

serverless metrics --function hello

Print one function's metrics for the last 3 hours

serverless metrics --function hello --startTime 3h

Related commands

  • serverless logs prints a function's log events.
  • serverless info prints the deployed service's functions and endpoints.
Edit this page
Prev logsNextpackage

Contents

  • serverless metrics
  • Options
  • Metrics that serverless metrics reports
  • Time range formats
  • Side effects and CI use
  • Provided lifecycle events
  • Examples
  • Print service-wide metrics for a date range
  • Print one function's metrics for the last 24 hours
  • Print one function's metrics for the last 3 hours
  • Related commands

Related

GuidesPluginsExamplesSlack CommunitySupport