GithubHelp home page GithubHelp logo

mnadeem / nodejs-opentelemetry-tempo Goto Github PK

View Code? Open in Web Editor NEW
163.0 4.0 29.0 1.42 MB

Project demonstrating Complete Observability Stack utilizing Prometheus, Loki (For distributed logging), Tempo (For Distributed tracing, this basically uses Jaeger Internally), Grafana for NodeJs based applications (With OpenTelemetry auto / manual Instrumentation) involving microservices with DB interactions.

Home Page: https://reachmnadeem.wordpress.com/2021/03/03/observability-for-nodejs-applications-using-opentelemetry/

JavaScript 74.76% Dockerfile 1.71% TSQL 2.91% Shell 20.62%

nodejs-opentelemetry-tempo's Introduction

Project Demonstrating Observability For NodeJs Applications

This is a project demonstrating Observability using :

And basically integrates the following

And basically it demonstrate the best practices for :

  • Demonstrate how to use Opentelemetry API
  • Logging : Using Log4js
  • ES6 : Using Babel
  • Metrics : Using Promclient
  • Seperating configuration
  • Containerization

Running

In Docker

docker-compose up --build

Access the endpoint

View the log and trace in Grafana

Get the trace information Using Jaeger

View the metrics in Prometheus

View prometheus metrics in Grafana

In Command prompt

Create .env file in root folder, refer this for more details on environment variables.

LOG_FILE_NAME=nodejs-opentelemetry-tempo.log
OTEL_SERVICE_NAME=nodejs-opentelemetry-tempo
OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14268/api/traces
DB_USER=sa
DB_PASS=P@ssw0rd
DB_SERVER=otmssql
DB_NAME=OtelTempo

Create Network

docker network create docker-tempo

Start tempo

ABSOLUTE_PATH_OF_PROJECT = E:\githubRepos\nodejs-opentelemetry-tempo

docker run -d --rm -p 6831:6831/udp -p 6832:6832/udp -p 9411:9411 -p 55680:55680 -p 3100:3100 -p 14250:14250 -p 14268:14268 --name tempo -v ${ABSOLUTE_PATH_OF_PROJECT}\etc\tempo-local.yaml:/etc/tempo.yaml --network docker-tempo  grafana/tempo:latest --config.file=/etc/tempo.yaml

Start tempo query

docker run -d --rm -p 16686:16686 --name tempo-query -v ${ABSOLUTE_PATH_OF_PROJECT}\etc\tempo-query.yaml:/etc/tempo-query.yaml  --network docker-tempo  grafana/tempo-query:latest  --grpc-storage-plugin.configuration-file=/etc/tempo-query.yaml

Start mssql

docker run  -p 1433:1433 -d -e ACCEPT_EULA=Y --name otmssql -e SA_PASSWORD=P@ssw0rd --network docker-tempo mcr.microsoft.com/mssql/server

Connect to mssql and create db OtelTempo and table as in .data\db\mssql\scripts

npm install
npm run dev

Access the endpoint

Get the trace information in Jaeger

Connecting To MSSQL DB

Lets connect to MSSQL DB running on container from Windows machine

Note : I have use heidisql, other option would be dbeaver

Also See

References

nodejs-opentelemetry-tempo's People

Contributors

krvajal avatar mnadeem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nodejs-opentelemetry-tempo's Issues

Tracing unclear documentation

Hi, sorry for the dumb question but in one side it says that Tempo is used for Distributed Tracing but them I am told to access jaeger for tracing. Is it the same? Also I can't see the service inside Jaeger which let me to think that Jaeger was used previously for tracing and now it was chance to Tempo but the docs were not updated.
image

Update opentelemetry?

Great demo project, are you thinking in updating all the opentelemetry libraries to the last versions?
It would also be cool to add the otel/opentelemetry-collector-contrib:latest to show the full flow

Logfmt

Hello,

Thank for you project. It is very helpful quickstarter!

I notice that logs created by NodeJS application is not properly parsed by promtail, so derrived fields is not work. What do you think about use of logfmt which is supported by logfmt? Loki support that format. Despite of structure it's easy to read.

Kind regards

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.