Quick Start Guide
Introduction
BitDive is a tool that helps monitor your application’s performance by tracking how different parts of your code are used. It’s great for understanding what parts of your app might be slowing things down or causing errors. Here, we’ll go through the process of adding Bitdive to your project, setting up some basic configurations, and getting it running.
If you’re new to this, don’t worry! We’ll keep things simple and explain each step.
Step 1: Adding BitDive to Your Project
The first step is to tell your project to include BitDive as a “dependency,” which means your project will rely on BitDive for certain features. This is done by editing a file called pom.xml
that’s part of your project if you’re using Maven.
Find Your Dependency
- You can find the agents for BitDive here: BitDive Maven Repository.
- Open your
pom.xml
file in your project. - Based on your type of project (plain Java or Spring Boot), copy one of the following pieces of code and paste it inside the
<dependencies>
section of yourpom.xml
file.
-
For Spring Boot 3 applications:
<dependency>
<groupId>io.bitdive</groupId>
<artifactId>bitdive-producer-spring-3</artifactId>
<version>0.0.15</version>
</dependency>
- After adding the appropriate dependency, save
pom.xml
and rebuild your project so that it downloads and includes BitDive.
Step 2: Configuring BitDive to Monitor Your Application
BitDive uses a configuration file to understand what parts of your application it should track. To set this up:
-
Create a file named
config-profiling.yml
in yourresources
folder, which is usually found in thesrc/main/resources
directory of your project. This is where BitDive will look for configuration settings. -
Add Basic Configuration: Paste the following example into
config-profiling.yml
:application:
moduleName: TestModule # Name of your module, can be any name you choose
serviceName: TestService # Name of your service, can be any name you choose
packedScanner: com.foreach # Replace with the main package of your project
monitoring:
logLevel: DEBUG # Controls the amount of information logged
monitoringArgumentMethod: true # Track method arguments for deeper analysis
monitoringReturnMethod: true # Track return values to understand method outputs
monitoringOnlySpringComponent: false # Set to true to track only Spring-specific components
sendMonitoringFiles:
serverConsumer:
url: http://localhost:8081/api/files/upload # Destination for sending logs
Explanation of Key Settings
packedScanner
: This tells BitDive where your main code is located. It should be set to the "main package" of your project, which is usually the top-level package in your code structure. In the project example you provided, this iscom.foreach
. Make sure it matches the exact package name, so BitDive scans the correct parts of your code.moduleName
andserviceName
: These are just identifiers to help organize your data. Feel free to set these to anything that helps you identify this part of your application.logLevel
: Setting this toDEBUG
allows you to see detailed information about how your application is running, which can be useful for identifying performance issues.monitoringArgumentMethod
andmonitoringReturnMethod
: These options enable BitDive to track what’s being passed into and returned from your functions, which is useful for debugging.monitoringOnlySpringComponent
: Set this totrue
if you’re using Spring and want to only monitor Spring-annotated components, which will reduce the number of logs for other classes.
Step 3: Run Your Application and Start Monitoring
With everything configured, you’re ready to start using BitDive:
- Run your application as you normally would (e.g., through your IDE or from the command line).
- BitDive will automatically start monitoring based on the settings in
config-profiling.yml
. - By default, BitDive will save log files and monitoring data in a folder named
monitoringData
in the root of your project. This is where you’ll find detailed information about your application’s performance.
Advanced Configuration (Optional)
If you want to explore more advanced settings, like setting up authentication or customizing log levels further, you can refer to the full documentation on the Advanced Configuration page.
This setup should help you get started with BitDive, allowing you to gain insights into your application’s performance and catch potential issues early. For more help or troubleshooting, check out the resources provided in the Maven repository or reach out to the BitDive community.