• 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
DeployingPackagingBuildingTestingServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
LayersManaged InstancesAlertsVersion 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 BucketStatePython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionsupportusage
Overview
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

AWS - Metrics

Lets you watch the metrics of a specific function.

serverless metrics

Options

  • --function or -f The function you want to fetch the metrics for.
  • --stage or -s The stage you want to view the function metrics for. If not provided, the plugin will use the default stage listed in serverless.yml. If that doesn't exist either it'll just fetch the metrics from the dev stage.
  • --region or -r The region you want to view the function metrics for. If not provided, the plugin will use the default region listed in serverless.yml. If that doesn't exist either it'll just fetch the metrics from the us-east-1 region.
  • --aws-profile The AWS profile you want to use.
  • --startTime A specific unit in time to start fetching metrics from (ie: 2010-10-20, 1469705761, 30m (30 minutes ago), 2h (2 hours ago) or 3d (3 days ago)). Date formats should be written in ISO 8601. Defaults to 24h ago.
  • --endTime A specific unit in time to end fetching metrics from (ie: 2010-10-21 or 1469705761). Date formats should be written in ISO 8601. Defaults to now.

Examples

Note: There's a small lag between invoking the function and actually having access to the metrics. It takes a few seconds for the metrics to show up right after invoking the function.

See service wide metrics for the last 24h

serverless metrics

Displays service wide metrics for the last 24h.

See service wide metrics for a specific timespan

serverless metrics --startTime 2016-01-01 --endTime 2016-01-02

Displays service wide metrics for the time between January 1, 2016 and January 2, 2016.

See all metrics for the function hello of the last 24h

serverless metrics --function hello

Displays all hello function metrics for the last 24h.

See metrics for the function hello of a specific timespan

serverless metrics --function hello \
  --startTime 2016-01-01 \
  --endTime 2016-01-02

Displays all hello function metrics for the time between January 1, 2016 and January 2, 2016.

Edit this page
Prev logsNextpackage

Contents

  • AWS - Metrics
  • Options
  • Examples
  • See service wide metrics for the last 24h
  • See service wide metrics for a specific timespan
  • See all metrics for the function hello of the last 24h
  • See metrics for the function hello of a specific timespan

Related

GuidesPluginsExamplesSlack CommunitySupport