|
| 1 | +--- |
| 2 | +layout: docs |
| 3 | +menu: |
| 4 | + docsplatform_{{.version}}: |
| 5 | + identifier: cluster-management-otel-monitoring |
| 6 | + name: OpenTelemetry Monitoring |
| 7 | + parent: cluster-management |
| 8 | + weight: 90 |
| 9 | +menu_name: docsplatform_{{.version}} |
| 10 | +section_menu_id: guides |
| 11 | +--- |
| 12 | + |
| 13 | +# OpenTelemetry Monitoring |
| 14 | + |
| 15 | +This guide walks through setting up an observability stack that collects |
| 16 | +telemetry from your spoke clusters using OpenTelemetry, stores it in an |
| 17 | +object-storage bucket, and exposes it through a TelemetryStack. |
| 18 | + |
| 19 | +## Architecture |
| 20 | + |
| 21 | +The setup involves three kinds of clusters: |
| 22 | + |
| 23 | +- **Hub cluster** — the central Platform Console (ACE). This is where you |
| 24 | + operate clusters, manage organizations, and view dashboards. It is the |
| 25 | + management plane; it does not store telemetry itself. |
| 26 | +- **Monitoring cluster** — a dedicated observability cluster that runs the |
| 27 | + TelemetryStack and stores all telemetry: metrics (Thanos + object storage), |
| 28 | + and logs and traces (ClickHouse). It serves multi-tenant queries back to the |
| 29 | + hub. This is the cluster imported with the **Observability Cluster** profile. |
| 30 | +- **Spoke / imported clusters** — the clusters you actually want to observe. |
| 31 | + Once the OpenTelemetry feature (`appscode-otel-stack`) is enabled on them, |
| 32 | + their collectors ship metrics, logs, and traces to the monitoring cluster. |
| 33 | + |
| 34 | +In short: spoke clusters produce telemetry, the monitoring cluster stores and |
| 35 | +serves it, and the hub is where you view it. |
| 36 | + |
| 37 | +## The Monitoring Cluster's Special Features |
| 38 | + |
| 39 | +Beyond a normal spoke, the monitoring cluster runs three components (in the |
| 40 | +`monitoring` namespace) that make multi-tenant telemetry storage work: |
| 41 | + |
| 42 | +- **`thanos-operator`** — reconciles the Thanos custom resources |
| 43 | + (`ThanosReceive`, `ThanosStore`, `ThanosQuery`, `ThanosCompact`, |
| 44 | + `ThanosRuler`) that the TelemetryStack generates into running workloads. It |
| 45 | + is the controller that turns your TelemetryStack spec into an actual Thanos |
| 46 | + deployment. |
| 47 | +- **`tenant-operator`** — manages `Tenant` custom resources. Each client |
| 48 | + organization / monitored cluster gets a `Tenant` that references the |
| 49 | + TelemetryStack and defines its retention and ingest/query endpoints, giving |
| 50 | + every tenant an isolated slice of the shared stack. |
| 51 | +- **`prom-label-proxy`** — the multi-tenant gateway on the ingest and query |
| 52 | + paths. It enforces per-tenant label filtering (via the tenant ID / label) |
| 53 | + so each tenant can only write to and read back its own data. The `Tenant` |
| 54 | + endpoints point at this proxy. |
| 55 | + |
| 56 | +## Overview |
| 57 | + |
| 58 | +The end-to-end flow is: |
| 59 | + |
| 60 | +1. Create a self-hosted installer. |
| 61 | +2. Create the observability cluster. |
| 62 | +3. Install MinIO. |
| 63 | +4. Create the `telemetry` bucket. |
| 64 | +5. Create a TelemetryStack. |
| 65 | +6. Enable OpenTelemetry on the spoke clusters to be monitored. |
| 66 | +7. Create a client organization. |
| 67 | + |
| 68 | +## Step 1: Create the Self-Hosted Installer |
| 69 | + |
| 70 | +Set up a self-hosted installer for your environment. |
| 71 | + |
| 72 | +## Step 2: Create the Observability Cluster |
| 73 | + |
| 74 | +Create a new cluster and import it as a spoke, choosing the **Observability |
| 75 | +Cluster** cluster profile during import. See |
| 76 | +[Import Observability Cluster](add-cluster/import-observability-cluster.md) for |
| 77 | +details. |
| 78 | + |
| 79 | +## Step 3: Install MinIO |
| 80 | + |
| 81 | +The TelemetryStack can be backed by any S3-compatible object storage — MinIO is |
| 82 | +used here only as an example. Substitute your own storage solution (AWS S3, GCS, |
| 83 | +Ceph, etc.) as needed. |
| 84 | + |
| 85 | +Install MinIO on the observability cluster to provide the object storage that |
| 86 | +backs the TelemetryStack: |
| 87 | + |
| 88 | +```bash |
| 89 | +kubectl create ns minio |
| 90 | + |
| 91 | +kubectl create secret generic tls-ssl-minio -n minio \ |
| 92 | + --from-file=private.key \ |
| 93 | + --from-file=public.crt |
| 94 | + |
| 95 | +kubectl create secret generic tls-ssl-minio -n monitoring \ |
| 96 | + --from-file=private.key \ |
| 97 | + --from-file=public.crt |
| 98 | + |
| 99 | +helm repo add minio-comm https://charts.min.io/ |
| 100 | + |
| 101 | +helm upgrade -i minio \ |
| 102 | + --namespace minio \ |
| 103 | + --create-namespace \ |
| 104 | + --set rootUser=rootuser,rootPassword=rootpass123 \ |
| 105 | + minio-comm/minio \ |
| 106 | + -f ./minio/minio-values.yaml |
| 107 | +``` |
| 108 | + |
| 109 | +The `tls-ssl-minio` secret is created in both the `minio` and `monitoring` |
| 110 | +namespaces so that MinIO and the telemetry components can serve and consume TLS |
| 111 | +using the same certificate pair (`private.key` / `public.crt`). |
| 112 | + |
| 113 | +## Step 4: Create the `telemetry` Bucket |
| 114 | + |
| 115 | +Port-forward the MinIO console and create the bucket through the UI: |
| 116 | + |
| 117 | +```bash |
| 118 | +kubectl port-forward -n minio svc/minio-console 9001:9001 |
| 119 | +``` |
| 120 | + |
| 121 | +Open `https://localhost:9001` and log in: |
| 122 | + |
| 123 | +| Field | Value | |
| 124 | +|----------|----------------| |
| 125 | +| Username | `rootuser` | |
| 126 | +| Password | `rootpass123` | |
| 127 | + |
| 128 | +Create a bucket named **`telemetry`**. |
| 129 | + |
| 130 | +## Step 5: Create a TelemetryStack |
| 131 | + |
| 132 | +In the observability cluster, navigate to: |
| 133 | + |
| 134 | +**Settings → TelemetryStack → Create a new Telemetry stack** |
| 135 | + |
| 136 | +Fill in the configuration sections as shown below. |
| 137 | + |
| 138 | +Configure Metrics (Compact, Store, Query, Router, Ingester): |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | +Ruler, Additional Config, and Configure Clickhouse: |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | +Configure Clickhouse (Standalone / Create Topology), Configure S3, and Configure ID: |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | +### Resources Created by the TelemetryStack |
| 151 | + |
| 152 | +Once the TelemetryStack is created, the operators reconcile it into a set of |
| 153 | +resources in the `monitoring` namespace. You can find everything the stack owns |
| 154 | +by looking for resources whose owner is the TelemetryStack: |
| 155 | + |
| 156 | +```bash |
| 157 | +# The Thanos and ClickHouse custom resources generated from the stack |
| 158 | +kubectl get thanosreceives,thanosstores,thanosqueries,thanoscompacts,thanosrulers.monitoring.thanos.io,clickhouse -n monitoring |
| 159 | + |
| 160 | +# Any resource owned by the telemetry-stack (children carry it in ownerReferences) |
| 161 | +kubectl get all -n monitoring -o json | \ |
| 162 | + jq -r '.items[] | select(.metadata.ownerReferences[]?.kind=="TelemetryStack") | "\(.kind)/\(.metadata.name)"' |
| 163 | +``` |
| 164 | + |
| 165 | +For the **metrics** pipeline, `thanos-operator` produces: |
| 166 | + |
| 167 | +- **`ThanosReceive`** → a receive-router deployment plus a receive-ingester |
| 168 | + StatefulSet — the remote-write ingestion endpoint for incoming metrics. |
| 169 | +- **`ThanosStore`** → a store StatefulSet that serves historical blocks from |
| 170 | + object storage. |
| 171 | +- **`ThanosQuery`** → query and query-frontend deployments that fan out reads |
| 172 | + across the receivers and store. |
| 173 | +- **`ThanosCompact`** → one StatefulSet per retention tier that downsamples and |
| 174 | + compacts blocks in object storage. |
| 175 | +- **`ThanosRuler`** → a ruler StatefulSet that evaluates recording/alerting |
| 176 | + rules and forwards alerts to Alertmanager. |
| 177 | + |
| 178 | +For the **logs / traces** pipeline, a KubeDB **`ClickHouse`** database |
| 179 | +(`telemetry-stack-clickhouse`) is provisioned, along with the supporting |
| 180 | +secrets (`telemetry-stack-object-storage`, |
| 181 | +`telemetry-stack-clickhouse-storage-config`). |
| 182 | + |
| 183 | +## Step 6: Enable OpenTelemetry on a Spoke Cluster |
| 184 | + |
| 185 | +Enable the OpenTelemetry feature on each spoke cluster you want to monitor — |
| 186 | +either during import or on an existing spoke. See |
| 187 | +[Import Observability Cluster](add-cluster/import-observability-cluster.md#enable-the-opentelemetry-feature-on-a-spoke-cluster). |
| 188 | + |
| 189 | +## Step 7: Create a Client Organization |
| 190 | + |
| 191 | +Create a client organization and point it at the monitoring cluster so its |
| 192 | +telemetry is stored in the shared TelemetryStack. See |
| 193 | +[Create a Client Organization](../../client-organization/create-client-organization.md) |
| 194 | +— the **Telemetry Configuration** step is where you select the monitoring |
| 195 | +cluster and set retention. |
0 commit comments