Giter VIP home page Giter VIP logo

kamon-jfr-playground's Introduction

JFR playground

A proof of concept of how to collect metrics using the JDK Flight Recorder event streaming(JEP 349) and Kamon telemetry to send them to Prometheus/Pinot

Prerequisites

Kamon + Prometheus + Grafana

# Prometheus + Grafana + Metrics dashboard
docker-compose -f docker/grafana-prometheus-compose.yml up

# Example service
sbt run

# Stress the service
k6 run k6/stress.js      

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

  execution: local
     script: k6/stress.js
     output: ...........

Then open the "JFR Metrics" dashboard in Grafana(localhost:3000) and Enjoy!

Bonus

Send profiling information(jdk.ObjectAllocationSample) to Pinot realtime table via Kafka and play with it ;)

# Kafka + Pinot
docker-compose -f pinot-kafka-compose.yml up

# Topic
docker exec -t kamon-jrf-playground_kafka  kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic jfr-allocation-topic

# Table Schema
curl -X POST "http://localhost:9000/schemas?override=true" -H "accept: application/json" -H "Content-Type: application/json" -d @jfr-allocation-schema.json

# Realtime Table configuration
curl -X POST "http://localhost:9000/tables" -H "accept: application/json" -H "Content-Type: application/json" -d @jfr-object-allocation-table.json

# Enable `jdk.ObjectAllocationSample` event in application.conf changing
"jdk.ObjectAllocationSample#enabled=false" to "jdk.ObjectAllocationSample#enabled=true" 

Then open the Pinot SQL Console(localhost:9000/#/query) and Enjoy!

Disclaimer

I have just scratched the surface of Pinot capabilities, and I'm sure there are other better ways of modeling than the one proposed, using other features and data types.

License

This code base is available ander the Apache License, version 2.

kamon-jfr-playground's People

Contributors

dpsoft avatar

Stargazers

 avatar  avatar  avatar

Watchers

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