You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: observability/cockpit/how-to/send-log-from-k8s-to-cockpit.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ dates:
13
13
posted: 2025/01/20
14
14
---
15
15
16
-
In this page we will show you how to send application logs from your Kubernetes cluster to your Cockpit using either a Helm chart or deploying a Helm chart with [Terraform](https://www.terraform.io/).
16
+
In this page, we will show you how to send application logs from your Kubernetes cluster to your Cockpit using either a Helm chart or deploying a Helm chart with [Terraform](https://www.terraform.io/).
17
17
18
18
We will use the [k8s-monitoring](https://artifacthub.io/packages/helm/grafana/k8s-monitoring/1.6.16) Helm Chart, which installs an Alloy Daemon set to export your Kubernetes cluster's logs to your Cockpit.
19
19
@@ -23,7 +23,7 @@ We will use the [k8s-monitoring](https://artifacthub.io/packages/helm/grafana/k8
23
23
-[Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
24
24
-[Created](/observability/cockpit/how-to/create-external-data-sources/) a custom external data source of the [logs type](/observability/cockpit/concepts/#data-types)
25
25
-[Created](/observability/cockpit/how-to/create-token/) a Cockpit token in the same region as the logs data source
26
-
- A running Kubernetes cluster containing your application deployed
26
+
- A running Kubernetes cluster containing your deployed application
27
27
-[Created](/identity-and-access-management/iam/how-to/create-api-keys/) an API key and retrieved your API secret key
28
28
29
29
<Messagetype="important">
@@ -45,7 +45,7 @@ destinations:
45
45
protocol: "http"
46
46
logs:
47
47
enabled: true
48
-
url: "$COCKPIT_CUSTOM_LOGS_DATASOURCE_URL/loki/api/v1/push"##You can find your logs URL in the **Data sources** tab of the Scaleway conseole under the "API URL" section of the relevant data source
48
+
url: "$COCKPIT_CUSTOM_LOGS_DATASOURCE_URL/loki/api/v1/push"##You can find your logs URL in the **Data sources** tab of the Scaleway console under the "API URL" section of the relevant data source
49
49
tenantId: "$COCKPIT_TOKEN"
50
50
51
51
metrics:
@@ -77,20 +77,20 @@ alloy-singleton:
77
77
```
78
78
79
79
<Message type="note">
80
-
The template above is for sending logs to your Cockpit. You can also configure it to send metrics to Cockpit using this Helm chart.
81
-
Refer to our dedicated doucumentation to [send metrics from your cluster to Cockpit](/observability/cockpit/how-to/send-metrics-froms-k8s-to-cockpit).
80
+
The template above is for sending logs to your Cockpit. You can also configure it to send metrics to Cockpit using this Helm chart.
81
+
Refer to our dedicated documentation to [send metrics from your cluster to Cockpit](/observability/cockpit/how-to/send-metrics-froms-k8s-to-cockpit).
82
82
</Message>
83
83
84
84
## Send Kubernetes logs using Helm chart
85
85
86
-
Once you have configured your `values.yml` file, you can use Helm to deploy the log-forwarding configuration to your Kubernetes cluster. Before you can install the Helm chart, ensure that your `kubectl` tool is properly connected to your Kubernetes cluster. `kubectl` is the command-line tool for interacting with Kubernetes clusters.
86
+
Once you have configured your `values.yml` file, you can use Helm to deploy the log-forwarding configuration to your Kubernetes cluster. Before installing the Helm chart, ensure that your `kubectl` tool is properly connected to your Kubernetes cluster. `kubectl` is the command-line tool for interacting with Kubernetes clusters.
87
87
88
88
1. [Connect](/containers/kubernetes/how-to/connect-cluster-kubectl/) `kubectl` to your Kubernetes cluster
89
89
2. Run the command below to install the `k8s-monitoring` Helm chart:
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-log-ingester` with a clear name (ex. `alloy-logs-ingester`). In our configuration we are using `alloy-lm-ingester`.
93
+
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-log-ingester` with a clear name (ex. `alloy-logs-ingester`). In our configuration, we are using `alloy-lm-ingester`.
94
94
95
95
Helm installs the `k8s-monitoring` chart, which includes the Alloy DaemonSet configured to collect logs from your Kubernetes cluster.
96
96
The DaemonSet ensures that a pod is running on each node in your cluster, which collects logs and forwards them to the specified Loki endpoint in your Cockpit.
@@ -133,11 +133,11 @@ You can also use Terraform to manage and deploy Helm charts, providing you with
133
133
3. Save your changes.
134
134
4. Run `terraform init` to initialize your Terraform configuration and download any necessary providers.
135
135
5. Run `terraform apply` to apply your configuration.
136
-
5. Type `yes` when prompted to confirm the actions.
136
+
6. Type `yes` when prompted to confirm the actions.
137
137
138
138
## Explore your logs in Cockpit
139
139
140
-
1. Click **Cockpit** in the Observability section of the Scaleway [console](https://console.scaleway.com/) side menu. The **Cockpit** overview page displays.
140
+
1. Click **Cockpit** in the Observability section of the Scaleway [console](https://console.scaleway.com/) side menu. The **Cockpit Overview** page displays.
141
141
2. Click **Open dashboards** to open your managed dashboards in Grafana. You are redirected to the Grafana website.
142
142
3. Log in to Grafana using your [Grafana credentials](/observability/cockpit/how-to/retrieve-grafana-credentials/).
143
143
4. Click the **Home** icon, then click **Explore**.
Copy file name to clipboardExpand all lines: observability/cockpit/how-to/send-metrics-from-k8s-to-cockpit.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ dates:
14
14
---
15
15
16
16
17
-
In this page we will show you how to send application metrics from your Kubernetes cluster to your Cockpit using either a Helm chart or deploying a Helm chart with [Terraform](https://www.terraform.io/).
17
+
In this page we will show you how to send application metrics from your Kubernetes cluster to your Cockpit, either by using a Helm chart or deploying a Helm chart with [Terraform](https://www.terraform.io/).
18
18
19
19
We will use the [k8s-monitoring](https://artifacthub.io/packages/helm/grafana/k8s-monitoring/1.6.16) Helm Chart, which installs an Alloy Daemon set to export your Kubernetes cluster's metrics to your Cockpit.
20
20
@@ -24,7 +24,7 @@ We will use the [k8s-monitoring](https://artifacthub.io/packages/helm/grafana/k8
24
24
-[Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
25
25
-[Created](/observability/cockpit/how-to/create-external-data-sources/) a custom external data source of the [metrics type](/observability/cockpit/concepts/#data-types)
26
26
-[Created](/observability/cockpit/how-to/create-token/) a Cockpit token in the same region as the metrics data source
27
-
- A running Kubernetes cluster containing your application deployed
27
+
- A running Kubernetes cluster containing your deployed application
28
28
-[Created](/identity-and-access-management/iam/how-to/create-api-keys/) an API key and retrieved your API secret key
29
29
30
30
<Messagetype="important">
@@ -66,13 +66,13 @@ alloy-singleton:
66
66
```
67
67
68
68
<Message type="note">
69
-
The template above is for sending metrics to your Cockpit. You can also configure it to send logs to Cockpit using this Helm chart.
70
-
Refer to our dedicated doucumentation to [send logs from your cluster to Cockpit](/observability/cockpit/how-to/send-logs-from-k8s-to-cockpit)
69
+
The template above is for sending metrics to your Cockpit. You can also configure it to send logs to Cockpit using this Helm chart.
70
+
Refer to our dedicated documentation to [send logs from your cluster to Cockpit](/observability/cockpit/how-to/send-logs-from-k8s-to-cockpit)
71
71
</Message>
72
72
73
73
## Add annotations for auto-discovery
74
74
75
-
Annotations in Kubernetes provide a way to attach metadata to your resources. For `k8s-monitoring`, these annotations signal which pods should be scraped for metrics, and what port to use. For the sake of this documentation, we are adding annotations to specify we want `k8s-monitoring` to scrape the pods from your deployment. Make sure that you replace `$METRICS_PORT` with the port where your application exposes Prometheus metrics.
75
+
Annotations in Kubernetes provide a way to attach metadata to your resources. For `k8s-monitoring`, these annotations signal which pods should be scraped for metrics, and what port to use. For the sake of this documentation, we are adding annotations to specify we want `k8s-monitoring` to scrape the pods from our deployment. Make sure that you replace `$METRICS_PORT` with the port where your application exposes Prometheus metrics.
4. Run `terraform init` to initialize your Terraform configuration and download any necessary providers.
141
141
5. Run `terraform apply` to apply your configuration.
142
-
5. Type `yes` when prompted to confirm the actions.
142
+
6. Type `yes` when prompted to confirm the actions.
143
143
144
144
## Send Kubernetes metrics using Helm chart
145
145
146
-
Once you have configured your `values.yml` file, you can use Helm to deploy the metric-forwarding configuration to your Kubernetes cluster. Before you can install the Helm chart, ensure that your `kubectl` tool is properly connected to your Kubernetes cluster. `kubectl` is the command-line tool for interacting with Kubernetes clusters.
146
+
Once you have configured your `values.yml` file, you can use Helm to deploy the metric-forwarding configuration to your Kubernetes cluster. Before installing the Helm chart, ensure that your `kubectl` tool is properly connected to your Kubernetes cluster. `kubectl` is the command-line tool for interacting with Kubernetes clusters.
147
147
148
148
1. [Connect](/containers/kubernetes/how-to/connect-cluster-kubectl/) `kubectl` to your Kubernetes cluster
149
149
2. Run the command below to install the `k8s-monitoring` Helm chart:
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-metric-ingester` with a clear name (ex. `alloy-metrics-ingester`). In our configuration we are using `alloy-lm-ingester`.
153
+
The `-f` flag specifies the path to your `values.yml` file, which contains the configuration for the Helm chart. Make sure that you replace `/your-path/to/values.yml` with the correct path where your `values.yml` file is stored. Make sure that you also replace `name-of-your-choice-for-your-metric-ingester` with a clear name (ex. `alloy-metrics-ingester`). In our configuration, we are using `alloy-lm-ingester`.
154
154
155
155
Helm installs the `k8s-monitoring` chart, which includes the Alloy DaemonSet configured to collect metrics from your Kubernetes cluster.
156
156
The DaemonSet ensures that a pod is running on each node in your cluster, which collects metrics and forwards them to the specified Prometheus endpoint in your Cockpit.
@@ -166,7 +166,7 @@ Once you have configured your `values.yml` file, you can use Helm to deploy the
166
166
167
167
Now that your metrics are exported to your Cockpit, you can access and query them.
168
168
169
-
1. Click **Cockpit** in the Observability section of the Scaleway [console](https://console.scaleway.com/) side menu. The **Cockpit** overview page displays.
169
+
1. Click **Cockpit** in the Observability section of the Scaleway [console](https://console.scaleway.com/) side menu. The **Cockpit Overview** page displays.
170
170
2. Click **Open dashboards** to open your managed dashboards in Grafana. You are redirected to the Grafana website.
171
171
3. Log in to Grafana using your [Grafana credentials](/observability/cockpit/how-to/retrieve-grafana-credentials/).
172
172
4. Click the **Home** icon, then click **Explore**.
0 commit comments