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: docs/latest/modules/en/pages/setup/otel/getting-started/getting-started-k8s-operator.adoc
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -318,6 +318,15 @@ After a short while and if your pods are getting some traffic you should be able
318
318
319
319
If you also have the Kubernetes stackpack installed the instrumented pods will also have the traces available in the xref:/use/views/k8s-traces-perspective.adoc[trace perspective].
320
320
321
+
== Rancher RBAC
322
+
323
+
For xref:/setup/security/rbac/rbac_rancher.adoc[Rancher RBAC] to work, telemetry data needs to have the following resource attributes present:
324
+
325
+
* `k8s.cluster.name` - the *Cluster* name as used by the Kubernetes stackpack
326
+
* `k8s.namespace.name` - a *Namespace* managed by a Rancher *Project*
327
+
328
+
The Kubernetes Operator will inject these attributes by default into any telemetry data that is sent.
329
+
321
330
== Next steps
322
331
323
332
You can add new charts to components, for example the service or service instance, for your application, by following xref:/use/metrics/k8s-add-charts.adoc[our guide]. It is also possible to create xref:/use/alerting/k8s-monitors.adoc[new monitors] using the metrics and setup xref:/use/alerting/notifications/configure.adoc[notifications] to get notified when your application is not available or having performance issues.
Copy file name to clipboardExpand all lines: docs/latest/modules/en/pages/setup/otel/getting-started/getting-started-k8s.adoc
+32-11Lines changed: 32 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@
6
6
This guide provides instructions on monitoring an application.
7
7
8
8
* The monitored application/workload running in cluster A.
9
-
* The Open Telemetry collector running near the observed application(s), so in cluster A, and sending the data to <stackstate-product-name>.
10
-
* <stackstate-product-name> running in cluster B, or SUSE Cloud Observability.
9
+
* The Open Telemetry collector running near the observed application(s), so in cluster A, and sending the data to {stackstate-product-name}.
10
+
* {stackstate-product-name} running in cluster B, or SUSE Cloud Observability.
11
11
12
12
image::otel/open-telemetry-collector-kubernetes.png[Container instrumentation with Open Telemetry via collector running as Kubernetes deployment]
13
13
@@ -23,16 +23,16 @@ Install the OTel (Open Telemetry) collector in cluster A and configure it to:
23
23
* Receive data from, potentially many, instrumented applications.
24
24
* Enrich collected data with Kubernetes attributes.
25
25
* Generate metrics for traces.
26
-
* Forward the data to <stackstate-product-name>, including authentication using the API key.
26
+
* Forward the data to {stackstate-product-name}, including authentication using the API key.
27
27
28
-
NOTE: <stackstate-product-name> also retries sending data when there are connection problems.
28
+
NOTE: {stackstate-product-name} also retries sending data when there are connection problems.
29
29
30
30
=== Create a Service Token
31
31
32
32
There are two ways to create a service token:
33
33
34
-
* **<stackstate-product-name> UI** - open the main menu by clicking in the top left of the screen and go to `StackPacks` > `Open Telemetry`. If you have not done so before, click the `INSTALL` button. Click the `CREATE NEW SERVICE TOKEN` button and copy the value onto your clipboard.
35
-
* **<stackstate-product-name> CLI** - see xref:/use/security/k8s-service-tokens.adoc#_manage_service_tokens[Manage service tokens]
34
+
* **{stackstate-product-name} UI** - open the main menu by clicking in the top left of the screen and go to `StackPacks` > `Open Telemetry`. If you have not done so before, click the `INSTALL` button. Click the `CREATE NEW SERVICE TOKEN` button and copy the value onto your clipboard.
35
+
* **{stackstate-product-name} CLI** - see xref:/use/security/k8s-service-tokens.adoc#_manage_service_tokens[Manage service tokens]
36
36
37
37
The service token value must be used where the instructions below mention `<SERVICE_TOKEN>`.
38
38
@@ -57,7 +57,7 @@ We install the collector with a Helm chart provided by the Open Telemetry projec
Create a `otel-collector.yaml` values file for the Helm chart. Here is a good starting point for usage with <stackstate-product-name>, replace `<otlp-suse-observability-endpoint:port>` with your OTLP endpoint (see xref:/setup/otel/otlp-apis.adoc[OTLP API] for your endpoint) and insert the name for your Kubernetes cluster instead of `<your-cluster-name>`:
60
+
Create a `otel-collector.yaml` values file for the Helm chart. Here is a good starting point for usage with {stackstate-product-name}, replace `<otlp-suse-observability-endpoint:port>` with your OTLP endpoint (see xref:/setup/otel/otlp-apis.adoc[OTLP API] for your endpoint) and insert the name for your Kubernetes cluster instead of `<your-cluster-name>`:
61
61
62
62
.otel-collector.yaml
63
63
[,yaml]
@@ -84,9 +84,18 @@ config:
84
84
otlp:
85
85
protocols:
86
86
grpc:
87
-
endpoint: <otlp-suse-observability-endpoint:port>
87
+
endpoint: 0.0.0.0:4317
88
88
http:
89
-
endpoint: <otlp-suse-observability-endpoint:port>
89
+
endpoint: 0.0.0.0:4318
90
+
# Scrape the collectors own metrics
91
+
prometheus:
92
+
config:
93
+
scrape_configs:
94
+
- job_name: opentelemetry-collector
95
+
scrape_interval: 10s
96
+
static_configs:
97
+
- targets:
98
+
- ${env:MY_POD_IP}:8888
90
99
extensions:
91
100
# Use the API key from the env for authentication
92
101
bearertokenauth:
@@ -139,12 +148,15 @@ config:
139
148
receivers: [otlp]
140
149
processors: []
141
150
exporters: [nop]
151
+
telemetry:
152
+
metrics:
153
+
address: ${env:MY_POD_IP}:8888
142
154
----
143
155
144
156
145
157
[CAUTION]
146
158
====
147
-
*Use the same cluster name as used for installing the <stackstate-product-name> agent* if you also use the <stackstate-product-name> agent with the Kubernetes stackpack. Using a different cluster name will result in an empty traces perspective for Kubernetes components and will overall make correlating information much harder for <stackstate-product-name> and your users.
159
+
*Use the same cluster name as used for installing the {stackstate-product-name} Agent* if you also use the {stackstate-product-name} agent with the Kubernetes stackpack. Using a different cluster name will result in an empty traces perspective for Kubernetes components and will overall make correlating information much harder for {stackstate-product-name} and your users.
148
160
====
149
161
150
162
Install the collector using the configuration file:
@@ -170,12 +182,21 @@ For other languages follow the documentation on https://opentelemetry.io/docs/la
170
182
171
183
== View the results
172
184
173
-
Go to <stackstate-product-name> and make sure the Open Telemetry Stackpack is installed (via the main menu \-> Stackpacks).
185
+
Go to {stackstate-product-name} and make sure the Open Telemetry Stackpack is installed (via the main menu \-> Stackpacks).
174
186
175
187
If your pods are getting traffic, you should be able to find them under their service name in the Open Telemetry \-> services and service instances overviews. Traces appear in the xref:/use/traces/k8sTs-explore-traces.adoc[trace explorer] and in the xref:/use/views/k8s-traces-perspective.adoc[trace perspective] for the service and service instance components. Span metrics and language specific metrics (if available) become available in the xref:/use/views/k8s-metrics-perspective.adoc[metrics perspective] for the components.
176
188
177
189
If you also have the Kubernetes stackpack installed the instrumented pods will also have the traces available in the xref:/use/views/k8s-traces-perspective.adoc[trace perspective].
178
190
191
+
== Rancher RBAC
192
+
193
+
For xref:/setup/security/rbac/rbac_rancher.adoc[Rancher RBAC] to work, telemetry data needs to have the following resource attributes present:
194
+
195
+
* `k8s.cluster.name` - the *Cluster* name as used by the Kubernetes stackpack
196
+
* `k8s.namespace.name` - a *Namespace* managed by a Rancher *Project*
197
+
198
+
This can be achieved by a configuration such as above. There the `kubernetesAttributes` preset of the `opentelemetry-collector` Helm chart injects a `k8sattributes` processor into each pipeline.
199
+
179
200
== Next steps
180
201
181
202
You can add new charts to components, for example, the service or service instance, for your application, by following xref:/use/metrics/k8s-add-charts.adoc[our guide]. It is also possible to create xref:/use/alerting/k8s-monitors.adoc[new monitors] using the metrics and setup xref:/use/alerting/notifications/configure.adoc[notifications] to get notified when your application is not available or having performance issues.
0 commit comments