GithubHelp home page GithubHelp logo

nguyenhieu8790 / grafana-tempo-loki-tracing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ruanbekker/grafana-tempo-loki-tracing

0.0 0.0 0.0 17 KB

Grafana Distributed Tracing Example with: Tempo, Prometheus, Loki, Grafana and Python Flask

Home Page: https://ruan.dev

Python 93.33% Dockerfile 6.67%

grafana-tempo-loki-tracing's Introduction

grafana-tempo-loki-tracing

Grafana Distributed Tracing Example with: Tempo, Prometheus, Loki, Grafana and Python Flask

image

Getting Started

Boot the stack:

docker compose up --build -d || docker-compose up -d

The datasources will be auto-configured defined in configs/grafana/datasources.yaml.

Example Requests

Requests:

$ curl http://localhost:5002/process_payment
Payment processed 

$ curl http://localhost:5001/create_order
Order created with id 1 

$ curl http://localhost:5001/list_payments
Payments listed 

Logs:

order-service  | [2023-11-30 05:33:07,334] INFO in app: Trace ID: 1660e64b3807719aa4898445766895b8
order-service  | 172.18.0.1 - - [30/Nov/2023 05:33:07] "GET /create_order HTTP/1.1" 200 -
payment-service  | [2023-11-30 05:33:18,883] INFO in app: Trace ID: 335c0cd1cd947c3de92b7cc9a06386e9
payment-service  | 172.18.0.1 - - [30/Nov/2023 05:33:18] "GET /process_payment HTTP/1.1" 200 -

Screenshots

Explore traces:

image

Query:

image

Node Graph:

image

When we use the payment-service container logs in Loki:

image

Extras

With span.set_attribute we can enrich some of the visuals:

        with tracer.start_as_current_span("database_operation") as span:
            sql_query = "INSERT INTO order (description) VALUES ('New Order')"
            span.set_attribute("db.statement", sql_query)  # Add SQL query to span

Produces:

image

grafana-tempo-loki-tracing's People

Contributors

ruanbekker 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.