roboconf / roboconf-platform

The core modules and the platform
Apache License 2.0
35 stars 11 forks source link

Links to Kibana dashboards #723

Closed vincent-zurczak closed 7 years ago

vincent-zurczak commented 7 years ago

Kibana allows to create dashboards almost easily. Integration with Karaf (and thus Roboconf) is made simple by Decanter, the Elasticsearch appender and the JMX collector. However, in our case, we do not want to have one dashboard but a collection of dashboards.

I successfully created one for the DM. But I would like to use the same cluster for all the agents too. So, we need...

Besides, Kibana (5.x) does not allow to create parameterized dashboards. What we can use though is a custom query. We can use our JMX collector and specify a source field (e.g. source=DM, or source=app1,instance_path). So, we can filter by this field.

In Kibana 5.x, any action is propagated to the URL. Including the query filter. Example...

http://localhost:5601/app/kibana#/dashboard/Global-Dashboard?_a=(filters:!(),options:(darkTheme:!f),panels:!((col:1,id:Operating-System,panelIndex:1,row:1,size_x:5,size_y:3,type:visualization),(col:6,id:JVM-Memory,panelIndex:2,row:1,size_x:6,size_y:3,type:visualization),(col:8,id:Threads,panelIndex:3,row:4,size_x:5,size_y:3,type:visualization),(col:1,id:Open-File-Descriptors,panelIndex:4,row:4,size_x:4,size_y:3,type:visualization),(col:5,id:Free-Physical-Memory,panelIndex:5,row:4,size_x:3,size_y:2,type:visualization)),query:(query_string:(analyze_wildcard:!t,query:source%3DDM)),title:%27Global%20Dashboard%27,uiState:(P-4:(vis:(colors:(%27Max%20Open%20File%20Destiptors%27:%2364B0C8)))))&_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-1h,mode:quick,to:now))

We can simply replace source%3DDM in this sample URL. What we need are links that lead to the right dashboards.

Solution 1 ties us with Kibana. And Kibana 5.x (as other versions used to work differently). Solution 3 is poor. Solution 2 is not integrated with our web console. Maybe we need to think about making our web administration extensible... We would then deploy a specific bundle for Kibana 5.x and it would update the web administration seamlessly. :+1:

vincent-zurczak commented 7 years ago

Solution 4...

Create HTML pages

Table with 4 columns:

The CSS and JS stuff will be reused from the web administration.

Register these pages in the HTTP service

Create a dedicated bundle. Inject the HTTP service. Also inject the manager.

New preference: web-app-extensions

Make the bundle register a new preference. This preference will be queried by the web administration. It will add a link in the main menu.

Share the code

Put this bundle in the miscellaneous directory.