A Prometheus scraper and collection of Grafana dashboards for Okteto Insights
There are several sample dashboards to help you start exploring the data provided by Okteto Insights.
The following sections outline deployment steps for setting up a Prometheus and Grafana bundle that will scrape metrics from Okteto Insights, covering both Okteto and standalone setups.
However, it's important to note that while the provided deployment solution is suitable for testing and development purposes, it may not be optimal for production scenarios.
If deployed via Okteto, it will be protected by default via Private endpoints, but if deployed standalone it will be accessible by anyone with network access.
For production deployments, consider adjusting the settings to fit your security, scalability and persistence requirements.
Environment Variable | Default Value | Description |
---|---|---|
PROMETHEUS_CHART_VERSION |
25.19.1 |
The version of the Prometheus chart to be deployed. |
GRAFANA_CHART_VERSION |
7.3.7 |
The version of the Grafana chart to be deployed. |
PROMETHEUS_RELEASE_NAME |
prometheus |
The name of the Prometheus release. |
GRAFANA_RELEASE_NAME |
grafana |
The name of the Grafana release. |
PROMETHEUS_ARGS |
default helm chart installation flags | Main arguments for deploying the Prometheus chart. |
GRAFANA_ARGS |
default helm chart installation flags | Main arguments for deploying the Grafana chart. |
PROMETHEUS_EXTRA_ARGS |
Extra arguments for the Helm upgrade command when deploying Prometheus. | |
GRAFANA_EXTRA_ARGS |
Extra arguments for the Helm upgrade command when deploying Grafana. |
Before deploying with Okteto, make sure you have the following prerequisites:
- Okteto CLI installed and configured
- Access to the Okteto namespace where you want to deploy Prometheus and Grafana
-
Set up the
INSIGHTS_TOKEN
variable:- Create the
INSIGHTS_TOKEN
variable as a user or admin Okteto variable.
- Create the
-
Run the deployment command or deploy the repository from the Okteto UI:
okteto deploy
This will deploy Prometheus and Grafana using the values of the INSIGHTS_TOKEN
variable from the Okteto environment.
Before deploying standalone, make sure you have the following prerequisites:
- Access to the Kubernetes cluster where you want to deploy Prometheus and Grafana
-
Set up the environment variables:
- Ensure both
INSIGHTS_TOKEN
andDOMAIN
variables are exported.
- Ensure both
-
Run the deployment command:
make add-helm-repos
make deploy-prometheus
make deploy-grafana
This will deploy Prometheus and Grafana using the exported values of INSIGHTS_TOKEN
and DOMAIN
variables.
To scrape Prometheus metrics from Okteto Insights using Prometheus Operator, follow these steps:
-
Ensure prerequisites:
- Prometheus Operator is installed in the cluster, and its version is higher than 0.65.1.
- The CRD for
ScrapeConfig
is correctly installed in the cluster.
-
Apply the following
ScrapeConfig
manifest in theokteto
namespace:apiVersion: monitoring.coreos.com/v1alpha1 kind: ScrapeConfig metadata: name: okteto namespace: okteto labels: instance: okteto spec: staticConfigs: - targets: - okteto.yourinstancedomain.com:443 scheme: HTTPS authorization: credentials: key: bearer name: okteto-insights
Replace
okteto.yourinstancedomain.com
with your Okteto instance address. Refer to the following documentation for getting this value:If you customized your Helm release
insights.bearerSecret
configuration, replacespec.authorization.credentials
accordingly. Refer to the following documentation for more information: -
Label the
okteto
namespace:kubectl label ns okteto prometheus-operator=okteto-insights
-
Update your Prometheus Operator instance with the following sections:
spec: scrapeConfigSelector: matchLabels: instance: okteto scrapeConfigNamespaceSelector: matchLabels: prometheus-operator: okteto-insights
These steps will configure your Prometheus Operator to scrape metrics from Okteto Insights.