Skip to content

Traces find the motherlode. What about the otherlode?

Find the code that never runs in production, across every instance of your Java, Kotlin and Scala services.

checkout6 replicas
POST /orders runs checkout, which runs charge. applyLegacyDiscount, also called from checkout, never ran. POST /promo was never called, so redeemPromo never ran and PromoCodes never loaded. POST /orders18,204 callscheckout18,204 runscharge18,204 runsapplyLegacyDiscountnever ranPOST /promonever calledredeemPromonever ranPromoCodesnever loadedRanNever ran

Every replica, one answer.

Run the agent on every replica. Code only counts as never run when none of them ran it.

Three replicas each ran a different set of methods. Together, one method never ran on any replica.replica 1replica 2replica 3all replicasnever ran anywhere

What it finds

Endpoint never called

  • POST /orders18,204 calls
  • GET /orders/{id}52,911 calls
  • POST /promonever called

Method never hit

RefundService.kt
40fun refund(order: Order)1,204 hits
41fun refund(order: Order, reason: String)318 hits
58fun refundLegacy(order: Order)never hit

Branch never taken

PricingService.kt
71if (customer.isLegacy()) {never true
72 total = legacyDiscount(total)
73}
74return total18,204 hits

Class never used

  • LegacyDiscountnever loaded
  • AuditLognever initialised
  • ReceiptPrinternever instantiated

Dependency never used

  • jackson-module-kotlin 2.17.1212 of 380 classes
  • kotlinx-coroutines-core 1.8.196 of 1,140 classes
  • commons-csv 1.10.0never loaded

Called only by tests

CartService.kt
88fun recalculate(cart: Cart)0 hits in production
run by CartTest.recalculatesTotals
run by CartTest.handlesEmptyCart

Delete it in one go.

Otherlode groups everything behind a branch that never runs.

BeforeCheckout.kt
1fun checkout(cart: Cart) {
2 if (flags.foo) {never true
3 bar(cart)
4 }
5 charge(cart)18,204 hits
6}
7
8fun bar(cart: Cart) = baz(cart)only from line 3
9
10fun baz(cart: Cart) {only from line 8
11 ...
12}
After9 lines fewer
1fun checkout(cart: Cart) {
2 charge(cart)
3}

How it works

Your network
AgentIn your JVM

It counts what runs. Attach it with -javaagent.

counts
Collector

It gathers counts from every agent and can blank out string literals.

counts
OtherlodeHosted

It merges the counts from every replica and shows what never ran.

Download the agent from Maven Central, paste your ingest key at the prompt and start your service with the agent. The quickstart takes you from an ingest key to your first report.

Run the agent
curl -fLO https://repo1.maven.org/maven2/dev/otherlode/otherlode-agent/0.1.0/otherlode-agent-0.1.0.jar
read -rs OTHERLODE_AUTH_TOKEN && export OTHERLODE_AUTH_TOKEN
OTHERLODE_SERVICE_NAME=checkout \
  OTHERLODE_INCLUDE_PACKAGES=com.acme.checkout \
  OTHERLODE_EXPORT_URL=https://ingest.otherlode.dev \
  OTHERLODE_STATIC_BASELINE_ENABLED=true \
  java -javaagent:otherlode-agent-0.1.0.jar -jar app.jar

Security and hosting

Open source in your network
The agent and collector are Apache 2.0.
Blank out string literals
The collector can blank them out before reports leave your network.
Data in London
The database and its backups are in Google Cloud's London region.
Sign-in
Use Google, Microsoft, GitHub, or your own SAML or OIDC provider.

We're in early access.

Ask for early access