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

Update OpenTelemetry Collector #7053

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
43 changes: 12 additions & 31 deletions examples/features/jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
NSM supports tracing via the [OpenTelemetry](https://opentelemetry.io/) Collector. Each NSM component is a "tracer" (OpenTelemetry
Span producer) and integrates with the `opentelemetry-go` library to export traces to OpenTelemery Collector.

By default, tracing is disabled in all NSM components. You can enable tracing for a specific NSM component by adding the environment variable `TELEMETRY`
with the value `true`. It can be done with a patch for this NSM component. For example, the following code is the patch for NSM forwarder:
By default, tracing is disabled in all NSM components. You can enable tracing for a specific NSM component by adding the environment variable `NSM_LOG_LEVEL`
with the value `TRACE`. It can be done with a patch for this NSM component. For example, the following code is the patch for NSM forwarder:
```yaml
---
apiVersion: apps/v1
Expand All @@ -18,8 +18,8 @@ spec:
containers:
- name: forwarder-vpp
env:
- name: TELEMETRY
value: "true"
- name: NSM_LOG_LEVEL
value: TRACE
```

You can configure OpenTelemetry Collector to send traces to Jaeger. To do it you should specify Jaeger service in OpenTelemetry Config:
Expand Down Expand Up @@ -65,7 +65,11 @@ e.g. the following forwards `http://localhost:16686` to the Jaeger UI:
kubectl port-forward svc/simplest-query -n observability 16686:16686
```

## How to use
## Requires

- [spire](../../spire)

## Run

Create namespace observability:
```bash
Expand All @@ -82,7 +86,7 @@ Wait for Jaeger Operator pod status ready:
kubectl wait -n observability --timeout=1m --for=condition=ready pod -l name=jaeger-operator
```

Apply Jaeger pod:
Apply Jaeger and OpenTelemetry Collector:
```bash
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/jaeger/jaeger?ref=3d1dcfe1de90681213c7f0006f25279bb4699966
```
Expand All @@ -92,27 +96,10 @@ Wait for Jaeger pod status ready:
kubectl wait -n observability --timeout=1m --for=condition=ready pod -l app=jaeger
```

Apply OpenTelemetry pod:
```bash
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/features/jaeger/opentelemetry?ref=3d1dcfe1de90681213c7f0006f25279bb4699966
```

Apply Spire deployments (required for NSM system)
```bash
kubectl apply -k https://github.com/networkservicemesh/deployments-k8s/examples/spire?ref=3d1dcfe1de90681213c7f0006f25279bb4699966
```

Wait for Spire pods status ready:
```bash
kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent
```
```bash
kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server
```

Create namespace nsm-system:
Wait for Opentelemetry pods status ready:
```bash
kubectl create ns nsm-system
kubectl wait -n observability --timeout=1m --for=condition=ready pod -l app=opentelemetry
```

Apply NSM resources:
Expand Down Expand Up @@ -150,9 +137,3 @@ Delete observability namespace:
```bash
kubectl delete ns observability
```

Delete Spire:
```bash
kubectl delete crd spiffeids.spiffeid.spiffe.io
kubectl delete ns spire
```
8 changes: 8 additions & 0 deletions examples/features/jaeger/jaeger/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: observability

resources:
- jaeger.yaml
9 changes: 9 additions & 0 deletions examples/features/jaeger/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: observability

bases:
- jaeger
- opentelemetry
13 changes: 13 additions & 0 deletions examples/features/jaeger/nsm-system/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: nsm-system
resources:
- namespace.yaml
bases:
- https://github.com/networkservicemesh/deployments-k8s/examples/memory?ref=6cb851e2075646d8476d01f4f881a9a27b80f507

patchesStrategicMerge:
- patch-nsmgr.yaml
- patch-forwarder.yaml
5 changes: 5 additions & 0 deletions examples/features/jaeger/nsm-system/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: nsm-system
4 changes: 2 additions & 2 deletions examples/features/jaeger/nsm-system/patch-forwarder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ spec:
containers:
- name: forwarder-vpp
env:
- name: TELEMETRY
value: "true"
- name: NSM_LOG_LEVEL
value: TRACE
4 changes: 2 additions & 2 deletions examples/features/jaeger/nsm-system/patch-nsmgr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ spec:
containers:
- name: nsmgr
env:
- name: TELEMETRY
value: "true"
- name: NSM_LOG_LEVEL
value: TRACE
8 changes: 8 additions & 0 deletions examples/features/jaeger/opentelemetry/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: observability

resources:
- otel-collector.yaml
5 changes: 3 additions & 2 deletions examples/features/jaeger/opentelemetry/otel-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ data:
exporters:
jaeger:
endpoint: "simplest-collector.observability.svc.cluster.local:14250"
insecure: true
tls:
insecure: true
logging:
service:
extensions: [health_check]
Expand Down Expand Up @@ -81,7 +82,7 @@ spec:
- command:
- "/otelcol"
- "--config=/conf/otel-collector-config.yaml"
image: otel/opentelemetry-collector:0.35.0
image: otel/opentelemetry-collector:0.56.0
name: otel-collector
ports:
- containerPort: 14250 # Default endpoint for Jaeger gRPC receiver.
Expand Down
6 changes: 3 additions & 3 deletions examples/observability/jaeger-and-prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
EOF
```

Create NSE patch. The patch adds `TELEMETRY` variable with value `true`. It enables telemetry for NSE. This example also has patches for manager and forwarder.
Create NSE patch. The patch adds `NSM_LOG_LEVEL` variable with value `TRACE`. It enables telemetry for NSE. This example also has patches for manager and forwarder.
```bash
cat > example/patch-nse.yaml <<EOF
---
Expand All @@ -104,8 +104,8 @@ spec:
env:
- name: NSM_CIDR_PREFIX
value: 172.16.1.100/31
- name: TELEMETRY
value: "true"
- name: NSM_LOG_LEVEL
value: TRACE
nodeName: ${NODE}
EOF
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ kind: Kustomization

namespace: nsm-system

resources:
- namespace.yaml

bases:
- ../../../memory
- https://github.com/networkservicemesh/deployments-k8s/examples/memory?ref=6cb851e2075646d8476d01f4f881a9a27b80f507

patchesStrategicMerge:
- patch-nsmgr.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ spec:
containers:
- name: forwarder-vpp
env:
- name: TELEMETRY
value: "true"
- name: NSM_LOG_LEVEL
value: TRACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ spec:
containers:
- name: nsmgr
env:
- name: TELEMETRY
value: "true"
- name: NSM_LOG_LEVEL
value: TRACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ data:
health_check: {}
exporters:
jaeger:
endpoint: "jaeger:14250"
insecure: true
endpoint: jaeger:14250
tls:
insecure: true
prometheus:
endpoint: "0.0.0.0:8889"
service:
Expand Down Expand Up @@ -82,7 +83,7 @@ spec:
- command:
- "/otelcol"
- "--config=/conf/otel-collector-config.yaml"
image: otel/opentelemetry-collector:0.35.0
image: otel/opentelemetry-collector:0.56.0
name: otel-collector
ports:
- containerPort: 14250 # Default endpoint for Jaeger gRPC receiver.
Expand Down
2 changes: 1 addition & 1 deletion external-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ images:
- docker.io/travelping/nettools:1.10.1
- k8s.gcr.io/e2e-test-images/jessie-dnsutils:1.3
- jaegertracing/all-in-one:1.36
- otel/opentelemetry-collector:0.35.0
- otel/opentelemetry-collector:0.56.0
- prom/prometheus:v2.37.0
- networkstatic/iperf3:latest