ProductMarch 31, 20269 min read

Discover: Ad-Hoc Query Builder for All Your Data

Query events, errors, spans, and logs with a visual query builder. Build custom reports, save them for your team, and explore your data without writing SQL.

Why Dashboards Aren't Enough

Dashboards are great for monitoring known metrics. They show you the numbers you've already decided to watch. But the most important questions in engineering and product are the ones you didn't anticipate.

"Why did signups drop 30% last Tuesday?" "Which API endpoints have the highest error rate for users in Germany?" "What's the average response time for database queries that touch the orders table?"

These questions cut across data types -- events, errors, spans, logs -- and require flexible filtering, aggregation, and grouping that static dashboards can't provide.

Today we're launching Discover, a visual query builder that lets you explore all your JustAnalytics data interactively. Think of it as SQL for your observability data, but without writing SQL.

The Query Builder

Discover provides a drag-and-drop interface for building queries across all data types in JustAnalytics.

Data Sources

Every query starts by selecting a data source:

Data SourceWhat It Contains
EventsPageviews, clicks, custom events, e-commerce events
ErrorsJavaScript errors, server-side exceptions
SpansDistributed trace spans (HTTP, database, custom)
LogsStructured log entries from the Node.js SDK
SessionsSession-level aggregations
Web VitalsCore Web Vitals measurements

Building a Query

A Discover query has four parts:

1. Columns (what to show)

Select the fields you want to see. Each data source has its own set of available fields:

Events:      url, referrer, country, device, browser, os, timestamp
Errors:      message, stack_trace, url, browser, error_type, count
Spans:       service, operation, duration, status, http_method, db_system
Logs:        level, message, service, trace_id, timestamp
Sessions:    duration, page_count, bounce, country, device
Web Vitals:  lcp, fid, cls, inp, ttfb, url

2. Aggregations (how to summarize)

Apply aggregation functions to numeric fields:

FunctionDescriptionExample
count()Number of recordsCount of errors per page
count_unique()Distinct valuesUnique users per country
sum()TotalTotal revenue by source
avg()AverageAverage span duration by service
p50()MedianMedian page load time
p75()75th percentilep75 response time
p95()95th percentilep95 database query time
p99()99th percentilep99 API latency
min()MinimumFastest response time
max()MaximumSlowest response time

3. Filters (which records to include)

Filter by any field using comparison operators:

WHERE country = "US"
  AND device = "mobile"
  AND timestamp >= "2026-03-01"
  AND url CONTAINS "/checkout"
  AND NOT browser = "bot"

Filters support:

  • Equality: =, !=
  • Comparison: >, >=, <, <=
  • String matching: CONTAINS, STARTS_WITH, ENDS_WITH
  • Set membership: IN, NOT IN
  • Null checks: IS NULL, IS NOT NULL
  • Regex: MATCHES (regular expression)

4. Group By (how to segment)

Group results by one or more fields:

GROUP BY country, device

Example Queries

Top error messages by count:

Source: Errors
Columns: message, count()
Group By: message
Sort: count() DESC
Limit: 20

Average API latency by endpoint and status:

Source: Spans
Columns: operation, http_status_code, avg(duration), p95(duration), count()
Filter: service = "api-gateway"
Group By: operation, http_status_code
Sort: avg(duration) DESC

Revenue by country and device:

Source: Events
Columns: country, device, sum(value), count_unique(transaction_id)
Filter: event_name = "purchase"
Group By: country, device
Sort: sum(value) DESC

Slowest database queries:

Source: Spans
Columns: db_statement, avg(duration), p99(duration), count()
Filter: db_system = "postgresql" AND duration > 100
Group By: db_statement
Sort: p99(duration) DESC
Limit: 50

Visual Query Building

While the examples above show queries in a text format for clarity, the actual Discover interface is entirely visual.

Drag-and-Drop Columns

Available fields appear in a sidebar organized by category. Drag a field to the columns area to add it to your query. Drag an aggregation function onto a numeric field to apply it.

Filter Builder

Click Add Filter to open the filter builder. Select a field, choose an operator, and enter a value. The filter builder shows a preview of matching values as you type, so you can verify your filter before running the query.

Interactive Results

Query results appear as a sortable, paginated table. Click any column header to sort. Click any row to drill down into the underlying records.

Visualization Toggle

Switch between table view and chart view with a single click:

  • Table -- raw results with sorting and pagination
  • Bar chart -- for categorical comparisons
  • Line chart -- for time series data
  • Pie chart -- for proportional breakdowns
  • Area chart -- for stacked time series
  • Heatmap -- for two-dimensional distributions

The visualization type is auto-suggested based on your query structure, but you can override it.

Cross-Data-Type Queries

One of Discover's most powerful features is the ability to query across data types. Because JustAnalytics stores events, errors, spans, and logs in the same platform with shared identifiers (session IDs, trace IDs), you can correlate across boundaries.

Joining Events to Errors

"Show me pageviews where an error occurred during the same session:"

Source: Events
Join: Errors ON session_id
Columns: url, count() as pageviews, count(errors.id) as error_count
Group By: url
Sort: error_count DESC

Joining Spans to Logs

"Show me API endpoints where error logs were emitted:"

Source: Spans
Join: Logs ON trace_id
Columns: operation, avg(duration), count(logs.id) as log_count
Filter: logs.level = "error"
Group By: operation
Sort: log_count DESC

Joining Sessions to Web Vitals

"Show me sessions with poor Core Web Vitals by country:"

Source: Sessions
Join: Web Vitals ON session_id
Columns: country, count() as sessions, avg(web_vitals.lcp) as avg_lcp
Filter: web_vitals.lcp > 2500
Group By: country
Sort: sessions DESC

Saving and Sharing Queries

Saved Queries

Click Save to store a query for later use. Saved queries appear in your Discover sidebar and can be organized into folders:

My Queries/
  ├── Daily Checks/
  │   ├── Top errors today
  │   ├── Slowest endpoints
  │   └── Revenue by source
  ├── Investigation/
  │   ├── Checkout drop-off analysis
  │   └── Mobile crash patterns
  └── Reports/
      ├── Weekly error summary
      └── Monthly revenue breakdown

Sharing Queries

Every saved query has a shareable URL. Send it to a teammate and they'll see the same query with the same filters, updated with the latest data. Shared queries respect your team's site-level permissions.

For one-off queries you haven't saved, Discover encodes the full query in the URL. Copy the URL and paste it into a Slack message or Jira ticket. Anyone with dashboard access can open it and see the results.

Standard Reports Library

Discover includes a library of pre-built reports that cover common analysis patterns. These are ready to use out of the box and serve as starting points for custom queries.

Error Analysis Reports

ReportDescription
Top ErrorsMost frequent error messages, sorted by count
Error Rate by URLWhich pages produce the most errors
Errors by BrowserBrowser-specific error patterns
New Errors (24h)Errors seen for the first time today
Regression ErrorsPreviously resolved errors that reappeared

Performance Reports

ReportDescription
Slowest EndpointsAPI endpoints ranked by p95 latency
Database Query PerformanceSlowest SQL queries with execution counts
Web Vitals by PageCore Web Vitals broken down by URL
Throughput by ServiceRequests per second by service
Error Rate by ServiceHTTP 5xx rate by service

User Behavior Reports

ReportDescription
Top PagesMost visited pages with engagement metrics
Traffic SourcesReferrer breakdown with conversion rates
Geographic DistributionSessions and pageviews by country
Device BreakdownDesktop vs mobile vs tablet usage
Bounce Rate AnalysisBounce rate by landing page and source

E-commerce Reports

ReportDescription
Revenue SummaryTotal revenue, transactions, AOV by period
Product PerformanceRevenue and conversion rate by product
Funnel ConversionStage-by-stage conversion rates
Cart AbandonmentSessions that added to cart but didn't purchase
Revenue by ChannelAttribution-weighted revenue by traffic source

Custom Reports

Click Duplicate on any standard report to create your own version. Modify the columns, filters, and grouping to match your specific needs, then save it to your library.

Query Performance

Discover queries run against optimized column-oriented indexes in JustAnalytics. Performance depends on the time range and data volume:

Time RangeTypical Response Time
Last 1 hour< 500ms
Last 24 hours< 2 seconds
Last 7 days< 5 seconds
Last 30 days< 10 seconds

For queries over large time ranges, JustAnalytics uses pre-aggregated data when possible. Aggregation functions like count() and sum() over daily data use the aggregation tables, making even 30-day queries fast.

Query Limits

To prevent runaway queries, Discover enforces limits:

  • Maximum result rows: 10,000
  • Maximum query time: 30 seconds
  • Maximum concurrent queries: 5 per user

If a query exceeds the time limit, you'll receive a suggestion to narrow the time range or add more specific filters.

API Access

Every Discover query can be executed programmatically via the API:

curl -X POST https://api.justanalytics.app/v1/discover/query \
  -H "Authorization: Bearer ja_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "spans",
    "columns": ["operation", "avg(duration)", "p95(duration)", "count()"],
    "filters": [
      {"field": "service", "op": "=", "value": "api-gateway"}
    ],
    "groupBy": ["operation"],
    "orderBy": {"field": "avg(duration)", "direction": "desc"},
    "limit": 20,
    "timeRange": {"start": "2026-03-01", "end": "2026-03-31"}
  }'

This enables:

  • Scheduled reports via cron jobs
  • Custom dashboards in external tools
  • Automated analysis in CI/CD pipelines
  • Data export to data warehouses

Getting Started with Discover

  1. Navigate to Dashboard > Discover in your JustAnalytics dashboard
  2. Select a data source from the dropdown
  3. Add columns by clicking field names or dragging them
  4. Add filters to narrow your results
  5. Click Run Query
  6. Switch between table and chart views
  7. Save the query if you want to use it again

Start with the standard reports library if you're not sure what to query. Each report includes a description of what it shows and why it's useful.

Start your 7-day free trial and explore your data like never before.

JT
JustAnalytics TeamEngineering Team

The engineering and product team behind JustAnalytics. We're on a mission to make web observability simpler, faster, and more private.

Related posts