Skip to content

Example instrumentation of Golang Application with OpenTelemetry with supported configurations to export to Sentry.

Notifications You must be signed in to change notification settings

uds5501/sentry-opentelemetry-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentry + Opentelemetry Go Example

Requirements

To run this example, you will need a kubernetes cluster. This example has been tried and tested on

  • Minikube
  • 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)
  • Deployment
    • Opentelemetry Collector
    • Instrumented Golang application Deployment

Steps

  1. Create an observabilitiy namespace in the cluster.
$ kubectl create ns observability
  1. Change the configmap in k8s.yaml and add your sentry DSN in line 31
      sentry:
        dsn: <your sentry DSN here>
  1. Apply the kubernetes configuration in the observability namespace.
$ kubectl apply -f k8s.yaml -n observability
  1. 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
  1. Visit your localhost:8088/users/123

  2. Visit your Sentry UI to see something similar to this Sentry UI

About

Example instrumentation of Golang Application with OpenTelemetry with supported configurations to export to Sentry.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published