project-flogo / core

Flogo Core is the core flogo library used create and extend Flogo applications.
BSD 3-Clause "New" or "Revised" License
109 stars 55 forks source link

add /metrics endpoint for timeseries database integration #207

Open reidlai opened 4 years ago

reidlai commented 4 years ago

Current behavior: Found project-flogo/services have flow-state and flow-store. Based on my understanding, we need to call api in order populate data into these two service. For flogo-state, i am expecting this will integrate with timeseries database likei InfluxDB or Prometheus.

Expected behavior: Should implmenet /metrics endpoint for each flogo app by default. The metrics should show simple success or failure counts for triggers and each activities in flow or stream.

What is the motivation / use case for changing the behavior? Developer can focus on code and SRE can just set up scrape or poll for statistics collection without coding effort

If flow-state server goes down, all apps depends on flow-state server will lost all statistics.

Additional information you deem important (e.g. I need this tomorrow):

lixingwang commented 4 years ago

@reidlai Thanks for your issue. the infrastructure code is there for flow. It has trigger/flow and task events. What you can do it just write your event listener and registry to engine and start listen.

@fm-tibco we should put some sample event listener code in flow repo.

reidlai commented 4 years ago

I understand I can add actions and flows to provide the metrics. But it will be tedious if having many microservice app.

vijaynalawade commented 4 years ago

@reidlai: What @lixingwang meant was to write something like https://github.com/TIBCOSoftware/flogo/wiki/Publish-and-Subscribe-Audit-Events. You can write this custom listener and include it in your app binary. It will work for any microservice. By the way, this feature is supported OOTB in enterprise version of Flogo.

reidlai commented 4 years ago

@reidlai: What @lixingwang meant was to write something like https://github.com/TIBCOSoftware/flogo/wiki/Publish-and-Subscribe-Audit-Events. You can write this custom listener and include it in your app binary. It will work for any microservice. By the way, this feature is supported OOTB in enterprise version of Flogo.

Let me take a look and thanks.