Observability
Installing kube-prometheus-stack in the same Kubernetes cluster that hosts the Seldon Core 2.
kube-prometheus
, also known as Prometheus Operator, is a popular open-source project that provides complete monitoring and alerting solutions for Kubernetes clusters. It combines tools and components to create a monitoring stack for Kubernetes environments.
Note: In this example Prometheus is installed within the same Kubernetes cluster as the Seldon Core 2. However, Seldon Core 2 exposes metrics to any of the managed Prometheus endpoints as well.
The Seldon Core 2, along with any deployed models, automatically exposes metrics to Prometheus. By default, certain alerting rules are pre-configured, and an alertmanager instance is included.
You can install kube-prometheus
to monitor Seldon components, and ensure that the appropriate ServiceMonitors
are in place for Seldon deployments. The analytics component is configured with the Prometheus integration. The monitoring for Seldon Core 2 is based on the Prometheus Operator and the related PodMonitor
and PrometheusRule
resources.
Monitoring the model deployments in Seldon Core 2 involves:
Prerequisites
Install Seldon Core 2.
Install Ingress Controller.
Install Grafana in the namespace
seldon-monitoring
.
Installing kube-prometheus
Create a namespace for the monitoring components of Seldon Core 2.
Create a YAML file to specify the initial configuration. For example, create the
prometheus-values.yaml
file. Use your preferred text editor to create and save the file with the following content:Note: Make sure to include
metric-labels-allowlist: pods=[*]
in the Helm values file. If you are using your own Prometheus Operator installation, ensure that the pods labels, particularlyapp.kubernetes.io/managed-by=seldon-core
, are part of the collected metrics. These labels are essential for calculating deployment usage rules.Change to the directory that contains the
prometheus-values
file and run the following command to install version9.5.12
ofkube-prometheus
.When the installation is complete, you should see this:
Check the status of the installation.
When the installation is complete, you should see this:
Configuring monitoring for Seldon Core 2
You can access Prometheus from outside the cluster by running the following commands:
You can access Alertmanager from outside the cluster by running the following commands:
Apply the Custom RBAC Configuration settings for kube-prometheus.
Configure metrics collection by createing the following
PodMonitor
resources.When the resources are created, you should see this:
Next
Prometheus User Interface
You may now be able to check the status of Seldon components in Prometheus:
Open your browser and navigate to
http://127.0.0.1:9090/
to access Prometheus UI from outside the cluster.Go to Status and select Targets.
The status of all the endpoints and the scrape details are displayed.
Grafana
You can view the metrics in Grafana Dashboard after you set Prometheus as the Data Source, and import seldon.json
dashboard located at seldon-core/v2.8.2/prometheus/dashboards
in GitHub repository.
Last updated
Was this helpful?