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":[{"created":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":[{"created":127389,"completed":126908,"failed":0,"avg_exec_time":0,"min_exec_time":0,"max_exec_time":4,"flow_name":"PostBooks","task_name":"Return"}]}