Enabling Application Metrics

Set the FLOGO_HTTP_SERVICE_PORT environment variable to point to the port number of the HTTP service that provides APIs for collecting the application metrics. This will enable the runtime HTTP service.

To do so run the following:

Procedure

  1. Run the following:
    FLOGO_HTTP_SERVICE_PORT=<port>  ./<application-binary>
  2. Run the curl command for the appropriate REST method. Refer to Application Statistics for details on each method. Some examples are:
    curl  -X POST http://localhost:7777/app/metrics
    curl  -X GET http://localhost:7777/app/metrics/flows
    curl  -X DELETE http://localhost:7777/app/metrics

Enabling statistics collection using environment variables

To enable metrics collection through environment variable, do the following. FLOGO_APP_METRICS must be sepcified:

Procedure

  1. Run the following:
    FLOGO_HTTP_SERVICE_PORT=<port> FLOGO_APP_METRICS=true ./<appname>
  2. Run the curl command for the appropriate REST method. Refer to Application Statistics for details on each method. Some examples are:
    curl  -X GET http://localhost:7777/app/metrics/flows
    curl  -X DELETE http://localhost:7777/app/metrics/flows

Examples that shows how to retrieve specific metrics for an app

The following is an example of how you would run the above steps for a fictitious app named REST_Echo.
FLOGO_HTTP_SERVICE_PORT=7777 FLOGO_APP_METRICS=true ./REST_Echo-darwin-amd64
 
 
curl  -X GET http://localhost:7777/app/metrics/flows
 
{"app_name":"REST_Echo","app_version":"1.0.0","flows":[{"started":127639,"completed":126784,"failed":0,"avg_exec_time":0,"min_exec_time":0,"max_exec_time":4,"flow_name":"PostBooks"}]}
 
 
 
curl  -X GET http://localhost:7777/app/metrics/flow/PostBooks/activities
{"app_name":"REST_Echo","app_version":"1.0.0","tasks":[{"started":127389,"completed":126908,"failed":0,"avg_exec_time":0,"min_exec_time":0,"max_exec_time":4,"flow_name":"PostBooks","task_name":"Return"}]}

Fields returned in the response from the API call

The following table describes the fields that can be returned in the response you receive when you make an API call:

Flow
Name Description
app_name Name of the application
app_version Version of the application
flow_name Name of the flow
started Total number of times a given flow is started
completed Total number of times a given flow is completed
failed Total number of times a given flow has failed
avg_exec_time Average execution time of a given flow for successfully completed executions
min_exec_time Minimum execution time for a given flow
max_exec_time Maximum execution time for a given flow

Activity

Name Description
app_name Name of the application
app_version Version of the application
flow_name Name of the flow
activity_name Name of the activity
started Total number of times a given activity is started
completed Total number of times a given activity is completed
failed Total number of times a given activity has failed
avg_exec_time Average execution time of a given activity for successfully completed executions
min_exec_time Minimum execution time for a given activity
max_exec_time Maximum execution time for a given activity