Custom Kibana Plugin

Hi there,

I'm about to start to dig a bit into the developing plugins world and I'd like to describe what I'd like to do an get any advice or recommendations if you have any.

I'm building a new vertical bar chart where I have a 3rd aggregation on my data that is displayed in the tool tip. I know adding an extra aggregation (if the agg results in an array/object) would lead to a 3D chart which is not ideal but adding this functionality would be super valuable. So a workaround I figured would be to only pull in the first value in the bucket of the 3rd aggregation as a sample of that aggregation. Let me explain my use case more practically. I have error codes that I'd like to track over time which have a message body that I'd like to see all on one visual. Currently, I hover over a data point and I can see what error code happened at what time, but I can't see what the error actually says. I need to put a saved search on the dash in order to help with that, but it adds a few steps to look deeper at a given code. For anyone working with data codes that aren't the generic 200-500 status codes, they would find it useful to see what error codes are happening when and a little more information about that errorcode to see if it is important to look at (like where it comes from or the message itself).

This would look like agg >> Date Histogram >>sub agg >> ErrorCode >>sub agg >> Message.bucket[0] , or aggs:{ Date Histogram: {....},aggs :{ ErrorCode: {...,aggs: { Message:{...}}}}}; where only the first data point of the Message bucket would be pulled for that ErrorCode. And that message data point is listed on the tooltip.

I would love any guidance for this anyone has: Is it going to be too resource intensive to have 3 aggregations for each data point? Is there a way to do this that is easier than I'm imagining?

One separate problem I'm having: I've tried the plugin template creator (Sao), and adding plugins that have already been created from others to the plugins folder while Kibana is in dev mode. Kibana starts up, and I can use it, but the visualizations don't appear in the visualizations tab. I've tried adding c3_charts, 3D_ charts and when I check plugins that are installed in Kibana, those two are in the response, but I cannot see them in the visualizations tab. Any idea why? I tried on v5.6.3 and v5.4.3 on my macOSX with being sure that the node --version is the same in the .node-version file. There are no errors reported by kibana and I just don't really know where to go from here. Any help appreciated!

Would love any advice :slight_smile:

Your visualization sounds like it would be very useful, and I don't think adding an additional aggregation would be too much. I would suggest giving it a go and seeing what the cost is. You can also use the profiler to estimate cost.

How are you running Kibana? I would try npm start from your plugin directory. It should be alongside kibana

For the new visual, do you think piggy backing on the already existing histogram chart is the best way to do this? All of the bar chart vistypes refer to the point_series class and seem to also point to the agg response folders. Because there are so many built in inter-dependancies, when I change something, things break somewhere along the line. Also I'm no expert in Angular/require so things seem a bit more intense from my perspective--mainly because the kibana visuals don't follow the similar index.js,package.json, public >> css,controller, html format that all the tutorials/other plugins use (I'd prefer that way).

In terms of the failing plugins:

When I npm start from the test plugin, I get these errors:

Testplugin@0.0.0 start /Users/kofimensah/Desktop/Plugin DeV/Testplugin
plugin-helpers start

  log   [07:13:38.484] [info][listening] Server running at http://localhost:5601
  log   [07:13:38.488] [error][status][ui settings] Status changed from uninitialized to red - UI Settings requires the elasticsearch plugin
  log   [07:15:14.992] [error][client][connection] Error: Parse Error
at Error (native)
  log   [07:15:14.993] [error][client][connection] Error: Parse Error
at Error (native)
  log   [07:15:14.994] [error][client][connection] Error: Parse Error
at Error (native)

When I do npm start from the Kibana folder directly, things run on :5601 smoothly, and then when I drag the plugin into the plugins folder, kibana detects the changes, lazy-optimization finishes but I don't see that plugin appear in the visualizations tab. I haven't been able to get any plugins to appear yet :cry:

Hello?

Alo?? :slight_smile:

hello, can you share your source code? if you can, give please url for github.
write your kibana version, npm version, node version.
thanks.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.