September 13th, 2024

Show HN: FlowTracker – Track data flowing through Java programs

FlowTracker is a Java agent that monitors data flow in applications, connecting inputs and outputs. It modifies bytecode at runtime but is a proof of concept with performance limitations.

Read original articleLink Icon
ExcitementAdmirationCuriosity
Show HN: FlowTracker – Track data flowing through Java programs

FlowTracker is a Java agent designed to monitor data flow within Java applications, providing insights into how data is read, manipulated, and written. Its primary function is to connect inputs and outputs, helping users trace the origins of output data. A demonstration of FlowTracker can be seen using the Spring PetClinic application, where it tracks HTTP requests and the generation of HTML pages based on templates and database interactions. Currently, FlowTracker is a proof of concept and may not be suitable for production due to potential performance overhead. Users can utilize FlowTracker by downloading the agent JAR and adding it to the Java command line with specific JVM options. The agent operates by modifying bytecode at runtime to maintain a mapping of in-memory data to its source, employing method interception and dataflow analysis to track local variables and method arguments. Key components include the Tracker, which holds information about tracked objects, and the TrackerRepository, a global map linking objects to their trackers. However, FlowTracker has limitations, as it does not track all values due to performance concerns and primarily focuses on textual and binary data, with limited support for numerical values. The GitHub repository provides detailed documentation on usage and implementation.

- FlowTracker tracks data flow in Java programs, connecting inputs and outputs.

- It can be demonstrated using the Spring PetClinic application.

- The agent modifies bytecode at runtime to track data origins.

- It is currently a proof of concept and may not be suitable for production.

- Limitations include a focus on textual and binary data, with some performance constraints.

Related

Show HN: ControlFlow – open-source AI workflows

Show HN: ControlFlow – open-source AI workflows

ControlFlow is a Python framework for agentic AI workflows. The GitHub repository offers installation guidelines, examples, features, and development instructions. Users can find detailed guidance and support for building AI workflows.

Show HN: TraceLens Visualizing Distributed Systems

Show HN: TraceLens Visualizing Distributed Systems

TraceLens is a user-friendly OpenTelemetry UI acting as a Collector for data storage. Free during beta, it offers visualization tools and plans a subscription model for commercial use. Contact Asynkron AB for details.

Show HN: Uniflow - A fast multipurpose workflow engine

Show HN: Uniflow - A fast multipurpose workflow engine

Uniflow is a high-performance workflow engine known for managing tasks of varying lengths and allowing on-the-fly specification modifications. It seamlessly integrates new nodes for enhanced features. Find more details on Uniflow on its GitHub Repository.

FileFlows: Execute actions against files in a tree flow structure

FileFlows: Execute actions against files in a tree flow structure

FileFlows is a versatile tool for processing various file types like text, images, audio, and video. It supports transcoding, converting, and optimizing files, offering detailed reporting and customization options for users.

Show HN: TargetJ – New JavaScript framework that can animate anything

Show HN: TargetJ – New JavaScript framework that can animate anything

TargetJ is a JavaScript UI framework on GitHub emphasizing development and animation efficiency. It centers on 'targets,' offering advanced animation, event management, and object collection handling. Find installation, samples, and documentation on targetj.io. Contact Ahmad Wasfi at wasfi2@gmail.com.

AI: What people are saying
The comments on FlowTracker highlight its innovative approach to monitoring data flow in applications and its potential impact on debugging.
  • Many users are impressed by the demo, particularly its ability to trace data back to its source, enhancing debugging capabilities.
  • Several commenters draw parallels to other tools and concepts, such as taint analysis and Clojure's FlowStorm, indicating a broader interest in similar technologies.
  • There is curiosity about the applicability of such tools in other programming languages, like C#.
  • Users express excitement about the potential for improved web developer tooling and integration challenges with existing frameworks.
  • Some comments reflect on past experiences with similar concepts, emphasizing the ongoing need for effective debugging tools.
Link Icon 18 comments
By @jpmonettas - 5 months
Cool! I wrote something on the same spirit but for Clojure, called FlowStorm http://www.flow-storm.org/

For instrumentation, instead of an instrumenting agent it uses a fork of the official Clojure compiler (in Clojure you can easily swap compilers at dev) that adds extra bytecode. What is interesting about recording Clojure programs execution is that most values are immutable, so you can snapshot them by just retaining the pointers.

Edit: Since the OP demo is about exploring a web app for people interested in this topics I'm leaving a demo of FlowStorm debugging a web app also https://www.youtube.com/watch?v=h8AFpZkAwPo

By @ysleepy - 5 months
This is incredibly cool.

I love how good the tooling is in the java/jvm ecosystem. Last time I was this blown away was with jitwatch ( https://github.com/AdoptOpenJDK/jitwatch )

FlowTracker reminds me a little of taint analysis, which is used for tracking unvalidated user inputs or secrets through a program, making sure it is not leaked or used without validation.

search keywords are "dynamic taint tracking/analysis"

https://github.com/gmu-swe/phosphor

https://github.com/soot-oss/SootUp

https://github.com/feliam/klee-taint

By @BoppreH - 5 months
Blown away by the demo tracking an HTML element back to the SQL statement that added that value to the database.

I can totally see a future where tools like this are the first line of defense when troubleshooting bugs.

By @smartmic - 5 months
I am not really sure if I get the full picture and how it might be used - but it somehow reminds me of a Smalltalk environment where I can also inspect everything (all are objects and messages and you can trace back and interact with it those).
By @michaelmior - 5 months
Very cool! I love the demo video and I could definitely see how this would be useful when diving into an unfamiliar codebase.
By @hoten - 5 months
Years ago I experimented[1] with a similar concept (wanting something like JavaScript source maps, but for HTML). I didn't manage to find the time to expand on it, but I think web developer tooling would really benefit from this sort of full-stack attribution.

Integration of any solution like this into existing frameworks feels like a big challenge.

[1] HTML Source Maps - https://github.com/connorjclark/html-source-maps https://docs.google.com/document/d/19XYWiPL9h9vA6QcOrGV9Nfkr...

By @svieira - 5 months
This reminds me (in the best way possible) of the Eve-lang demos of debugging a program by simply asking "why is <the UI element> not here?" Fantastic work!

https://www.youtube.com/watch?v=TWAMr72VaaU&t=164s and https://witheve.com/

By @peterpost2 - 5 months
If I recall there was a paper on a similar tool that was used for finding SQL-injections dynamically in java programs. Is this the same tool?
By @SeriousM - 5 months
Once I had the vision to track data over the internet, like where came the image from, on which cdn was it. Or "what did this string have seen from creation till it reached my screen". This is a step into this direction.
By @BadJo0Jo0 - 5 months
Thanks for this!

Been trying to get this work with VSCode with a project I'm trying to make sense of. Having to take a pause on it right now, but looking forward to getting it working and playing with it.

By @exabrial - 5 months
This is awesome! Reminds me of Java flight recorder!
By @yellow_lead - 5 months
This looks really cool, I think this could have saved me some time hunting bugs when I was working with Spring in the past.
By @hansoolo - 5 months
This is pretty cool! Do you think something similar is possible for c#, too?
By @KomoD - 5 months
That is really cool, really like that there's a browser demo too
By @larusso - 5 months
Hmm would love to connect this to our gralde builds :)
By @apnew - 5 months
Very very impressive.
By @kitd - 5 months
Very impressive!