Skip to content

Trace & Log Correlation with Opentelemetry-Go. Local Development for Kubernetes Environment with Skaffold Example

Notifications You must be signed in to change notification settings

muhammedsaidkaya/trace-log-correlation-with-opentelemetry-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trace-Log-Correlation with Opentelemetry

Used Technologies

Usage

Installation

# Installation just for one time.
./scripts/install.sh
  • This script installs all requirements for local development: Homebrew, Kubectl, Minikube, and Skaffold.
  • Creates a minikube Kubernetes cluster on your local environment.

Local Development

./scripts/run.sh
  • This script builds and deploy your applications to the Minikube Kubernetes Cluster and for hot reloading skaffold is used. Whenever you change any code block your application will rebuild again and deploy.
  • You can verify everything is working properly or not by comparing kubectl get deploy command's result with the following screenshoot.

kubectl.png

Usecase Example

curl http://localhost:9001/albums/1
# Go to the http://localhost:16686/ for accessing Jaeger UI.

Flow Diagram

  • Service2 - /albums/:id - endpoint
    • OtelGin Middleware for Context Propagation (HTTP Headers Import & Export)
    • Http Client Request
      • Service1 - /albums - endpoint
        • OtelGin Middleware for Context Propagation (HTTP Headers Import & Export)
        • Returns All Albums which is kept in-memory.
    • Filters Albums By Id
    • Returns a specific Album.

Logs

Service1 | Service2

  • You can see the trace and span ids are logged.

img.png

Traces (Jaeger)

  • You can see the trace and span ids on Jaeger.

img_1.png img_2.png img_3.png

Resources

About

Trace & Log Correlation with Opentelemetry-Go. Local Development for Kubernetes Environment with Skaffold Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published