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: content/en/conf24/1-zero-config-k8s/1-architecture/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ The diagram below details the architecture of the Spring PetClinic Java applicat
9
9
10
10
The Spring PetClinic Java application is a simple microservices application that consists of a frontend and backend services. The frontend service is a Spring Boot application that serves a web interface to interact with the backend services. The backend services are Spring Boot applications that serve RESTful API's to interact with a MySQL database.
11
11
12
-
By the end of this workshop, you will have a better understanding of how to enable **Splunk OpenTelemetry automatic discovery and configuration** for your Java-based applications running in Kubernetes.
12
+
By the end of this workshop, you will have a better understanding of how to enable **automatic discovery and configuration** for your Java-based applications running in Kubernetes.
Copy file name to clipboardExpand all lines: content/en/conf24/1-zero-config-k8s/2-preparation/1-otel.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,10 @@ weight: 2
6
6
7
7
To get Observability signals (**metrics, traces** and **logs**) into **Splunk Observability Cloud** the Splunk OpenTelemetry Collector needs to be deployed into the Kubernetes cluster.
8
8
9
-
For this workshop, we will be using the Splunk OpenTelemetry Collector Helm Chart. First we need to add the Helm chart repository to Helm and update to ensure the latest state:
9
+
For this workshop, we will be using the Splunk OpenTelemetry Collector Helm Chart. First we need to add the Helm chart repository to Helm and update to ensure the latest version:
**Splunk Observability Cloud** offers wizards in the UI to walk you through the setup of the OpenTelemetry Collector on Kubernetes, but in the interest of time, we will use the Helm command below. Some additional parameters are set to enable the operator and automatic discovery and configuration.
35
+
**Splunk Observability Cloud** offers wizards in the UI to walk you through the setup of the OpenTelemetry Collector on Kubernetes, but in the interest of time, we will use the Helm install command below. Additional parameters are set to enable the operator and automatic discovery and configuration.
36
36
37
37
*`--set="operator.enabled=true"` - this will install the Opentelemetry operator that will be used to handle automatic discovery and configuration.
38
38
*`--set="certmanager.enabled=true"` - this will install the required certificate manager for the operator.
The first deployment of our application will be using prebuilt containers to give us the base scenario: a regular Java microservices-based application running in Kubernetes that we want to start observing. So let's deploy our application:
10
8
11
9
{{< tabs >}}
@@ -106,5 +104,3 @@ curl -X GET http://localhost:9999/v2/_catalog
106
104
107
105
{{% /tab %}}
108
106
{{< /tabs >}}
109
-
110
-
If this fails then reach out to your Instructor for a replacement instance.
Copy file name to clipboardExpand all lines: content/en/conf24/1-zero-config-k8s/2-preparation/_index.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ time: 15 minutes
7
7
---
8
8
9
9
The instructor will provide you with the login information for the instance that we will be using during the workshop.
10
+
10
11
When you first log into your instance, you will be greeted by the Splunk Logo as shown below. If you have any issues connecting to your workshop instance then please reach out to your Instructor.
Copy file name to clipboardExpand all lines: content/en/conf24/1-zero-config-k8s/3-verify-setup/1-website.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Verify the PetClinic Website
3
-
linkTitle: 1. Verify the PetClinic Webiste
3
+
linkTitle: 1. Verify PetClinic Website
4
4
weight: 1
5
5
---
6
6
@@ -17,4 +17,8 @@ You can validate if the application is running by visiting **http://<IP_ADDRESS>
17
17
18
18
Make sure the application is working correctly by visiting the **All Owners****(1)** and **Veterinarians****(2)** tabs, you should get a list of names in each case.
19
19
20
+
{{% notice note %}}
21
+
As each service needs to start up and synchronize with the database, it may take a few minutes for the application to fully start up.
linkTitle: 1. Automatic Discovery and Configuration
2
+
title: Patching the Deployment
3
+
linkTitle: 1. Patching the Deployment
4
4
weight: 1
5
5
---
6
6
7
-
To see how automatic discovery and configuration works with a single pod we will patch the `api-gateway`. Once patched, the OpenTelemetry Collector will inject the automatic discovery and configuration library and the Pod will be restarted in order to start sending traces and profiling data. To show what happens when you enable automatic discovery and configuration, let's do a *before and after* of the configuration:
7
+
To configure **automatic discovery and configuration** the deployments need to be patched to add the instrumentation annotation. Once patched, the OpenTelemetry Collector will inject the automatic discovery and configuration library and the Pods will be restarted in order to start sending traces and profiling data. First, confirm that the `api-gateway` does not have the `splunk-otel-java` image.
This container was pulled from a remote repository `quay.io` and was not built to send traces to **Splunk Observability Cloud**. To enable the Java automatic discovery and configuration on the api-gateway service add the `inject-java`annotation to Kubernetes with the `kubectl patch deployment` command.
26
+
Next, enable the Java automatic discovery and configuration for all of the services by adding the annotation to the deployments. The following command will patch the all deployments. This will trigger the OpenTelemetry Operator to inject the `splunk-otel-java`image into the Pods:
A new image has been added to the `api-gateway` which will pull `splunk-otel-java` from `ghcr.io` (if you see two `api-gateway` containers, the original one is probably still terminating, so give it a few seconds).
66
74
67
-
To patch all the other services in the Spring Petclinic application, run the following command. This will add the `inject-java` annotation to the remaining services. There will be no change for the **config-server**, **discovery-server**, **admin-server** and **api-gateway** as these have already been patched.
68
-
69
-
{{< tabs >}}
70
-
{{% tab title="Patch all Petclinic services" %}}
71
-
72
-
```bash
73
-
kubectl get deployments -l app.kubernetes.io/part-of=spring-petclinic -o name | xargs -I % kubectl patch % -p "{\"spec\": {\"template\":{\"metadata\":{\"annotations\":{\"instrumentation.opentelemetry.io/inject-java\":\"default/splunk-otel-collector\"}}}}}"
74
-
75
-
```
76
-
77
-
{{% /tab %}}
78
-
{{% tab title="Patch Output" %}}
79
-
80
-
```text
81
-
deployment.apps/config-server patched (no change)
82
-
deployment.apps/admin-server patched (no change)
83
-
deployment.apps/customers-service patched
84
-
deployment.apps/visits-service patched
85
-
deployment.apps/discovery-server patched (no change)
86
-
deployment.apps/vets-service patched
87
-
deployment.apps/api-gateway patched (no change)
88
-
```
89
-
90
-
{{% /tab %}}
91
-
{{< /tabs >}}
92
-
93
75
Navigate back to the Kubernetes Navigator in **Splunk Observability Cloud**. After a couple of minutes you will see that the Pods are being restarted by the operator and the automatic discovery and configuration container will be added. This will look similar to the screenshot below:
Wait for the Pods to turn green in the Kubernetes Navigator, then go to **APM** to see the data generated by the traces from the newly instrumented services.
Change the **Environment** filter **(1)** to the name of your workshop instance in the dropdown box (this will be **`<INSTANCE>-workshop`** where **`INSTANCE`** is the value from the shell script you ran earlier) and make sure it is the only one selected.
You will see the name **(2)** of the **api-gateway** service and metrics in the Latency and Request & Errors charts (you can ignore the Critical Alert, as it is caused by the sudden request increase generated by the load generator). You will also see the rest of the services appear.
12
+
13
+
We will visit the **Service Map****(3)** in the next section.
0 commit comments