GithubHelp home page GithubHelp logo

apm4me's Introduction

APM4ME

Never use this in production

APM 4 me is an experiment on how APM works in JAVA. In this project I'm looking for understand how bytecode instrumentation works and how this is interpreted in the JVM.

I started with a small project to understand how to load an APM into a java application and discover all the steps involved in linking and instrumentation.

I then went on to learn how to export metrics into a java application. I'm not quite finished yet

In parallel, I made a few attempts to instrument a java class with ByteBuddy and learned about all the concepts that exist around instrumentation via bytecode. I've managed to export traces of method calls in an application, and to re-transform the classloader and classes to integrate the opentelemetry SDK into the application in which the APM is linked.

This is not the first project I've done on APMs and JVM Internal. It follows on from my first discoveries here: https://github.com/allemas/thread-park/blob/master/DISCOVERED.md

Concepts learned

  • premain / agentmain : OK
  • Understand bytebuddy and how it's works: OK
  • Export basic metrics from the JVM : src/main/java/org/apm4me/instrumentation/JMXMetricsUtils.java
  • Linking OTEL SDK by retransformation instrumentation : OK
  • Create native tracing context and trace all method called in the application : Actually not really done, method calling is traced correctly, but not in a tracing context. without specific class instrumentation maybe not possible
  • Export flamegraph on a port : not totally adone
    • this should come with concept and explanations
  • Instrumentation example: log appender to quickwit : not started

QuickWit println interceptor !

❯ docker run --rm --platform linux/amd64 -v $(pwd)/qwdata:/quickwit/qwdata -p 127.0.0.1:7280:7280 quickwit/quickwit run ❯ curl -XPOST http://127.0.0.1:7280/api/v1/indexes --header "content-type: application/yaml" --data-binary @<>/apm4me/quickwit-index.yaml ❯ curl "http://127.0.0.1:7280/api/v1/stackoverflow/search?query=*" ❯ java -javaagent:/Users/sebastienallemand/Documents/apm4me/target/apm-1.0-SNAPSHOT-jar-with-dependencies.jar -jar ./target/emptyProject-1.0-SNAPSHOT.jar

Interesting to read

apm4me's People

Watchers

Allemand Sébastien 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.