Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s operator doc tweaks #62

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/kubernetes/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ Before installing the operator follow these actions:
(TBD: details of API key permissions).

2. Install the following integrations in Kibana:
- `System`
- `Kubernetes`
- `Kubernetes OpenTelemetry Assets`
- `System`
- `Kubernetes`
- `Kubernetes OpenTelemetry Assets`

Notes:
- When using the [Kibana onboarding UX](#deploying-components-using-kibana-onboarding-ux), the previous actions are automatically handled by Kibana.
Expand Down
6 changes: 3 additions & 3 deletions docs/kubernetes/operator/instrumenting-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ spec:
containers:
- image: myapplication-image
name: app
...
...
```

where ``<LANGUAGE>`` is one of: `go` , `java`, `nodejs`, `python`, `dotnet`
Expand All @@ -130,7 +130,7 @@ After adding annotations to Pods or Namespaces, the applications must be restart
kubectl rollout restart deployment/my-deployment
```

In case you have multiple Instrumentation objects with different settings or images, ensure you point your Pods to the the desired `Instrumentation` objects in the annotations.
In case you have multiple Instrumentation objects with different settings or images, ensure you point your Pods to the desired `Instrumentation` objects in the annotations.

The possible values for the annotation are detailed in the [Operator documentation](https://opentelemetry.io/docs/kubernetes/operator/automatic/#add-annotations-to-existing-deployments). For reference purposes, the values are:

Expand All @@ -152,7 +152,7 @@ The following example creates a namespace with an annotation to instrument all P
```
kubectl create namespace java-apps

#Annotate app namespace
# Annotate app namespace
kubectl annotate namespace java-apps instrumentation.opentelemetry.io/inject-java="opentelemetry-operator-system/elastic-instrumentation"

# Run a java example application in the namespace
Expand Down
14 changes: 7 additions & 7 deletions docs/kubernetes/operator/instrumenting-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This document focuses on instrumenting Java applications on Kubernetes, using th

The operator supports a configuration that installs [Java agent extensions](https://opentelemetry.io/docs/zero-code/java/agent/extensions/) in `Instrumentation` objects. The extension needs to be available in an image. Refer to [using extensions with the OpenTelemetry Java agent](https://www.elastic.co/observability-labs/blog/using-the-otel-operator-for-injecting-elastic-agents#using-an-extension-with-the-opentelemetry-java-agent) for an example of adding an extension to an agent.

## Instrument a Java app with EDOT Java SDK on Kubernetes
## Instrument a Java app with EDOT Java SDK on Kubernetes

In this example, you'll learn how to:

Expand All @@ -26,7 +26,7 @@ For this example, we assume the application you're instrumenting is a deployment

```bash
$ kubectl get instrumentation -n opentelemetry-operator-system
NAME AGE ENDPOINT
NAME AGE ENDPOINT
elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collector.opentelemetry-operator-system.svc.cluster.local:4318
```
> [!NOTE]
Expand Down Expand Up @@ -62,7 +62,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
Once the annotation has been set, restart the application to create new Pods and inject the instrumentation libraries:

```bash
kubectl rollout restart deployment java-app -n java
kubectl rollout restart deployment java-app -n java-ns
```

4. Verify the [auto-instrumentation resources](./instrumenting-applications.md#how-auto-instrumentation-works) are injected in the Pod:
Expand All @@ -72,7 +72,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
- There should be an init container named `opentelemetry-auto-instrumentation-java` in the Pod:

```bash
$ kubectl describe pod java-app-8d84c47b8-8h5z2 -n java
$ kubectl describe pod java-app-8d84c47b8-8h5z2 -n java-ns
Name: java-app-8d84c47b8-8h5z2
Namespace: java-ns
...
Expand Down Expand Up @@ -101,7 +101,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-swhn5 (ro)
```

- The main container of the deployment is using the SDK as `javaagent`:
- The main container of the deployment is using the SDK as `javaagent`:

```bash
...
Expand All @@ -125,7 +125,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
/otel-auto-instrumentation-java from opentelemetry-auto-instrumentation-java (rw)
Containers:
java-app:
...
...
Mounts:
/otel-auto-instrumentation-java from opentelemetry-auto-instrumentation-java (rw)
...
Expand All @@ -142,7 +142,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
- Open **Observability** -> **Applications** -> **Service inventory**, and determine if:
- The application appears in the list of services.
- The application shows transactions and metrics.

- For application container logs, open **Kibana Discover** and filter for your Pods' logs. In the provided example, we could filter for them with either of the following:
- `k8s.deployment.name: "java-app"` (**adapt the query filter to your use case**)
- `k8s.pod.name: java-app*` (**adapt the query filter to your use case**)
Expand Down
12 changes: 5 additions & 7 deletions docs/kubernetes/operator/instrumenting-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ For this example, we assume the application you're instrumenting is a deployment

```bash
$ kubectl get instrumentation -n opentelemetry-operator-system
NAME AGE ENDPOINT
NAME AGE ENDPOINT
elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collector.opentelemetry-operator-system.svc.cluster.local:4318
```
> [!NOTE]
Expand Down Expand Up @@ -73,7 +73,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
Once the annotation has been set, restart the application to create new Pods and inject the instrumentation libraries:

```bash
kubectl rollout restart deployment python-app -n python
kubectl rollout restart deployment python-app -n python-ns
```

4. Verify the [auto-instrumentation resources](./instrumenting-applications.md#how-auto-instrumentation-works) are injected in the Pod:
Expand All @@ -83,7 +83,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
- There should be an init container named `opentelemetry-auto-instrumentation-python` in the Pod:

```bash
$ kubectl describe pod python-app-8d84c47b8-8h5z2 -n python
$ kubectl describe pod python-app-8d84c47b8-8h5z2 -n python-ns
...
...
Init Containers:
Expand Down Expand Up @@ -131,7 +131,7 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto
/otel-auto-instrumentation-python from opentelemetry-auto-instrumentation-python (rw)
Containers:
python-app:
...
...
Mounts:
/otel-auto-instrumentation-python from opentelemetry-auto-instrumentation-python (rw)
...
Expand All @@ -143,15 +143,13 @@ elastic-instrumentation 107s http://opentelemetry-kube-stack-daemon-collecto

Ensure the environment variable `OTEL_EXPORTER_OTLP_ENDPOINT` points to a valid endpoint and there's network communication between the Pod and the endpoint.

5. Confirm data is flowing through in **Kibana**:

5. Confirm data is flowing to **Kibana**:

- Open **Observability** -> **Applications** -> **Service inventory**, and determine if:
- The application appears in the list of services.
- The application shows transactions and metrics.
- If [python logs instrumentation](https://opentelemetry.io/docs/kubernetes/operator/automatic/#auto-instrumenting-python-logs) is enabled, the application logs should appear in the Logs tab.

- For application container logs, open **Kibana Discover** and filter for your Pods' logs. In the provided example, we could filter for them with either of the following:
- `k8s.deployment.name: "python-app"` (**adapt the query filter to your use case**)
- `k8s.pod.name: python-app*` (**adapt the query filter to your use case**)
Expand Down