* Update tempo-distributed doc to be community maintained; remove GET * Apply suggestion from @knylander-grafana * Apply suggestion from @knylander-grafana
8.4 KiB
headless, description, labels
| headless | description | labels | ||||
|---|---|---|---|---|---|---|
| true | Shared file for metamonitoring GET and Tempo. |
|
Metamonitoring for Tempo is handled by the Grafana Kubernetes Helm chart (>=v2.1). Metamonitoring can be used with both microservices and single binary deployments of Tempo.
The Helm chart configures Grafana Alloy to collect metrics and logs.
Steps
This procudure uses the Grafana Kubernetes Helm chart and the values.yml file sets parameters in the Helm chart.
-
Add the Grafana Community Helm Chart repository, or update, if already added.
helm repo add grafana-community https://grafana-community.github.io/helm-charts helm repo update -
Create a new file named
values.yml. Add the following example into yourvalues.ymlfile and save it. Where indicated, add the values specific to your instance.cluster: name: traces # Name of the cluster. This populates the cluster label. integrations: tempo: instances: - name: "traces" # This is the name for the instance label that reports. namespaces: - traces # This is the namespace that is searched for Tempo instances. Change this accordingly. metrics: enabled: true portName: prom-metrics logs: enabled: true labelSelectors: app.kubernetes.io/name: tempo alloy: name: "traces-monitoring" destinations: - name: "metrics" type: prometheus url: "<url>" # URL for Prometheus. Should look similar to "https://<prometheus host>/api/prom/push". auth: type: basic username: "<username>" password: "<password>" - name: "logs" type: loki url: "<url>" # URL for Loki. Should look similar to "https://<loki host>/loki/api/v1/push". auth: type: basic username: "<username>" password: "<password>" alloy-metrics: enabled: true podLogs: enabled: true gatherMethod: kubernetesApi namespaces: [traces] # Set to namespace from above under instances. collector: alloy-singleton alloy-singleton: enabled: true alloy-metrics: enabled: true # Sends Grafana Alloy metrics to ensure the monitoring is working properly. -
Install the Helm chart using the following command to create Grafana Alloy instances to scrape metrics and logs:
helm install k8s-monitoring grafana/k8s-monitoring \ --namespace monitoring \ --create-namespace \ -f values.yml -
Verify that data is being sent to Grafana.
- Log into Grafana.
- Select Metrics Drilldown and select
cluster=<cluster.name>wherecluster.nameis the name specified in thevalues.ymlfile. - Do the same for Logs Drilldown.
This example doesn’t include ingestion for any other data such as traces for sending to Tempo, but can be included with some configuration updates. Refer to Configure Alloy to remote-write to Tempo for more information.
Install Tempo dashboards in Grafana
Alloy scrapes metrics from Tempo and sends them to Mimir or another Prometheus compatible time-series database. You can then monitor Tempo using the mixins.
Tempo ships with mixins that includes:
- Relevant dashboards for overseeing the health of Tempo as a whole, as well as its individual components
- Recording rules that simplify the generation of metrics for dashboards and free-form queries
- Alerts that trigger when Tempo falls out of operational parameters
To install the mixins in Grafana, you need to:
-
Download the mixin dashboards from the Tempo repository.
-
Import the dashboards in your Grafana instance.
-
Upload
alerts.yamlandrules.yamlfiles for Mimir or Prometheus
Download the tempo-mixin dashboards
-
First, clone the Tempo repository from Github:
git clone git+ssh://github.com/grafana/tempo -
Once you have a local copy of the repository, navigate to the
operations/tempo-mixin-compileddirectory.cd operations/tempo-mixin-compiled
This contains a compiled version of the alert and recording rules, as well as the dashboards.
{{< admonition type="note" >}}
If you want to change any of the mixins, make your updates in the operations/tempo-mixin directory.
Use the instructions in the README in that directory to regenerate the files.
The mixins are generated in the operations/tempo-mixin-compiled directory.
{{< /admonition >}}
Import the dashboards to Grafana
The dashboards directory includes the six monitoring dashboards that can be installed into your Grafana instance.
Refer to Import a dashboard in the Grafana documentation.
{{< admonition type="tip" >}} Install all six dashboards. You can only import one dashboard at a time. Create a new folder in the Dashboards area, for example “Tempo Monitoring”, as an easy location to save the imported dashboards. {{< /admonition >}}
To create a folder:
- Open your Grafana instance and select Dashboards.
- Select New in the right corner.
- Select New folder from the New drop-down.
- Name your folder, for example, “Tempo Monitoring”.
- Select Create.
To import a dashboard:
- Open your Grafana instance and select Dashboards.
- Select New in the right corner.
- Select Import.
- On the Import dashboard screen, select Upload.
- Browse to
operations/tempo-mixin-compiled/dashboardsand select the dashboard to import. - Drag the dashboard file, for example,
tempo-operational.json, onto the Upload area of the Import dashboard screen. Alternatively, you can browse to and select a file. - Select a folder in the Folder drop-down where you want to save the imported dashboard. For example, select Tempo Monitoring created in the earlier steps.
- Select Import.
The imported files are listed in the Tempo Monitoring dashboard folder.
To view the dashboards in Grafana:
- Select Dashboards in your Grafana instance.
- Select Tempo Monitoring, or the folder where you uploaded the imported dashboards.
- Select any files in the folder to view it.
The ‘Tempo Operational’ dashboard shows read (query) information:
Add alerts and rules to Prometheus or Mimir
The rules and alerts need to be installed into your Mimir or Prometheus instance. To do this in Prometheus, refer to the recording rules and alerting rules documentation.
For Mimir, you can use mimirtool to upload rule and alert configuration. Using a default installation of Mimir used as the metrics store for the Alloy configuration, you might run the following:
mimirtool rules load operations/tempo-mixin-compiles/rules.yml --address=https://mimir-cluster.distributor.mimir.svc.cluster.local:9001
mimirtool alertmanager load operations/tempo-mixin-compiles/alerts.yml --address=https://mimir-cluster.distributor.mimir.svc.cluster.local:9001
For Grafana Cloud, you need to add the username and API key as well. Refer to the mimirtool documentation for more information.
