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
mgr/dashboard: Prometheus integration #25309
Conversation
src/pybind/mgr/dashboard/HACKING.rst
Outdated
| How to use a custom API endpoint in a RESTController? | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| If you have no access restriction you can use ``@Endpoint`` but if you have you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you have no access restriction you can use ``@Endpoint`` but if you have you | |
| If you don't have any access restriction you can use ``@Endpoint``. But if you do |
src/pybind/mgr/dashboard/HACKING.rst
Outdated
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| If you have no access restriction you can use ``@Endpoint`` but if you have you | ||
| use instead ``@RESTController.Collection`` or ``@RESTController.Resource``, if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use instead ``@RESTController.Collection`` or ``@RESTController.Resource``, if | |
| and ``RESOURCE_ID`` is set you'll have to use ``@RESTController.Collection`` or ``@RESTController.Resource`` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You only can use @RESTController.Resource if RESOURCE_ID is set, but you can use @RESTController.Collection without having the RESOURCE_ID set.
src/pybind/mgr/dashboard/HACKING.rst
Outdated
|
|
||
| If you have no access restriction you can use ``@Endpoint`` but if you have you | ||
| use instead ``@RESTController.Collection`` or ``@RESTController.Resource``, if | ||
| ``RESOURCE_ID`` is set. ``@Endpoint`` will fail here, as it does not know which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``RESOURCE_ID`` is set. ``@Endpoint`` will fail here, as it does not know which | |
| Otherwise ``@Endpoint`` will fail here, as it does not know which |
| import { NotificationType } from '../enum/notification-type.enum'; | ||
|
|
||
| export class CdNotificationConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it possibly make sense to move all the changes related to CdNotificationConfig to a separate (pre-)PR? Because this one is quite long already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
f46b72b
to
bc78ee0
Compare
6974d1c
to
5701d56
Compare
| #. Use the Prometheus Alertmanager API. | ||
|
|
||
| #. Use both sources simultaneously. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the benefits/differences between these methods here?
When would one want to use one or the other?
Please elaborate on the rationale for having these two different methods.
| @@ -366,6 +366,63 @@ To enable SSO:: | |||
|
|
|||
| $ ceph dashboard sso enable saml2 | |||
|
|
|||
| Enabling Prometheus alerting | |||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a short note about what the Prometheus Alert manager is all about, including an URL that points to more information, especially how to install and configure it.
| from ..settings import Settings | ||
|
|
||
|
|
||
| # The receiver is needed in order to receive alert notifications (reports) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move this documentation to the PrometheusReceiver class?
5701d56
to
5402a3c
Compare
|
Addressed all comments |
5402a3c
to
ac1fdcd
Compare
...nd/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.html
Outdated
Show resolved
Hide resolved
...mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.spec.ts
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.spec.ts
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.ts
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.spec.ts
Outdated
Show resolved
Hide resolved
...ybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally: it works as expected.
|
@p-na Sorry I miss understood you I thought you mend squashing all commits into one. Will do that. |
06c4114
to
ef43b81
Compare
|
Addressed all comments. Put interval outside of angular so that the e2e test will pass again. |
src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts
Outdated
Show resolved
Hide resolved
|
|
||
| it('should have the following column set up if customCss is defined', () => { | ||
| component.customCss = { | ||
| 'answer-of-everything': 42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)
src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts
Outdated
Show resolved
Hide resolved
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.ts
Outdated
Show resolved
Hide resolved
ef43b81
to
31597d5
Compare
|
@votdev Addressed all your comments 👍 |
The backend is now capable of receiving alert notifications from the Prometheus alertmanager and it can get all alerts with all kinds of parameters from the API of the same. In the frontend Prometheus alerts can be found in "Cluster > Alerts". Incoming notifications can be seen as usual in the notifications popover. To clarify: Prometheus alerts are received from the alertmanager API. Prometheus alert notification are send from the alertmanager to the backend receiver. An alert notification can have multiple alerts, but these alerts differ from the prometheus alerts. To clarify that, I've added some models and services. If one of the methods to get alerts contains changes the user will be notified. The documentation explains how to configure the alertmanager to use the dashboard receiver and how to connect the use of the alertmanager API. Further it explains where to find the alerts and what happens if they are configured and something is happening. Fixes: https://tracker.ceph.com/issues/36721 Signed-off-by: Stephan Müller <smueller@suse.com>
Now it's possible to style values inside the KV-table based on the values. Fixes: https://tracker.ceph.com/issues/37951 Signed-off-by: Stephan Müller <smueller@suse.com>
Now notifications and alerts show an application icon, that gives a hint about their origin. Fixes: https://tracker.ceph.com/issues/37950 Signed-off-by: Stephan Müller <smueller@suse.com>
Signed-off-by: Stephan Müller <smueller@suse.com>
31597d5
to
a768571
Compare
|
jenkins test dashboard |
|
jenkins test dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
The backend is now capable of receiving alert notifications from
the Prometheus alertmanager and it can get all alerts with all kinds of
parameters from the API of the same.
Now Prometheus alerts can be found in "Cluster > Alerts". Incoming
notifications can be seen as usual in the notifications popover.
To clarify:
Prometheus alerts are received from the alertmanager API.
Prometheus alert notification are send from the alertmanager to the
backend receiver. An alert notification can have multiple alerts, but
these alerts differ from the prometheus alerts.
To clarify that, I've added some models and services.
If one of the methods to get alerts contains changes the user will be
notified.
In addition to that the following new things were implemented:
values.
about their origin.
Fixes: https://tracker.ceph.com/issues/37950
Fixes: https://tracker.ceph.com/issues/37951
Fixes: https://tracker.ceph.com/issues/36721
Signed-off-by: Stephan Müller smueller@suse.com
Some impressions:





