Skip to content

Commit

Permalink
backend4: switch default port
Browse files Browse the repository at this point in the history
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
  • Loading branch information
frzifus committed Mar 11, 2024
1 parent 9eebe2b commit d5d4211
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
35 changes: 34 additions & 1 deletion 04-manual-instrumentation.md
Expand Up @@ -71,13 +71,46 @@ func causeDelay(ctx context.Context, rate int) {
## Configuring an OTLP exporter and setting the endpoint

```bash
ocker run --rm -it -p 127.0.0.1:4317:4317 -p 127.0.0.1:16686:16686 -e COLLECTOR_OTLP_ENABLED=true -e LOG_LEVEL=debug jaegertracing/all-in-one:latest
docker run --rm -it -p 127.0.0.1:4317:4317 -p 127.0.0.1:16686:16686 -e COLLECTOR_OTLP_ENABLED=true -e LOG_LEVEL=debug jaegertracing/all-in-one:latest
```

```bash
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 OTEL_SERVICE_NAME=go-backend go run app/backend4/main.go
```

## TODO: Publish container at ghcr.io/pavolloffay

Apply `backend2` drop-in replacement:
```bash
kubectl apply -f https://raw.githubusercontent.com/pavolloffay/kubecon-eu-2024-opentelemetry-kubernetes-tracing-tutorial/main/backend/04-backend.yaml
```

Details

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend2-deployment
namespace: tutorial-application
labels:
app: backend2
spec:
template:
metadata:
labels:
app: backend2
annotations:
prometheus.io/scrape: "true"
+ instrumentation.opentelemetry.io/inject-sdk: "true"
template:
spec:
containers:
- name: backend2
- image: ghcr.io/pavolloffay/kubecon-eu-2024-opentelemetry-kubernetes-tracing-tutorial-backend2:latest
+ image: ghcr.io/frzifus/kubecon-eu-2024-opentelemetry-kubernetes-tracing-tutorial-backend4:latest
```

---

[Next steps](./05-sampling.md)
2 changes: 1 addition & 1 deletion app/backend4/main.go
Expand Up @@ -100,7 +100,7 @@ func main() {
})
mux.HandleFunc("GET /metrics", promhttp.Handler().ServeHTTP)
srv := &http.Server{
Addr: "0.0.0.0:8080",
Addr: "0.0.0.0:5165",
Handler: mux,
}

Expand Down

0 comments on commit d5d4211

Please sign in to comment.