I have an index where each document in the index provides the number of open items and the number of closed items. I'd like to build a visualization that shows if the team is catching up closing issues or, if at times, there are more open issues added than closed. The end result I'd like is two lines where the color changes depending on that factor (more closed issues than created, green, the reverse, red).
You're asking for a slightly more powerful visualization, so you might need to use Vega to get this level of power. Specifically the conditional coloring is not supported unless you use Vega.
However, I think you can answer most of your question using any of the visualizations in Kibana. You won't get conditional coloring though. To do this, you need to translate your question into aggregations. It sounds like you are storing the count of issues, and you are looking for change in count, which is a "differences" function in Lens or a "derivative" function in other parts of Kibana. You also need to choose the metric that you are taking the differences of: you can use Sum or Last Value for your example.
Thank you, derivative is what I ended up doing. I've used two layers with open issues and closed issues and the two gives me an idea of how the team performs. I am not 100% sure that I've got what I want.
You also need to choose the metric that you are taking the differences of: you can use Sum or Last Value for your example.
@snicoll If you're already configured your Derivative function then you have seen that the Derivative function requires a sub-aggregation. I was recommending Sum or Last Value as the sub-aggregation to choose.
I used Max and then derivative on max of closed (same for open). I don't understand how sum could be applicable to my case since each document stores that total of open (and closed) issues. Not the number of open/closed issues for that particular timestamp.
The main factor is the time interval. You can easily get multiple documents in the same date bucket, and using the Max function could give you incorrect results. Using Last Value (which is called Top Hits in Elasticsearch) will always guarantee that you are comparing a single document at a time. Using Sum will guarantee that you've considered all documents in the time range. In your case, it sounds like Last Value/Top Hits is the correct choice because you can guarantee only one document per metric.
Thank you very much. I was using 7.10 and didn't find the options in lens. I've updated to 7.12 locally and I have something that seems to do what I want.
It would be perfect if we could change the color of the area if the value if positive or negative (i.e. have a color for positive number and another one for negative numbers).
I agree that it would be good to have conditional coloring at that level, but that's a long-term goal for Lens, not short term. We will support conditional coloring of tables in Lens soon, it's currently being developed.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.