Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OOTB Kubernetes dashboard to Kubernetes integration & implement best dashboard creation practices #3115

Merged

Conversation

MichaelKatsoulis
Copy link
Contributor

@MichaelKatsoulis MichaelKatsoulis commented Apr 18, 2022

Continuing work from elastic/beats#31591 which introduced new kubernetes OOTB dashboards for metricbeat 8.3.0, kubernetes package assets need to be updated as well.

Also dashboard creation best practises have been used as suggested in https://docs.google.com/document/d/1uyyFGx6xA5Kvl8c-ZdvXdvBGrHTylxU9F69TGqfzdmw/edit#heading=h.o6it0jm3zlmv:

  1. Move from visualisations to lens whenever possible2.
  2. Use Drilldown option.
  3. Not too many visualizations per dashboard.
  4. Dashboards changed to by value

These dashboards are compatible only with Kibana version 8.3.0 and above!

Related issues

Screenshots

Screenshot 2022-06-03 at 12 57 11 PM

Screenshot 2022-06-03 at 12 57 21 PM

Screenshot 2022-06-03 at 12 57 40 PM

Screenshot 2022-06-03 at 1 10 33 PM

Screenshot 2022-06-03 at 12 58 00 PM

Screenshot 2022-06-03 at 12 58 09 PM

Screenshot 2022-06-03 at 12 58 20 PM

Screenshot 2022-06-03 at 12 58 41 PM

Screenshot 2022-06-03 at 12 58 53 PM

Screenshot 2022-06-03 at 12 59 02 PM

Screenshot 2022-06-03 at 12 59 30 PM

Screenshot 2022-06-03 at 12 59 13 PM

Screenshot 2022-06-03 at 12 59 22 PM

@MichaelKatsoulis MichaelKatsoulis added the enhancement New feature or request label Apr 18, 2022
@MichaelKatsoulis MichaelKatsoulis requested a review from a team as a code owner April 18, 2022 10:15
@MichaelKatsoulis MichaelKatsoulis marked this pull request as draft April 18, 2022 10:15
@elasticmachine
Copy link

elasticmachine commented Apr 18, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-06-14T09:15:32.312+0000

  • Duration: 31 min 17 sec

Test stats 🧪

Test Results
Failed 0
Passed 90
Skipped 0
Total 90

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented May 9, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (0/0) 💚
Files 100.0% (0/0) 💚 3.432
Classes 100.0% (0/0) 💚 3.432
Methods 94.872% (74/78) 👍 6.043
Lines 100.0% (0/0) 💚 10.104
Conditionals 100.0% (0/0) 💚

@MichaelKatsoulis MichaelKatsoulis marked this pull request as ready for review June 3, 2022 10:25
@MichaelKatsoulis MichaelKatsoulis requested a review from a team as a code owner June 3, 2022 10:25
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, thank you so much for this! It's great seeing all the new things being adopted.

It seems like there are still some convertable TSVB panels in the kubernetes integration (I might have missed some aspect though):

  • API server
  • Controller Manager
  • Nodes. 👍
  • Proxy
  • Scheduler

Are those planned for later?

Some notes on converting:

  • Simple bucket scripts (like doing a ratio) can be converted to formula
  • The "derivative" agg is called "differences" in Lens formula (it has the same functionality)
  • The "Unit" definition of derivative can be defined by using the "Normalize by unit" option from advanced options:

Screenshot 2022-06-03 at 12 41 57

@flash1293
Copy link
Contributor

As a quick side note - I like the markdown panels as an interim solution, however we are actively working on adding a nice looking metric visualization which allows to convey the same information (hopefully ready for 8.4)

@MichaelKatsoulis
Copy link
Contributor Author

Are those planned for later?

No , probably I missed them. I will try to do everything in this PR

Some notes on converting:

  • Simple bucket scripts (like doing a ratio) can be converted to formula
  • The "derivative" agg is called "differences" in Lens formula (it has the same functionality)
  • The "Unit" definition of derivative can be defined by using the "Normalize by unit" option from advanced options:

Thanks a lot. I will try it out !!

@MichaelKatsoulis
Copy link
Contributor Author

As a quick side note - I like the markdown panels as an interim solution, however we are actively working on adding a nice looking metric visualization which allows to convey the same information (hopefully ready for 8.4)

Totally agree!

@MichaelKatsoulis
Copy link
Contributor Author

I have update the Nodes dashboard to convert some visualisations to lens.

Regarding the rest (apiserver, proxy, scheduler, controllermanager) updating those dashboards was not part of this PR initially.

It seems that more work is needed than just converting visualisations to lens.
Some panels need to be reconsider as some metrics collected are deprecated in newer versions of kubernetes. See elastic/beats#31834.

They will be updated in a follow up PR.

Also a blocker while moving some visualisations to lens is that in lens there is no way currently, when grouping by a field to set the order_by to a specific filed value. Only alphabetical and rarity is possible which can hide important values.
lens order
vis order

@flash1293
Copy link
Contributor

Thanks @MichaelKatsoulis ! It seems like there are a few visualizations on the "[Metrics Kubernetes] Pods" page which can be converted too, are they in-scope for this PR?

On "[Metrics Kubernetes] Overview" you are using TSVB markdown for the main menu, is there any special reason for that? Ideally a regular markdown panel should be used for that (accessible from the menu on the dashboard):
Screenshot 2022-06-07 at 17 58 38
The TSVB markdown panel is still fetching data behind the scenes even if it's not used.

Also (and that's very important), these links won't work on a Kibana with a base path configured because they define an absolute path (starting with /). For maximum compatibility only specify the hash part (instead of /app/dashboards#/view/kubernetes-e0195ce0-bcaf-11ec-b64f-7dd6e8e82013, use #/view/kubernetes-e0195ce0-bcaf-11ec-b64f-7dd6e8e82013)

Should that menu be available on all dashboards? I like how you split it up but if they are not linked up among each other I can imagine navigating around will become difficult.

@MichaelKatsoulis
Copy link
Contributor Author

MichaelKatsoulis commented Jun 8, 2022

It seems like there are a few visualizations on the "[Metrics Kubernetes] Pods" page which can be converted too, are they in-scope for this PR?

The reason for that is the problem with order by when grouping by pod.name. As soon as this is resolved I will move them as well.

On "[Metrics Kubernetes] Overview" you are using TSVB markdown for the main menu, is there any special reason for that? Ideally a regular markdown panel should be used for that (accessible from the menu on the dashboard):

Pure ignorance. I didn't even know that there was another option. I will move them.
Just to clarify @flash1293 you only refer to the Kubernetes Dashboards one. Because for some others I cannot convert it as I need to use fields and aggregations.

Also (and that's very important), these links won't work on a Kibana with a base path configured because they define an absolute path (starting with /). For maximum compatibility only specify the hash part (instead of /app/dashboards#/view/kubernetes-e0195ce0-bcaf-11ec-b64f-7dd6e8e82013, use #/view/kubernetes-e0195ce0-bcaf-11ec-b64f-7dd6e8e82013)

Thanks a lot. I will change that.

Should that menu be available on all dashboards? I like how you split it up but if they are not linked up among each other I can imagine navigating around will become difficult.

Good idea!

@mlunadia mlunadia changed the title Add k8s dashboards Iterate on OOTB Kubernetes dashboards Jun 8, 2022
@mlunadia mlunadia changed the title Iterate on OOTB Kubernetes dashboards Add OOTB Kubernetes dashboard to Kubernetes integration & implement best dashboard creation practices Jun 8, 2022
@flash1293
Copy link
Contributor

@MichaelKatsoulis

you only refer to the Kubernetes Dashboards one

exactly

The reason for that is the #3115 (comment) with order by when grouping by pod.name. As soon as this is resolved I will move them as well.

The order by for pod.name grouping should work fine for average aggregations (it's only not working for differences, moving average, cumulative sum and formula). Seems like on the pod page the panels are just using average, right?

@MichaelKatsoulis
Copy link
Contributor Author

MichaelKatsoulis commented Jun 8, 2022

The order by for pod.name grouping should work fine for average aggregations (it's only not working for differences, moving average, cumulative sum and formula). Seems like on the pod page the panels are just using average, right?

You are right again. I somehow thought it wasn't working for all of them. I will convert them.

Updated in a2de96a

@MichaelKatsoulis
Copy link
Contributor Author

@flash1293 I see in Kibana that input controls which I use in all the dashboards will be soon deprecated. I guess they should be changed to the new controls. I missed that best practise in https://docs.google.com/document/d/1uyyFGx6xA5Kvl8c-ZdvXdvBGrHTylxU9F69TGqfzdmw/edit#heading=h.o6it0jm3zlmv.

Probably I can do those changes in this PR as well.

control

@flash1293
Copy link
Contributor

@MichaelKatsoulis great point, I added that to the best practices doc, thanks for mentioning!

@MichaelKatsoulis MichaelKatsoulis self-assigned this Jun 14, 2022
@MichaelKatsoulis
Copy link
Contributor Author

I have update all the dashboards to use the new controls.
new controls

I will merge this PR and leave the rest of the updates as part of #3498

@MichaelKatsoulis MichaelKatsoulis merged commit c14ee5d into elastic:main Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve loading time of Kubernetes package Dashboards
6 participants