• Stars
    star
    107
  • Rank 323,587 (Top 7 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terminal UI observability and diagnostic tool for Scala applications

panopticon-tui

CI crates.io

Terminal UI observability and diagnostic tool for Scala applications.

Currently supports:

Usage

Prerequisites

You'll need to have java installed (it is loaded dynamically by jmx crate).

Example

There's a complete example of adjusting a real project to work with panopticon. Check it out to see how it's done.

Running Panopticon

To get a binary for your OS check releases page.

Panopticon is published to crates.id, so if you have rust toolchain installed, you can run cargo install panopticon-tui and it will build the executable for you.

You can also build it from sources:

cargo build
./target/debug/panopticon-tui [OPTIONS]

To get a detailed help message, run:

panopticon-tui --help

⚠️ MacOS and libjvm.dylib

On MacOS you can face an error like this:

dyld: Library not loaded: @rpath/libjvm.dylib
  Referenced from: panopticon-tui
  Reason: image not found

It means that j4rs, which is used for JMX integration wasn't able to locate your java installation.

To fix that, just create a symlink to libjvm.dylib (this works for JDK 11 and MacOS 10.15.4):

sudo ln -s $(/usr/libexec/java_home)/lib/server/libjvm.dylib /usr/local/lib

Depending on your MacOS version or java package, location may differ, so make sure to check the symlink is valid.

Connecting to zio-zmx server

ZIO-ZMX is a tool for monitoring ZIO-based apps. With panopticon you can see the fiber tree visualized and monitor their number:

ZIO tab demo

You can specify zio-zmx server address with --zio-zmx option. In this case Panopticon will connect to it and show a ZMX tab:

panopticon-tui --zio-zmx localhost:6789

⚠️ WARNING: Currently, zio-zmx doesn't provide efficient ways of getting fiber count metrics, so Panopticon has to do a full fiber dump each tick to calculate them. Make sure your tick-rate isn't too frequent.

Database metrics over JMX

Panopticon can show database metrics, if your app exposes them via JMX. Slick and HikariCP are the only supported options at the moment.

Slick tab demo

Slick tab will be shown in Panopticon if you specify these two options:

panopticon-tui --jmx localhost:9010 --db-pool-name myDb

Here db-pool-name is a connection pool name, used to qualify JMX beans for Slick and/or HikariCP.

See this section of Slick docs for details about setting up your app to expose db metrics over JMX.

Also keep in mind that you need to specify some JVM parameters on startup so that your app exposes JMX metrics. Something along the following lines:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.rmi.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

Akka metrics

Panopticon can also do several valuable things for akka-based systems:

  • show entire tree of actors under some actor system;
  • monitor total amount of actors in real-time;
  • show latest messages that went to "dead-letters" queue with details;
  • monitor total amount of dead letters in real-time.

Akka tab demo

To use these features, however, you'd have to enable publication of this data in your application. There's the akka-periscope library, specifically suited for that purpose. Checkout it's README for the details on how you can set it up.

Only HTTP way of transfer is supported for at the moment. To use it and see the actor data on a separate tab, launch Panopticon with following options:

panopticon-tui --actor-tree http://localhost:8080/actor-tree --actor-system-status http://localhost:8080/actor-system-status --dead-letters http://localhost:8080/dead-letters

Replace the endpoint urls with the ones you set up with akka-periscope.

Build from sources

Development build:

cargo build

Optimized release build:

cargo build --release

Developed by Scalac

More Repositories

1

Aspect-Based-Sentiment-Analysis

💭 Aspect-Based-Sentiment-Analysis: Transformer & Explainable ML (TensorFlow)
Python
520
star
2

reactive-rabbit

Reactive Streams driver for AMQP protocol. Powered by RabbitMQ library.
Scala
184
star
3

zio-scala2-quickstart.g8

A Giter8 template for a fully functional, ready to deploy ZIO-based microservice.
Scala
91
star
4

websocket-akka-http

Websocket Client/Server with akka-http
Scala
74
star
5

mesmer

OpenTelemetry agent for Scala applications
Scala
71
star
6

akka-persistence-eventsourcing

Example project with a simple REST API to a domain model persisted using akka-persistence with eventsourcing.
Scala
48
star
7

zio-slick-interop

Slick interop for ZIO
Scala
37
star
8

scala-slack-bot-core

Akka based library for writing Slack bots in Scala.
Scala
33
star
9

zio-kafka-showcase

Example project that demonstrates how to build Kafka based microservices with Scala and ZIO
Scala
31
star
10

zio-scala3-quickstart.g8

A Giter8 template for a fully functional, ready to deploy ZIO-based microservice in Scala 3.
Scala
28
star
11

zio-akka-http-interop

akka-http interop for ZIO
Scala
28
star
12

docker-postgres-cluster

Shell
27
star
13

scala-slack-bot

Scala
22
star
14

zio-dotty-quickstart.g8

A Giter8 template for a basic Dotty application build using ZIO
Scala
17
star
15

akka-periscope

Akka plugin to collect various data about actors
Scala
17
star
16

spark-kafka-avro

POC: Spark consumer for bottledwater-pg Kafka Avro topics
Scala
17
star
17

lagom-scala-post-example

Scala
11
star
18

wsug-akka-websockets

source code for Warsaw Scala Enthusiasts group meeting
Scala
8
star
19

akka-message-visualization

Proof of concept of a visualization of message flow within an Akka system
JavaScript
8
star
20

monix-blog-examples

Scala
7
star
21

akka-streams-graph-stage

Scala
7
star
22

rough-slick

Scala
6
star
23

Tezos-FullStack-Console-backend

Scala
4
star
24

scala-spark-ml

Machine learning using Spark and Scala
Scala
4
star
25

WhoSaidThat

Demo for Spark 101 post
Scala
3
star
26

Tezos-Micheline-Michelson-Translator-Frontend

TypeScript
3
star
27

akka-http-s3-upload

Experiments on different ways of uploading files to S3 using combinations of Akka HTTP directives, AWS SDK and Alpakka.
Scala
3
star
28

json-tools

Tools for JSON handling
Scala
3
star
29

macro-fun

Code accompanying the macro post, including polynomial differentiation.
Scala
3
star
30

vhs-data-analysis

Scala
2
star
31

zio-introduction

ZIO introduction workshop
Scala
2
star
32

ScalaWave2017ScalaBasic

JavaScript
2
star
33

panopticon-example

A sample Scala app, fully equipped to be monitored with https://github.com/ScalaConsultants/panopticon-tui
Scala
2
star
34

recru-app

Awesome recruitment app for the IT folks
JavaScript
2
star
35

newspaper

Scala
1
star
36

scala2-introduction

Scala 2 introduction workshop exercises
Scala
1
star
37

warsjawa-2014

Mobile app for the conference
Java
1
star
38

galaxy-gear2-tutorial

Galaxy Gear2 basics tutorial
Java
1
star
39

devoxx-android

Java
1
star
40

docker-java8

1
star
41

scalagram

Instagram's clone to share memes about Scala world
Scala
1
star
42

endpoints4s-vs-tapir-blog-examples

1
star
43

zionomicon

Scala
1
star
44

whisky-tango-foxtrot

Scala
1
star
45

reactive-slick

Scala
1
star