Sentry + Opentelemetry Go Example
To run this example, you will need a kubernetes cluster. This example has been tried and tested on
- AWS Elastic Kuberetes Service and should work on any configured kubernetes environment.
K8S components used
- Config Map (otel-collector-conf) for opentelemetry collector
- Service to expose port 4317 of collector deployment (to recieve OTLP traces)
- Opentelemetry Collector
- Instrumented Golang application Deployment
- Create an
observabilitiynamespace in the cluster.
$ kubectl create ns observability
- Change the configmap in
k8s.yamland add your sentry DSN in line 31
sentry: dsn: <your sentry DSN here>
- Apply the kubernetes configuration in the observability namespace.
$ kubectl apply -f k8s.yaml -n observability
- Once the deployment is done, port forward the sample gin server to your localhost (ensure that your 8088 port is free from any pre-binding, i.e. no other server is using that)
$ kubectl port-forward -n observability svc/otlp-instrumentation-demo 8088:8088
Visit your localhost:8088/users/123