Metrics and Dashboards

All about collecting metrics from sfpowerscripts

How is metrics reported from sfpowerscripts?

Metrics should be a key part of your DevOps process. It is through these metrics, one can drive continuous improvement of your delivery process. Almost all commands in sfpowerscripts, are instrumented with StatsD. Read more about StatsD here (https://www.datadoghq.com/blog/statsd/)

How do I start capturing metrics?

Couple of things

# Set STATSD Environment Variables for logging metrics about this build
export SFPOWERSCRIPTS_STATSD=true
export SFPOWERSCRIPTS_STATSD_HOST=172.23.95.52
export SFPOWERSCRIPTS_STATSD_PORT=8125 // Optional, defaults to 8125
export SFPOWERSCRIPTS_STATSD_PROTOCOL=UDP // Optional, defualts to UDP, Supports UDP/TCP

What are the metrics being captured?

The following are the list of metrics that are captured.

METRIC

DESCRIPTION

TYPE

sfpowerscripts.deploy.failed

Number of times deploy command failed

COUNT

sfpowerscripts.deploy.duration

Time spent on executing deploy command

GUAGE

sfpowerscripts.deploy.scheduled

Number of times deployment was scheduled to run

COUNT

sfpowerscripts.deploy.succeeded

Number of succeeded deploy executions

COUNT

sfpowerscripts.build.scheduled

Number of times build was scheduled to run

COUNT

sfpowerscripts.build.duration

Time spent on executing build command

GUAGE

sfpowerscripts.build.scheduled.packages

Number of packages being scheduled to build

GUAGE

sfpowerscripts.build.succeeded.packages

Number of packages successfully built

GUAGE

sfpowerscripts.build.failed.packages

Number of packages failed to build

GUAGE

sfpowerscripts.validate.failed

Number of time validate failed to execute

COUNT

sfpowerscripts.validate.duration

Time spent on executing validate command

GUAGE

sfpowerscripts.publish.duration

Time spent on executing publish command

GUAGE

sfpowerscripts.publish.succeeded

Number of succeeded publish executions

COUNT

sfpowerscripts.package.installation

Number of times a package was installed

COUNT

sfpowerscripts.package.installation.elapsed_time

Time taken to install a package

GUAGE

sfpowerscripts.package.elapsed

Time taken to create a package

GUAGE

sfpowerscripts.package.created

Number of times a particular package was created

COUNT

sfpowerscripts.package.metadatacount

Number of metadata in a package

GUAGE

sfpowerscripts.package.testcoverage

Test Coverage of a package

GUAGE

sfpowerscripts.apextests.triggered

Number of times apex tests were triggered for a package

COUNT

sfpowerscripts.apextest.testtotal

Time taken for Apex Test Execution

GUAGE

sfpowerscripts.apextest.command.time

Time taken for Apex Test Execution (Command Time)

GUAGE

Can you show me examples of dashboards that could be created with these metrics?

Package Status Dashboard
Package Weekly Status

‚Äč