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

fix documentation to annotate the OpenTelemetryCollector #58

Merged
merged 1 commit into from
Nov 30, 2023
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
48 changes: 25 additions & 23 deletions recipes/beyla/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,31 @@ app, or the Collector endpoint needs to be updated to point to the correct servi

## Running

### Deploying the Recipe

Apply the `OpenTelemetryCollector` object from this recipe:

```
kubectl apply -f collector-config.yaml
```

(This will overwrite any existing collector config, or create a new one if none exists.)

Once the Collector restarts, apply the Beyla Daemonset:

```
kubectl apply -f beyla-daemonset.yaml
```

This will begin creating metrics and traces for all http traffic on each node,
and exporting them to Google Cloud.

### Workload Identity Setup

If you have Workload Identity enabled, you'll need to set up a service account with permission to
write traces to Cloud Trace. You can do this with the following commands:
If you have Workload Identity enabled, you'll see permissions errors after deploying the recipe.
You need to set up a GCP service account with permission to write traces to Cloud Trace, and allow
the Collector's Kubernetes service account to act as your GCP service account. You can do this with
the following commands:

```
export GCLOUD_PROJECT=<your GCP project ID>
Expand Down Expand Up @@ -80,33 +101,14 @@ gcloud iam service-accounts add-iam-policy-binding "otel-collector@${GCLOUD_PROJ
**(Optional):** If you don't already have a ServiceAccount for the Collector (such as the one provided
when deploying a prior OpenTelemetryCollector object), create it with `kubectl create serviceaccount otel-collector`.

Finally, annotate the Collector's ServiceAccount to use Workload Identity:
Finally, annotate the OpenTelemetryCollector Object to allow the Collector's ServiceAccount to use Workload Identity:

```
kubectl annotate serviceaccount otel-collector \
kubectl annotate opentelemetrycollector otel \
--namespace $COLLECTOR_NAMESPACE \
iam.gke.io/gcp-service-account=otel-collector@${GCLOUD_PROJECT}.iam.gserviceaccount.com
```

### Deploying the Recipe

Apply the `OpenTelemetryCollector` object from this recipe:

```
kubectl apply -f collector-config.yaml
```

(This will overwrite any existing collector config, or create a new one if none exists.)

Once the Collector restarts, apply the Beyla Daemonset:

```
kubectl apply -f beyla-daemonset.yaml
```

This will begin creating metrics and traces for all http traffic on each node,
and exporting them to Google Cloud.

## View your Spans and Metrics

Navigate to the Trace explorer and view the traces created by Beyla.
Expand Down
33 changes: 17 additions & 16 deletions recipes/cloud-trace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,23 @@ app, or the Collector endpoint needs to be updated to point to the correct servi

## Running

### Deploying the Recipe

Apply the `OpenTelemetryCollector` object from this recipe:

```
kubectl apply -f collector-config.yaml
```

(This will overwrite any existing collector config, or create a new one if none exists.)

Once the Collector restarts, you should see traces from your application

### Workload Identity Setup

If you have Workload Identity enabled (on by default in GKE Autopilot), you'll need to set
up a service account with permission to write traces to Cloud Trace. You can do this with
If you have Workload Identity enabled, you'll see permissions errors after deploying the recipe.
You need to set up a GCP service account with permission to write traces to Cloud Trace, and allow
the Collector's Kubernetes service account to act as your GCP service account. You can do this with
the following commands:

```
Expand Down Expand Up @@ -65,26 +78,14 @@ gcloud iam service-accounts add-iam-policy-binding "otel-collector@${GCLOUD_PROJ
**(Optional):** If you don't already have a ServiceAccount for the Collector (such as the one provided
when deploying a prior OpenTelemetryCollector object), create it with `kubectl create serviceaccount otel-collector`.

Finally, annotate the Collector's ServiceAccount to use Workload Identity:
Finally, annotate the OpenTelemetryCollector Object to allow the Collector's ServiceAccount to use Workload Identity:

```
kubectl annotate serviceaccount otel-collector \
kubectl annotate opentelemetrycollector otel \
--namespace $COLLECTOR_NAMESPACE \
iam.gke.io/gcp-service-account=otel-collector@${GCLOUD_PROJECT}.iam.gserviceaccount.com
```

### Deploying the Recipe

Apply the `OpenTelemetryCollector` object from this recipe:

```
kubectl apply -f collector-config.yaml
```

(This will overwrite any existing collector config, or create a new one if none exists.)

Once the Collector restarts, you should see traces from your application

## View your Spans

Navigate to https://console.cloud.google.com/traces/list, and click on one of
Expand Down
35 changes: 18 additions & 17 deletions recipes/daemonset-and-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,24 @@ app, or the Collector endpoint needs to be updated to point to the correct servi

## Running

### Deploying the Recipe

Apply the `OpenTelemetryCollector` objects from this recipe:

```
kubectl apply -f daemonset-collector-config.yaml
kubectl apply -f deployment-collector-config.yaml
```

(This will overwrite any existing collector config, or create a new one if none exists.)

Once the Collector restarts, you should see traces from your application

### Workload Identity Setup

If you have Workload Identity enabled (on by default in GKE Autopilot), you'll need to set
up a service account with permission to write traces to Cloud Trace. You can do this with
If you have Workload Identity enabled, you'll see permissions errors after deploying the recipe.
You need to set up a GCP service account with permission to write traces to Cloud Trace, and allow
the Collector's Kubernetes service account to act as your GCP service account. You can do this with
the following commands:

```
Expand Down Expand Up @@ -92,27 +106,14 @@ gcloud iam service-accounts add-iam-policy-binding "otel-collector@${GCLOUD_PROJ
**(Optional):** If you don't already have a ServiceAccount for the Collector (such as the one provided
when deploying a prior OpenTelemetryCollector object), create it with `kubectl create serviceaccount otel-collector`.

Finally, annotate the Collector's ServiceAccount to use Workload Identity:
Finally, annotate the OpenTelemetryCollector Object to allow the Collector's ServiceAccount to use Workload Identity:

```
kubectl annotate serviceaccount otel-collector \
kubectl annotate opentelemetrycollector otel \
--namespace $COLLECTOR_NAMESPACE \
iam.gke.io/gcp-service-account=otel-collector@${GCLOUD_PROJECT}.iam.gserviceaccount.com
```

### Deploying the Recipe

Apply the `OpenTelemetryCollector` objects from this recipe:

```
kubectl apply -f daemonset-collector-config.yaml
kubectl apply -f deployment-collector-config.yaml
```

(This will overwrite any existing collector config, or create a new one if none exists.)

Once the Collector restarts, you should see traces from your application

## View your Spans

Navigate to https://console.cloud.google.com/traces/list, and click on one of
Expand Down
Loading