Thoth Service Level Objective (SLO) reporter ############################################
.. image:: https://img.shields.io/github/v/tag/thoth-station/slo-reporter?style=plastic :target: https://github.com/thoth-station/slo-reporter/tags :alt: GitHub tag (latest by date)
.. image:: https://quay.io/repository/thoth-station/slo-reporter/status :target: https://quay.io/repository/thoth-station/slo-reporter?tab=tags :alt: Quay - Build
This is Thoth SLO Reporter to share Thoth achievements and behaviour with the outside world.
You can check last report created by SLO-reporter using this link <https://htmlpreview.github.io/?https://github.com/thoth-station/slo-reporter/blob/master/thoth/slo_reporter/SLO-reporter.html>
__.
SLI indicators are collected in order to create a final report that is sent out to Thoth Team and Users with the following structure:
Python world description of packages/releases from indexes (e.g PyPI, AICoE) to check the knowledge available.
SLIPyPIKnowledgeGraph <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_python_knowledge_graph/README.md>
__.This category contains information about Thoth learning rates for packages information (e.g. solver, security):
SLILearning <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_learning/README.md>
__.This category contains information about Thoth knowledge collected:
SLIKnowledgeGraph <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_knowledge_graph/README.md>
__.This part of the report is focused on Thoth integrations <https://github.com/thoth-station/adviser/blob/master/docs/source/integration.rst>
__ and their use:
SLIThothIntegrations <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_thoth_integrations>
__.SLIKebechet <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_thoth_services/README.md>
__.This part of the report is focused on analytics for APIs:
SLIUserAPI <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_apis/README.md>
__.This part of the report is focused on status of backend processes (e.g. duration, success, failures):
SLIWorkflowLatency <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_backends/README.md>
__.
SLIWorkflowQuality <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/sli_backends/README.md>
__.
Data collection for SLO report relies on prometheus-api-client library <https://github.com/AICoE/prometheus-api-client-python>
__.
All data collected can be sent out by email <https://github.com/thoth-station/slo-reporter/blob/c55577075ff84ddf8a7a68ad604dd153d1ee53b6/app.py#L228>
__
on specific day <https://github.com/thoth-station/slo-reporter/blob/c55577075ff84ddf8a7a68ad604dd153d1ee53b6/thoth/slo_reporter/configuration.py#L112>
and stored on Ceph <https://github.com/thoth-station/slo-reporter/blob/c55577075ff84ddf8a7a68ad604dd153d1ee53b6/app.py#L129>
periodically
to reuse the data for visualization (e.g. using Superset <https://github.com/apache/incubator-superset>
__).
thoth/slo_reporter <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter>
__ if it doesn't exist for the categories of SLI.The new class would inherit the base class SLIBase
from sli_base.py <https://github.com/thoth-station/slo-reporter/blob/master/thoth/slo_reporter/sli_base.py>
__.Link <https://github.com/thoth-station/slo-reporter/tree/master/thoth/slo_reporter/static/templates>
__.sli_template.py <https://github.com/thoth-station/slo-reporter/blob/master/thoth/slo_reporter/sli_template.py>
__ and passes down the parameters and passes them to the template.Link <https://prometheus-dh-prod-monitoring.cloud.datahub.psi.redhat.com/graph>
__.aggregate_info
method to return the query, the report, the way data will be stored on Ceph... code-block:: python
def _aggregate_info(self):
"""Aggregate info required for learning quantities SLI Report."""
return {
"query": self._query_sli(),
"evaluation_method": self._evaluate_sli,
"report_method": self._report_sli,
"df_method": self._process_results_to_be_stored,
}
sli_report.py <https://github.com/thoth-station/slo-reporter/blob/master/thoth/slo_reporter/sli_report.py>
__ and add it to the REPORT_SLI_CONTEXT
dictionary.The order of the class in REPORT_SLI_CONTEXT
is the order which the report is populated.The general practice for the adding order of reports is - Python world description of packages/releases from indexes (e.g. PyPI, AICoE),Thoth Learning and Thoth Knoweldge Graph, Thoth adviser integrations (e.g. Kebechet), analytics for requests (e.g. User-API) and backend processes (e.g. Argo workflows).configuration.py <https://github.com/thoth-station/slo-reporter/blob/master/thoth/slo_reporter/configuration.py>
__.REGISTERED_SERVICES
dictionary in configuration.py <https://github.com/thoth-station/slo-reporter/blob/master/thoth/slo_reporter/configuration.py>
__, a dictionary with the following info need to be added:Examples:
.. code-block:: python
REGISTERED_SERVICES = {
"adviser": {
"entrypoint": "adviser",
"namespace": _BACKEND_NAMESPACE,
},
"kebechet": {
"entrypoint": "kebechet-job",
"namespace": _BACKEND_NAMESPACE,
},
"inspection": {
"entrypoint": "main",
"namespace": _AMUN_INSPECTION_NAMESPACE,
},
"solver": {
"entrypoint": 'solve-and-sync',
"namespace": _MIDDLETIER_NAMESPACE,
},
}
The following command will open a web browser showing how the report will look like.
.. code-block:: python
DEBUG_LEVEL=1 DRY_RUN=1 pipenv run python3 app.py
You need to set also the following environment variables:
.. code-block:: python
THOTH_SLO_REPORTER_USING_SMTP_TLS=1 SMTP_SERVER_USERNAME=<username> SMTP_SERVER_USERNAME=<passowrd> pipenv run python3 app.py