Coder Social home page Coder Social logo

jalajk24 / opentelemetry-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timescale/opentelemetry-demo

0.0 0.0 0.0 1.33 MB

A demo system for exploring the tracing features of Promscale

License: Apache License 2.0

Shell 1.69% Ruby 8.27% Python 83.80% Dockerfile 6.24%

opentelemetry-demo's Introduction

OpenTelemetry Demo

Summary

This repo contains a environment for demonstrating OpenTelemetry tracing support in Promscale.

Workshop

This repo is used to deliver workshops on OpenTelemetry Traces and SQL. If you are here to explore the workshop, head to this page.

The Password Generator Service

A password generator service is instrumented with OpenTelemetry tracing. This is an absurd service and should not be taken as a shining example of architecture nor coding. It exists as a playground example to generate traces. The lower service generates random lowercase letters. The upper service service generates random uppercase letters. The digit service generates random digits, and the special service generates random special characters. There is a generator service which makes calls to the other services to compose a random password. Finally, there is a load script which continuously calls the generator service in order to simulate user load.

The lower service is a Ruby app using Sinatra framework while the other services use Python with Flask.

There are two versions of the services. Those under the instrumented directory have explicit instrumentation for tracing, whereas the versions under the uninstrumented directory solely use auto-instrumentation.

The Observability Infrastructure

All of the microservices forward their traces to an instance of the OpenTelemetry Collector. The collector sends the traces on to an instance of the Promscale Collector which stores them in a TimescaleDB database. An instance of the Jaeger UI is pointed to the Promscale instance, and an instance of Grafana is pointed at both Jaeger and the TimescaleDB database. In this way, you can use SQL to query the traces directly in the database, and visualize tracing data in Jaeger and Grafana dashboards.

Running the System in Docker

When the system runs in docker it is configured via the docker compose file, and is operated with docker-compose. Run the following command from the root of the repo to (re)start the system.

docker-compose up --remove-orphans --build --detach

Once running, the following links will let you explore the various components of the system:

When you are ready to shutdown the system, use the following command.

docker-compose down

Running the System in Kubernetes

When you want to run the system in k8s you can use the following commands (if you have certmanager installed skip that step):

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.0/cert-manager.yaml
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml
kubectl apply -k ./yaml

You should wait for the OpenTelemetry Operator pod to come up before you run the second command.

You should see data flowing into Grafana automatically.

To access individual services as per the Docker instructions below you will need to run

sh ./yaml/port-forward.sh

Connecting to TimescaleDB

You can use any SQL client that supports PostgreSQL to connect to the TimescaleDB database. The database is not password protected.

Use the psql client to connect to the Timescaledb instance via:

psql -h localhost -p 5999 -d otel_demo -U postgres

Examples

Note: the default Grafana login credentials are user "admin" and password "admin". Once you log in for the first time you will be asked to update your password.

Request Rates

Grafana Dashboard

Queries

Error Rates

Grafana Dashboard

Queries

Request Durations

Grafana Dashboard

Queries

Service Dependencies

Grafana Dashboard

Queries

Upstream Spans

Grafana Dashboard

Queries

Downstream Spans

Grafana Dashboard

Queries

opentelemetry-demo's People

Contributors

jgpruitt avatar jamessewell avatar jonatas avatar ramonguiu avatar inselbuch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.