GithubHelp home page GithubHelp logo

aaron-ai / rocketmq-opentelemetry Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 52 KB

An example to integrate Apache RocketMQ with CNCF OpenTelemetry

Home Page: https://github.com/apache/rocketmq-clients

Java 100.00%

rocketmq-opentelemetry's Introduction

πŸš€ RocketMQ Γ— πŸ”­ OpenTelemetry Distributed Tracing

This repository provides a practical demonstration of how to leverage OpenTelemetry to achieve distributed tracing across RocketMQ 5.0 and other libraries like gRPC and Apache HTTP client.

Overview

OpenTelemetry is an open-source framework that provides a vendor-neutral API and instrumentation for distributed tracing, metrics, and logs. It enables observability and insight into complex distributed systems, allowing you to better understand how your systems are performing and identify potential issues.

This example shows how to use OpenTelemetry's automatic instrumentation approach, which involves using a Java agent to insert spans non-intrusively. By following this example, you can learn how to gain end-to-end visibility into your distributed system and improve your observability practices.

Prerequisites

Before using this library, you should have:

  • Java 8 or later installed.
  • The latest version of the OpenTelemetry Java agent.

You can download the Java agent from the here. The Java agent enables you to add instrumentation to your Java applications without modifying the source code.

Workflow

The entire system is divided into three processes. Process A acts as a gRPC client and sends an RPC request to process B, which acts as the gRPC server. While processing the gRPC request, process B sends a message to RocketMQ 5.0 server. Process C starts a RocketMQ 5.0 push consumer and, in the message listener for consuming the message, uses Apache HTTP client to send a GET request to https://taobao.com.

    Process A        Process B        Process C
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚gRPC Clientβ”œβ”€β”€β”€β”€β–ΊgRPC Serverβ”‚   β”‚ HTTP Client β”‚
  β””β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”˜
        β”‚                β”‚                β”‚
        β”‚          β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
        β”‚          β”‚  RocketMQ β”œβ”€β”€β”€β–Ί   RocketMQ  β”œβ”€β”€β”€β–Ί Downstream
  Upstream Span    β”‚  Producer β”‚   β”‚ PushConsumerβ”‚        Span
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Specifically, the gRPC client sends a request within the scope of an upstream business span, while the RocketMQ push consumer also records a span for subsequent business logic after sending an HTTP request.

License

Apache License, Version 2.0 Copyright (C) Apache Software Foundation

rocketmq-opentelemetry's People

Contributors

aaron-ai avatar

Stargazers

Zhongmin avatar zxm avatar  avatar ζŽδΌŸι“­ avatar

Watchers

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