Local Deployment
This page will walk you through:
- Running core Drill4J Services
- Drill4J Agent configuration steps to collect metrics for your Java application.
It assumes you're running all services on your local machine.
It's a good starting point to get familiar with Drill4J. For installation and configuration in your actual development and testing environments, refer to the additional documentation (links at the bottom of the page).
#
Prerequisites- Docker
- Docker Compose
- The current release supports
x64
but notarm
-based machines. Specifically, it won’t work on Apple Silicon CPUs (M-series). Support for ARM-based machines is being worked on.
#
Deploy Core Drill4J ServicesDownload the following files and put them in the empty folder:
Create
db-init
folder next todocker-compose.yml
Download
data.sql
from https://github.com/Drill4J/drill-metabase-dashboards/releases/tag/v18 and place indb-init
folderYour folder structure should match the following:
Open terminal in this folder and execute:
Wait for docker-compose to download images and launch containers.
#
Check Services AvailabilityTo make sure everything is working:
Drill4J Admin Backend must return
Drill4J UI must display authentication form.
- Default credentials: user:
admin
password:admin
.
- Default credentials: user:
Metabase must display Metabase UI authentication form.
- Default credentials: user:
user@user.user
password:useruser1
- After you login to Metabase UI you should see
"Builds"
dashboard being available in Bookmarks section
- Default credentials: user:
#
TroubleshootingSkip this section if you experience no problems
I don't see the Metabase authentication form and instead presented with this message:
- Reason: Metabase was not propertly initalized. You likely have either skipped downloading
data.sql
file or misplaced it. Make sure to put it indb-init
folder next to thedocker-compose.yml
file.
- Reason: Metabase was not propertly initalized. You likely have either skipped downloading
#
Generate API KeyDrill4J Backend authenticates incoming data using API keys. To generate new API key:
- Open Drill4J UI My API Keys section
- At the top of the page, enter description for the new key and click "Generate" button.
- New API key row must appear in the table.
- The actual key value is copied to your clipboard. Paste it somewhere safe for the next step.
#
Setup Java AgentDownload the Drill4J Java Agent release zip file using the link:
https://github.com/Drill4J/java-agent/releases/tag/v0.9.4Pick the release appropriate for your platform (
mingwx64
- Windows; Mac and Linux are called correspondingly)Unzip the file. Change the release-specific folder name (e.g.
linuxX64-0.9.1
) to simplyagent
. The folder must contain:Place this
agent
folder next to your Java application.jar
fileOpen
drill.properties
file and set the following properties:Launch your application:
Considering your application is launched with
Change it to be
- Windows
- Linux
- For Mac
To confirm Drill4J Java Agent is running check your application log. There must be Drill4J ASCII art followed with agent version and log entry:
#
Inspect MetricsIn Metabase UI navigate to Builds Dashboard
You should see Builds table containing a single entry, corresponding to your application.
Click on the value of first column
my-app:backend:1.0.0
and you should be taken to Build - Summary dashboardScroll down to see application Coverage metrics
Some components will display "There was a problem displaying this chart". This is not an error and is expected.
This is due to the fact you have to complete additional configuration in order to see complete metrics.
Click on piecharts to navigate to detailed coverage dashboards
Try interacting with your application (execute some tests, call API endpoints) and then check back to Metabase UI to see how your application coverage % changes.
#
Next Steps and Further ReadingThis guide covered the basics of deploying Drill4J Services and the Application Agent, which gives you basic Coverage metrics.
For more advanced metrics, integrate Drill4J with your tests. For more details, check out the additional documentation: