Configuring Monitoring with Grafana LGTM
You can optionally set up monitoring for AtScale using the grafana-lgtm stack, which includes Loki, Grafana, Tempo, and Mimir.
This procedure assumes you have already installed AtScale.
Prerequisites
- A Kubernetes cluster with AtScale already deployed.
- Helm installed on your local machine.
kubectlconfigured to interact with the cluster.
Configure monitoring
To configure monitoring with grafana-lgtm:
-
On your Kubernetes cluster, create a monitoring namespace:
kubectl create namespace <monitoring_namespace>Where
<monitoring_namespace>is the namespace you want to use. -
Configure the Grafana dashboards:
-
Create a
ConfigMapin the monitoring namespace containing the AtScale dashboard JSON files. To download the dashboard files, click here. -
Add the following to the values file for the
grafana-lgtmchart. This enables Grafana to load the AtScale dashboards automatically. Note that the default datasources are used as provided by Grafana.grafana:
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'atscale'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards/atscale
dashboardsConfigMaps:
atscale: atscale-custom-dashboards
-
-
Configure OpenTelemetry to export data:
-
Export the default
telemetry-configfrom the AtScale namespace:kubectl get configmap -n <atscale-namespace> telemetry-config -o yaml > otel-config.yamlExampleTo download an example
ConfigMap, click here. -
In
otel-config.yaml, add exporters for Loki and Mimir:exporters:
# Loki exporter using OTLP HTTP (required from OpenTelemetry v0.131.x onward)
otlphttp/loki:
# Previous exporters/loki is deprecated in v0.131.x+
# Use otlphttp/loki instead with appropriate Loki endpoint
## NOTE:
## From version 0.131.x of OpenTelemetry Collector Contrib, the 'exporters/loki' is no longer available.
## To continue exporting logs to Loki, you should use the 'otlphttp/loki' exporter with the appropriate configuration.
##
## Migration instructions and discussion:
## - https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/release/v0.130.x/exporter/lokiexporter/README.md#migration-instructions
## - https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33916
##
endpoint: http://loki.example.com:3100/otlp/v1/logs
# Prometheus remote write for Mimir
prometheusremotewrite:
endpoint: http://<mimir-nginx-service>.<monitoring-namespace>.svc.cluster.local/api/v1/push -
Make the following changes to the
service.pipelinessection ofotel-config.yaml:service:
pipelines:
logs:
receivers: [otlp]
processors: []
exporters: [file/logs, otlphttp/loki]
metrics:
receivers: [prometheus,otlp]
processors: []
exporters: [file/metrics, prometheusremotewrite] -
Apply the
configMapin the AtScale namespace:kubectl apply -f otel-config.yaml
-
-
Point AtScale to the new
ConfigMap. In your values override file for AtScale, add the following:telemetry:
configMap:
create: false
existingName: "otel-config" -
Apply your changes:
-
Upgrade AtScale with the updated configuration:
helm upgrade atscale -n <atscale-namespace> -f <override-file> -
Deploy the LGTM stack:
helm repo add grafana https://grafana.github.io/helm-charts
helm install lgtm-distributed grafana/lgtm-distributed --version 2.1.0 -f override-file.yaml
-
Grafana allows for further configuration (LoadBalancer service, Ingress resources, environment variables, etc.). For more information, refer to the Grafana documentation.