Enabling App Metrics

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

Procedure

  1. Run the following:
    FLOGO_HTTP_SERVICE_PORT=<port>  ./<app-binary>
  2. Run the curl command for the appropriate REST method. Refer to App 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:

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 App 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

Example: 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"}]}