Skip to content

maurocanuto/distributed-tracing-opencensus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCensus - A stats collection and distributed tracing framework

OpenCensus is a toolkit for collecting application performance and behavior data. Opencensus is a single distribution of libraries that automatically collects traces and metrics from your app, displays them locally, and sends them to any analysis tool.

Although OpenCensus records stats or traces, in this example we will only export traces and propagate context between 2 services.

Exporter

Opencensus includes exporters for storage and analysis tools. Right now the list includes Zipkin, Prometheus, Jaeger, Stackdriver, and SignalFx. In this example will use the Jaeger exporter using the all-in-one docker image.

THE EXAMPLE

In this example we are running 2 services:

  • hello-service
  • greetings-service

Hello service This service will run on port 8888 and exposes the enpoint /hello. This endpoint returns the String "Hello from Service"

Greetings service This service will run on port 8080 and exposes the enpoint /greetings/hello. When calling this endpoint, this service calls the hello-service and returns the String received in the response.

Example

When a request is process, traces are sent to Jaeger tool where you will get a detailed view of the operation. You can access at http://localhost:16686/

Build/run the example

Example can be run with docker-compose. Build:

docker-compose build

Run:

docker-compose up

Call endpoint: http://localhost:8080/greetings/hello

About

Distributed tracing example with Opencensus and Jaeger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages