Quickstart
Start analyzing with the DBNL platform immediately
This guide walks you through using the DBNL Sandbox and SDK Log Ingestion using the Python SDK to create your first project, submit log data to it, and start analyzing. See this Quickstart as a 3 min video here [link].
If you would like to create your first project using SQL Integration Ingestion or OTEL Trace Ingestion instead of SDK Log Ingestion then skip over to the full Project Setup docs. The approach and example data below is the fastest way to explore the product locally from scratch.
Get and install the latest DBNL SDK and Sandbox.
pip install --upgrade dbnl
dbnl sandbox start
Log into the sandbox at http://localhost:8080 using
Username:
admin
Password:
password
Create a Project
Click the "+ New Project" button on the Namespace landing page
Give the project a name like
DBNL quickstart project
Add or create a default Model Connection for the Project.
Choose SDK Ingestion as the Data Connection. Creating and saving an API Token for later.
Upload example data
DBNL_API_URL = "http://localhost:8080/api"
DBNL_API_TOKEN = ""
import random
from datetime import UTC, datetime, timedelta
import dbnl
import pandas as pd
# Login to dbnl.
dbnl.login(api_url=DBNL_API_URL, api_token=DBNL_API_TOKEN)
# Use current time as reference point.
now = datetime.now(tz=UTC)
# Get or create a new project.
project = dbnl.get_or_create_project(
name=f"quickstart-{now.isoformat()}",
schedule="daily",
)
# Backfill first 8 days of data.
now_date = now.replace(hour=0, minute=0, second=0, microsecond=0)
start_date = now_date - timedelta(days=17)
end_date = now_date - timedelta(days=9)
for dt in pd.date_range(start_date, end_date):
dbnl.report_run_with_results(
project=project,
data_start_time=dt,
data_end_time=dt + timedelta(days=1),
column_data=pd.DataFrame([
{
"timestamp": dt + timedelta(minutes=30 * i),
"input": f"Is {i} an even or odd number?",
"output": random.choice(["even", "odd"]),
}
for i in range(20)
]).astype({
"timestamp": "datetime64[us, UTC]",
"input": "string",
"output": "category",
}),
)
Discover, investigate, and track behavioral signals
Go back to the DBNL project at http://localhost:8080
Discover your first behavioral signals by clicking on "Insights"
Investigate these insights by clicking on the "Explorer" or "Logs" button
Track segments by clicking "Add Segment to Dashboard"
Upload more data to see new signals and see tracked signals evolve over time
# Backfill another 8 days of data.
now_date = now.replace(hour=0, minute=0, second=0, microsecond=0)
start_date = now_date - timedelta(days=8)
end_date = now_date - timedelta(days=1)
for dt in pd.date_range(start_date, end_date):
dbnl.report_run_with_results(
project=project,
data_start_time=dt,
data_end_time=dt + timedelta(days=1),
column_data=pd.DataFrame([
{
"timestamp": dt + timedelta(minutes=30 * i),
"input": f"Is {i} an even or odd number?",
"output": random.choice(["even", "odd"]),
}
for i in range(20)
]).astype({
"timestamp": "datetime64[us, UTC]",
"input": "string",
"output": "category",
}),
)
Go back to the DBNL project at http://localhost:8080 and repeat step 4
Next Steps
Create a Project with your own data using OTEL Trace, SQL, or SDK ingestion. [link]
Learn more about the Adaptive Analytics Workflow [link]
Deploy the full DBNL platform [link]
Was this helpful?