Skip to content

mgr/dashboard: Grafana graphs integration with dashboard - #23666

Merged
ricardoasmarques merged 5 commits into
ceph:masterfrom
rhcs-dashboard:grafana-integration
Oct 9, 2018
Merged

ricardoasmarques merged 5 commits into
ceph:masterfrom
rhcs-dashboard:grafana-integration

Conversation

@a2batic

@a2batic a2batic commented Aug 21, 2018 •

Copy link
Copy Markdown
Contributor

This PR adds Grafana Graphs to Dashboard. Views affected:-

  1. Cluster -> Hosts
  2. Cluster -> OSDs
  3. Pools
  4. FileSystems
  5. Object Gateways -> Daemons

CLI commands to see graphs from Grafana

$ ceph mgr module enable prometheus
$ ceph dashboard set-grafana-api-url <url-of-grafana-instance>	       # default: ''

Tracker: https://tracker.ceph.com/issues/24999
Signed-off-by: Kanika [email protected]

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

@a2batic a2batic changed the title mgr/dashboard: Grafana graphs integration with dashboard [WIP] mgr/dashboard: Grafana graphs integration with dashboard Aug 21, 2018
@a2batic a2batic added the DNM label Aug 21, 2018
@a2batic
a2batic force-pushed the grafana-integration branch 7 times, most recently from a81ed8e to 6283ff8 Compare August 22, 2018 17:37
@a2batic
a2batic force-pushed the grafana-integration branch 2 times, most recently from 09c975f to 188400d Compare September 4, 2018 08:49
@a2batic

a2batic commented Sep 4, 2018 •

Copy link
Copy Markdown
Contributor Author

The embedding will have a Grafana dashboard added in the views under tab for following views:-
Cluster -> Host

  • Overall Performance
  • Performance Details

Cluster -> OSDs

  • Overall Performance
  • Performance Details

Pools

  • Overall Performance
  • Performance Details

Filesystem

  • Performance Details

Daemons

  • Overall Performance
  • Performance Details

Flow:-

  • User will have to set PORT (at the time of enabling Dashboard plugin) for grafana instance to be deployed, default will be 3000
  • At this port an anonymous accessed organization will be deployed with all the dashboards (with access level ‘Viewer’)
  • User can view Grafana Charts in Embedded form or by directly accessing URL

An example of the dashboard is given below:-
pools2

@ricardoasmarques

Copy link
Copy Markdown
Contributor

@a2batic Flow suggestion: It would be great to have a proper "alert" message if the grafana Port / Url is not defined or is unreachable, with a link to the "settings" page where user can set Grafana Port / Url properties.

@jcsp

jcsp commented Sep 6, 2018

Copy link
Copy Markdown
Contributor

Does this PR have a dependency on a PR opening for the charts themselves (https://tracker.ceph.com/issues/24998)?

@LenzGr

LenzGr commented Sep 7, 2018

Copy link
Copy Markdown
Contributor

Does this PR have a dependency on a PR opening for the charts themselves (tracker.ceph.com/issues/24998)?

Yes, this PR only becomes useful with the Grafana dashboards that are being prepared in that issue. However, the Ceph Manager Dashboard is fully functional without Grafana, this is an optional enhancement.

@a2batic
a2batic force-pushed the grafana-integration branch 3 times, most recently from 5ebfa63 to 3055b35 Compare September 9, 2018 12:57
@a2batic a2batic changed the title [WIP] mgr/dashboard: Grafana graphs integration with dashboard mgr/dashboard: Grafana graphs integration with dashboard [Frontend] Sep 9, 2018

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly wondering if the component/class design for grafana-panel and details could be made simpler and reduce 2 components to a single one?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where do these UIDs come from? Could you add a comment explaining it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These Uids will be part of json's prepared for Grafana dashboard. They will be constants. Ack, will add a comment about it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As this component shares methods and code with grafana-details-panel.component, why not creating a base class and inheriting from it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it not possible to change this in the pool list component so that every component is identified by the same id? Other option would be to expose this variable, as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It depends on what has been taken by Grafana dashboard JSON, we can update it when we have final JSON file. I used these on the basis of demo JSON provided.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of a component which auto-infers its internal status from a few input arguments (name and data), why not exposing the input arguments that characterize that class: name, style, grafana URL, etc? This way, the only purpose of this class is to present that grafana dashboard? By doing this, you avoid having 2 different components (the regular panel and the details one) that share 90% of the code, and also adding new grafana panels for, let's say, iSCSI, would not require modifying the internal code of the component, but just a new instantiation with different input args:

    <cd-grafana-panel 
                              name='cephfsDetails'
                              [data]="selection.first()"
                              grafana_path='/rRfFzWtik/mds-performance?var-mds_servers=${id}'
                              [grafana_style]="GrafanaStyles.ONE"
                              [autoReload]="false">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack, will give it a try.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to ensure this is not a typo, is this intentionally called twice?

@a2batic a2batic Sep 10, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Its a typo, ack, will remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This template is exactly the same as the other grafana HTML. Could this suggest that you may re-use some code or join components?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack, will give it a try.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not importing all these variables in a single line?

import { DashboardVar, GrafanaDashboardName, GrafanaPanelsRow, GrafanaPanelsUid, GrafanaUrl, GrafanaVar} from '../../../enum/grafana-template.enum';

Or given you have imported everything, why not import *?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack

@a2batic
a2batic force-pushed the grafana-integration branch from 6de5024 to 60fe21f Compare October 4, 2018 14:31
Comment thread doc/mgr/dashboard.rst Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if we should change the release, I was actually referring to the rendering of the url:
image

@a2batic
a2batic force-pushed the grafana-integration branch from 7eeb06b to fc571f3 Compare October 4, 2018 15:32
@a2batic
a2batic force-pushed the grafana-integration branch from 3f49c5a to 81ffe2b Compare October 4, 2018 15:54
@a2batic
a2batic force-pushed the grafana-integration branch from fb0b2ef to 336c92b Compare October 4, 2018 16:04
@epuertat

epuertat commented Oct 4, 2018

Copy link
Copy Markdown
Member

jenkins retest this please

@ricardoasmarques ricardoasmarques left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ricardoasmarques ricardoasmarques left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Documentation URL should be generated dynamically.

</cd-loading-panel>
<cd-info-panel *ngIf="!grafanaExist">
<ng-container i18n>
Please consult the <a href="http://docs.ceph.com/docs/luminous/mgr/dashboard/" target="_blank">documentation</a> on how to configure and enable the monitoring functionality.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This URL should be generated dynamically like we are doing here.

@a2batic
a2batic force-pushed the grafana-integration branch from b1f4bd8 to f97e2cd Compare October 8, 2018 09:32

@alfonsomthd alfonsomthd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@a2batic

a2batic commented Oct 8, 2018

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@ricardoasmarques ricardoasmarques left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ricardoasmarques
ricardoasmarques merged commit f55ce30 into ceph:master Oct 9, 2018
@epuertat
epuertat deleted the grafana-integration branch November 26, 2020 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants