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

Documentation about using existing Grafana instance. #31667

Merged
merged 2 commits into from
Jan 23, 2023

Conversation

tbukic
Copy link
Contributor

@tbukic tbukic commented Jan 13, 2023

Signed-off-by: Bukic Tomislav, AVL tomislav.bukic@avl.com

Added some knowledge about using existing Grafana instances to the monitoring documentation as suggested on Slack channel.

Fixed version of PR #31633

Why are these changes needed?

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@tbukic tbukic requested a review from a team as a code owner January 13, 2023 16:35
@rkooo567
Copy link
Contributor

This is an amazing PR! Thank you again @tbukic

Using an existing Grafana instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When you want to use existing Grafana instance, before starting your Ray cluster you will need to setup environment variable `RAY_GRAFANA_HOST` with an URL of your Grafana. After starting Ray, you can find Grafana dashboard json at `/tmp/ray/session_latest/metrics/grafana/dashboards/default_grafana_dashboard.json`. `Import<https://grafana.com/docs/grafana/latest/dashboards/manage-dashboards/#import-a-dashboard>`_ this json to your Grafana.
Copy link
Contributor

Choose a reason for hiding this comment

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

``Importhttps://grafana.com/docs/grafana/latest/dashboards/manage-dashboards/#import-a-dashboard_

Can you tell me a bit about what this exactly means? the URL seems to be linked to the current documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Json at /tmp/ray/session_latest/metrics/grafana/dashboards/default_grafana_dashboard.json is encoding Grafana dashboard. When using existing Grafana, user needs to manually import that json. It is pretty straightforward, but Grafana documentation is showing how it is done, step-by-step. I am going to rephrase it.


When you want to use existing Grafana instance, before starting your Ray cluster you will need to setup environment variable `RAY_GRAFANA_HOST` with an URL of your Grafana. After starting Ray, you can find Grafana dashboard json at `/tmp/ray/session_latest/metrics/grafana/dashboards/default_grafana_dashboard.json`. `Import<https://grafana.com/docs/grafana/latest/dashboards/manage-dashboards/#import-a-dashboard>`_ this json to your Grafana.

If Grafana reports that datasource is not found, you can `add a datasource variable <https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/?pg=graf&plcmt=data-sources-prometheus-btn-1#add-a-data-source-variable>`_ and change all values of `datasource` key in the dashboard json to the name of the variable. For example, if the variable name is `data_source`, all `"datasource"` mappings should be:
Copy link
Contributor

Choose a reason for hiding this comment

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

"key in the dashboard json"

Is this default_grafana_dashboard.json? Can you change this part to

"key in the default_grafana_dashboard.json"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can! I'm also adding the reference on how to change it.

nginx.ingress.kubernetes.io/configuration-snippet: |
add_header X-Frame-Options SAMEORIGIN always;

When both Grafana and Ray cluster are on the same Kubernetes cluster, it is important to set `RAY_GRAFANA_HOST` to the external URL of the Grafana ingress. For successful embedding, `RAY_GRAFANA_HOST` needs to be accessible to both Ray cluster backend and Ray dashboard frontend: backend does the healthchecks and frontend embeds the dashboard.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add the difference between backend / frontend? E.g.,

backend (ray cluster) and frontend (machines that accesses the dashboard URL)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I've extended on this as well.

@rkooo567 rkooo567 self-assigned this Jan 20, 2023
Signed-off-by: Bukic Tomislav, AVL <tomislav.bukic@avl.com>
Signed-off-by: Bukic Tomislav, AVL <tomislav.bukic@avl.com>
@rkooo567
Copy link
Contributor

I need an approval from the doc owners! I have asked for the approval, so it will be approved soon!

Copy link
Contributor

@maxpumperla maxpumperla left a comment

Choose a reason for hiding this comment

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

Thank you @tbukic !

@rkooo567 rkooo567 merged commit ee23cc8 into ray-project:master Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants