Agent
What the agent sends
Summary
The agent pushes four kinds of payload to the address you set with exportUrl: Otherlode’s ingest at https://ingest.otherlode.dev, or your collector. This page calls either one the receiver. Every payload is a protobuf message that names code (classes, methods, source files, lines, conditions, routes, jars) and carries counts. It holds no request data and no argument or return value, with one exception you turn on yourself: the route bridge for OpenTelemetry can send a request’s path.
The agent has no redaction setting, and it sends everything this page lists in clear. To blank string literals and re-key branch and site keys before a payload leaves your network, send through a collector with redaction on. See redaction.
Requests
Every request is a POST to a path under exportUrl. The agent drops a trailing slash from exportUrl and refuses a query string or fragment, so the paths below always sit directly under the URL you set. The default exportUrl is http://localhost:4319.
Path under exportUrl | Payload | Sent |
|---|---|---|
/v1/otherlode/deltas | Delta batch | Every flush, even when empty |
/v1/otherlode/manifest | Probe manifest | On a flush that has something not yet delivered |
/v1/otherlode/static-baseline | Static baseline chunk | Once per process, when staticBaselineEnabled is on |
/v1/otherlode/class-listing | Class listing chunk | Once per process, when classListingEnabled is on, which is the default |
Each request has these headers:
| Header | Value |
|---|---|
Content-Type | application/x-protobuf |
Authorization | Bearer <authToken>, only when you set authToken |
The JDK’s java.net.http.HttpClient adds its own headers (Host, Content-Length, User-Agent). Requests use HTTP/1.1, and the agent offers no upgrade to HTTP/2. The agent sends the token on every request. With a token set, the agent refuses a plain http:// exportUrl to an otherlode.dev host and stays off for this JVM. For any other plain http:// host that is not localhost, an address in 127.0.0.0/8 or [::1], it logs this warning once at startup:
otherlode: exportUrl uses plain http, so the auth token is sent unencrypted
Set the token with the OTHERLODE_AUTH_TOKEN environment variable, because every user on the host can read a -javaagent argument through ps. See configuration options.
The agent reads no response body. Only a 202 status counts as stored. Any other 2xx status fails the send at once, without a retry, and the agent sends the payload again at the next flush. Each request times out after 10 seconds, and so does the connection attempt.
On a 202 the agent reads the Otherlode-Notice header and logs a WARNING for each notice, at most once an hour per notice. The agent logs a notice as unknown when it is not lowercase letters and hyphens, or is longer than 64 characters. It also logs a new notice as unknown once it has kept 32 different ones.
otherlode: Otherlode stores this service's payloads but does not track the service, because the tenant's plan tracks no more services
otherlode: Otherlode stores this environment's payloads but does not track the environment, because the service already watches as many environments as its cap allows
otherlode: Otherlode sent a notice this agent does not know: <notice>
When payloads are sent
The agent flushes on a fixed interval, flushIntervalSeconds, 60 seconds by default and between 1 and 86400. The first flush comes at a random offset between 0 and one interval after startup, so a fleet that starts together does not flush on the same tick. Later flushes keep the fixed rate from that offset.
Each flush sends the delta batch and, if something is waiting, the manifest, at the same time. A flush that finds a dependency whose counts were just delivered sends one more manifest for it. Once the dependency listing is complete, the first flush whose sends were all confirmed sends one more, empty, manifest that says so.
On a graceful JVM exit the agent’s shutdown hook works to one deadline, 28 seconds from the moment it starts, under Kubernetes’ default grace period of 30 seconds. It takes three steps:
- It flushes at once, for up to 5 seconds, so the counts so far are on their way while your application’s own shutdown hooks run. The JVM starts those hooks at the same time as the agent’s. At 5 seconds the agent stops waiting for this flush’s sends, and the flush starts no further hit batch or manifest chunk.
- It waits for your application’s own shutdown hooks to end, until 18 seconds in, so that code they run, such as a framework closing its context, is counted. It does not wait for a hook that has not started within 1 second.
- It runs one last flush with the time left, at least 10 seconds. The last flush ends with an empty delta batch that carries
final_flush. Its sends do not wait for a send of the early flush that is still going.
Neither the early flush nor the last flush sends a static baseline or class listing retry. A flush that was already running when shutdown began, and is stuck on an unreachable receiver, holds both flushes back. The early flush gives up after 5 seconds, and the last flush gives up when the 28 seconds end. If the agent cannot read the list of your application’s shutdown hooks, it logs why at startup. At exit it then flushes at once and runs the last flush straight after, without the wait. A test run (testRun) neither flushes early nor waits for your hooks. kill -9, an out-of-memory kill and a crash send no final flush.
Chunk caps
The agent splits a payload that would be larger than its cap into several requests and sends them in order. A request closes when the next entry would take it past any of three bounds: its entry cap, 8 MiB of encoded bytes, or 90% of the ingest element limit for its kind. An element is every embedded message and every element of a repeated field, at every depth, in the protobuf encoding. The resource counts as one. The agent measures bytes and elements on the encoding it sends.
| Payload | Entry cap | Element bound |
|---|---|---|
| Delta batch | 20,000 entries (probe, endpoint and dependency deltas together) | 450,000 |
| Probe manifest | 5,000 entries. A class counts as one, plus one for each probe, call edge and referenced class. A branch site counts as one, plus one for each condition part, outcome, guarded line range and case label part | 90,000 |
| Static baseline | About 20,000 entries, where a declared class weighs its methods plus their call edges, branch sites and references | 180,000 |
| Class listing | 20,000 class names | 90,000 |
The agent never splits a class across requests. A class with more entries than its entry cap goes out in a request of its own. A class can also break the byte or element bound on its own, and what the agent does then depends on the payload:
- Manifest. The class goes out as a skipped class with the reason
too large to report: its manifest entries exceed the ingest limits, in place of its probes. Otherlode counts it as loaded and claims nothing about its methods. The agent leaves the class’s probe deltas out of every delta batch and logs aWARNINGthat names the class. The classes behind it go out as usual. - Static baseline. The agent sends no chunk of the scan and logs one
WARNINGthat names the class and the bound. The run has no complete scan, so Otherlode makes no never-loaded claim for it. - Class listing and delta batch. A class name is at most 65,535 bytes, and a class never has more deltas than probe locations in its manifest, so neither can break a bound on its own.
Payloads
Every payload carries the same resource attributes. manifest_confirmed is the one that changes during a run, and it changes once.
Resource attributes
| Field | Content |
|---|---|
service_name | The service name from your configuration, OpenTelemetry settings or detection |
service_namespace | Optional. Only if you or OpenTelemetry settings set it |
service_version | Optional |
service_instance_id | UUID made at startup, unless you set serviceInstanceId |
environment | Optional. test for a test run with no other source |
run_id | A random UUID made once per process. It differs on every start, even under a pinned service_instance_id |
test_run | True when you started the agent with testRun |
agent_version | The agent jar’s version, empty when unknown |
flush_interval_seconds | The value of flushIntervalSeconds, in whole seconds |
fields_stripped | Never set by the agent. A collector with redaction on sets it on a payload it dropped a field from |
manifest_confirmed | False until the receiver stores a probe manifest of this run that held at least one class, then true on every payload after. The agent sets it only from deliveries it saw confirmed, so a manifest whose answer was lost does not count. It never goes back to false |
The agent adds no host name, address, user name, environment variable or system property. Resource attributes come from your configuration, from OpenTelemetry’s service.* and deployment.environment* settings (see configuration options), and from service name detection when you set none.
Delta batch
A delta batch carries the resource attributes plus these lists. Each entry is a set of ids and numbers, with no names.
| Field | Content |
|---|---|
deltas | For each probe whose count changed: class_id, probe_index, kind (method, branch, optional argument, initialiser returned or initialiser threw), first_seen_at and hits_total |
endpoint_deltas | For each endpoint whose count changed: endpoint_id, first_seen_at, hits_total |
dependency_deltas | For each dependency whose loaded-class count changed: dependency_id, first_loaded_at, loaded_classes_total |
final_flush | True only on the last, empty delta batch of the shutdown flush |
flush_complete | True on at most one delta batch of a flush, when the receiver stored every delta batch the flush sent before it. See below for which batch that is |
payload_sequence, counts_pending_since, starting | Where the run stands in delivering its counts, and whether it is still starting. See Pending counts |
hits_total and loaded_classes_total are cumulative since the process started, not the amount since the last flush, so a batch that arrives twice or out of order changes nothing. first_seen_at is the time of the flush that first saw a non-zero count, so it is accurate to one interval.
The agent sends the batch even when no count changed. An empty batch is a heartbeat. It tells Otherlode the instance is alive and idle, not crashed or cut off.
One flush can send several delta batches. The chunk caps split a large batch. A flush that starts with anything pending sends a heartbeat first. When hit counts were pending and the receiver stores every hit batch, the flush sends another heartbeat at the end. One batch of the flush carries flush_complete when the receiver stored every delta batch the flush sent before it. On the shutdown flush that is the final_flush batch. On any other flush it is the closing heartbeat when hit counts were pending, and otherwise the flush’s last batch, which is its heartbeat when no count changed. When the receiver refuses an earlier batch, or an earlier send gets no answer, no batch of that flush carries it, and neither does a shutdown flush that could not read its counts. The extra empty batch described in Pending counts never carries it.
The ids refer to the manifest of the same run. They mean nothing without it.
Pending counts
Every delta batch and manifest carries three fields that tell Otherlode whether the run’s counts are behind. Static baseline and class listing chunks carry none of them.
payload_sequencenumbers the run’s delta batches and manifests from 1, one higher each time. The payload with the highest number is the run’s latest word, whatever order the payloads arrived in. A gap in the numbers means nothing.counts_pending_sinceis 0 when nothing from a delta batch or manifest waited to go out again after a send that failed or did not complete, at the moment the agent stamped the payload. Otherwise it is the time, in milliseconds since the epoch, of the flush from which delta counts or manifest entries have waited without a break, whichever began first. It says nothing about the run starting.startingis true while the run is starting, and false after.
A run is starting from the agent’s start. Every payload carries starting = true until a flush finds all of these:
- The run is at least one
flushIntervalSecondsold. - Classes in scope have loaded.
- For at least one
flushIntervalSeconds, the agent has not registered, skipped, found unreported or found with nothing to probe any class in scope. - No class awaits confirmation that the JVM defined it.
That flush and the ones after it carry starting = false. A run that keeps loading classes in scope stops starting after 10 intervals. The final flush also ends it when no class in scope loaded after the early shutdown flush and none awaits confirmation, as when a batch job’s work is done. Only a run with an early shutdown flush ends this way, so a test run (testRun) does not, and nor does a run whose stuck flush made the early flush give up. A test JVM that ends within its first interval ends with a batch that still says starting. So does a JVM stopped while its application was still starting, when a class in scope loads after the early shutdown flush or one still awaits confirmation. Once a run stops starting, it does not start again, and a class that first loads later is reported on the next flush.
A flush sends one extra empty delta batch when the run stops starting, or its pending state changes, after the agent stamped that flush’s payloads. It carries the new state.
While the latest payload of a run says starting, its zero hit totals are not evidence that code never ran, since the application may not have loaded its classes yet. While the latest payload carries a counts_pending_since other than 0, some of the run’s counts have not reached the receiver, so its zero hit totals are not evidence either, even after the run has ended. Nor are they before any delta batch from the run has arrived. The manifest and the delta batches go out side by side, so the receiver can store one and refuse the other, and the manifest then shows zero hits for code that did run.
One gap remains. Payloads stamped in the flush where refusals begin, before the first refusal, carry 0. If the receiver stores nothing after that, up to one flush interval of hits is missing while the run’s newest payload says 0, and the run reads like one that stopped without a final flush.
Probe manifest
The manifest says what each id in a delta batch names. It carries the resource attributes plus the lists below. Class entries go out once. After the receiver confirms a manifest that carries a class, the agent drops that class’s names and keeps only each probe’s kind. If that manifest is then lost, Otherlode gets it back only when the instance restarts.
| Field | Content |
|---|---|
probes | One per probe: class_id, probe_index, kind, class name, method name, method descriptor, source line, parameter names, generic signature, the compiler construct that generated the method or the unread shape it has, its outside caller (the annotation or supertype that calls it), and flags for inline, static, lambda body and extension receiver. A branch probe also carries its branch_key and the class an inlined copy came from. An optional-argument probe carries the parameter’s index and name, whether its target can be overridden, and the target’s class when it differs |
probes[].branch_sites | For a branch probe: the site’s site_key, line, condition, outcomes with their roles, guarded line ranges (source file name plus first and last line), case keys and case labels. string_hash_code_switch marks a switch on String.hashCode(). Each case key of such a switch is the hash code of a string, often one of your literals. See methods and branches |
probes[].calls, probes[].referenced_classes | Call edges to other classes in scope, and names of classes outside it that the method refers to |
class_locations | Per class: super class name, interface names, source file name, body kind, source name, and Kotlin class kind |
class_references | Per class: names of classes it refers to outside any probed method |
skipped_classes | Class name, the reason as free text (usually an exception message), and the time |
failed_classes | Name of a class that failed to load, one the agent wove and the JVM never defined, and the time |
classes_failed_to_initialize | Name of a class the JVM defined that can never run, the reason, and the time the agent first saw it. The reason is STATIC_INITIALIZER_THREW when its static initialiser threw, or VERIFIER_REJECTED when the JVM’s verifier rejected it. The manifest lists a class once per reason. The two probes behind the first reason, kinds initialiser returned and initialiser threw, count how often the static initialiser returned and how often it threw |
unplaced_verification_failures | How many VerifyError messages were in no format the agent reads, plus the messages the agent had no room to keep. Every manifest carries the run’s total |
verifier_rejections_watched | True when the agent’s hook on VerifyError is installed. Every manifest of a run agrees |
unreported_classes | Name of a class the agent found loaded that the JVM offered to no transformer, and the time |
endpoints | Per endpoint: endpoint_id, verb, route template, the framework’s own spelling of the template, framework name, how it was discovered, whether the template is a path, a regex or a servlet pattern, and the handler class, method and descriptor when known |
disabled_endpoint_modules | Module name, the reason, the time, and a kind naming why: a linkage error, an advice failure, a transform failure, a route walk failure, a hook that matched no method, a module your configuration kept off, or routes the module has no point to count at. The kind is unset for a module that dropped endpoint records before the agent finished installing. The reason is the error’s text for a linkage error and the exception’s class name for any other exception. Otherwise it is a sentence from the agent, such as the setting that kept the module off |
framework_markers | Per marker: its id, the class set that matched as fully qualified names, and the time of the sweep that saw it. The agent delivers each once per run. See frameworks with no module |
dependencies | Per dependency: dependency_id, identities (group_id, artifact_id, version), how the identity was read, the location, how it was discovered, and class count |
external_classes | Name of a class outside scope that your code refers to, the dependency_id that provides it, and whether nothing provides it |
references_recorded, dependencies_listed | Flags that say when references and the startup dependency listing are complete |
class_listing_blind | true once a class under includePackages loaded from a jar or folder the run’s class listing did not read, or with no code source and a name the listing lacks. The agent sets it on every manifest after that, and it never goes back to false. See the class listing |
payload_sequence, counts_pending_since, starting | Where the run stands in delivering its counts, and whether it is still starting. See Pending counts |
Branch and site keys
A branch_key names one outcome of a branch site across builds and instances, and a site_key names the site. Each key is 32 lowercase hex characters, compared only for equality. The agent derives a branch key from the class, the method name and descriptor, the origin class, the condition fingerprint and the outcome. A site key comes from the same inputs without the outcome. The origin class is the class of the inline function a branch was copied from, and empty for the class’s own code. The condition fingerprint is the instructions that compute the condition. A key stays the same across builds while its inputs do not change. A key is absent when the agent cannot name an outcome safely. See methods and branches for what changes a key and when it is absent.
Condition text and string literals
A branch site’s condition is source-like text rebuilt from bytecode, in parts. A part is code, a placeholder, or a string literal. A string literal part holds the string constant from your class file as the compiler stored it, such as "ENABLE_LEGACY_DISCOUNT" in if (System.getenv("ENABLE_LEGACY_DISCOUNT") != null). It also holds the labels of a when or switch on a string. The agent reads none of this text at run time. The text is a constant in your bytecode, never a value your program computed or received. The agent sends a constant that holds a secret, such as a hard-coded password or a key compared against input, as it is. It marks each string literal part as one, so a collector can blank it.
The condition fingerprint includes the string constants in the condition, so the keys of a condition that holds a string literal depend on its text. A branch key for a case of a when or switch on a string also covers the case’s label.
Names and paths
Class, method and parameter names, source file names and line numbers come from your class files. A class compiled without debug information sends no lines. It sends parameter names only when its class file keeps them in a MethodParameters attribute, as javac -parameters writes.
A dependency’s location is the jar’s path or its entry inside a fat jar, such as ~/.m2/repository/org/x/x-1.0.jar or BOOT-INF/lib/x-1.0.jar. The agent writes a path that starts with the JVM’s user.home folder with ~ in its place, so the payload does not name the account that ran the agent. Only a whole leading folder matches: /home/al does not rewrite /home/alice/x.jar. When a symbolic link leads to the home folder, the agent also writes ~ in place of the folder’s real path, with every link followed, at the start of a path under it. It sends a path under another user’s home folder as it is.
Endpoint routes
An endpoint carries its route template, such as GET /orders/{id}, not the URL of any request. The agent reads the pattern the framework matched. It sends no path, query string, header, parameter or body of a request. An endpoint that no request has reached still appears if the framework registered it. See endpoints.
The route bridge for OpenTelemetry is the exception. It is off unless you set otelBridgeEnabled=true. With it on, a bridge endpoint carries OpenTelemetry’s http.route exactly as OpenTelemetry reports it, and that is not always a template. For a Vert.x Web router mounted at a parameterised path, such as /u/:id/*, it holds the matched value. Each value then becomes an endpoint of its own, such as GET /u/42/orders, so the agent sends a value from a request path. The same holds for any instrumentation that sets http.route to a concrete path. A module records at most 8,192 endpoints that it finds only at dispatch, so the bridge sends at most 8,192 such routes in a run. See route bridge for OpenTelemetry.
Static baseline chunk
The agent sends a static baseline only when you set staticBaselineEnabled. A background scan lists the classes on the classpath under your includePackages and sends them once the scan ends. Each chunk carries the resource attributes, scanned_at, chunk_index and chunk_count.
| Field | Content |
|---|---|
declared_classes | Per class: name, super class and interface names, source file name, body kind, source name, Kotlin class kind, names of classes it refers to outside any probed method, and per method the name, descriptor, parameter names, generic signature, the compiler construct that generated it or the unread shape it has, flags for inline, static, lambda body and extension receiver, call edges, branch sites (with conditions and site keys) and referenced classes |
unreadable_classes | Name of a class file the scanner could not read, and the reason |
unprobed_classes | Name of a class with no method to count, and the reason |
external_classes | The same mapping as in the manifest |
include_rules | The include and exclude rules the scan applied, as the agent parsed them: include_packages and exclude_packages |
Otherlode uses the baseline only when it holds every chunk of a scan, which chunk_count tells it. The agent does not send a scan that holds a class too large for one chunk. See classes.
Class listing chunk
The agent sends a class listing unless you set classListingEnabled=false. A background thread lists the names of the classes the classpath holds under your includePackages and sends them once, without reading a class file. It also looks inside the jars nested in a Spring Boot executable jar or WAR. Each chunk carries the resource attributes, the rules, listed_at, chunk_index and chunk_count.
| Field | Content |
|---|---|
class_names | The dotted names of the listed classes, distinct across the listing and sent in ascending order. A chunk holds at most 20,000 |
include_rules | The include and exclude rules the listing applied, as the agent parsed them. A prefix covers a name that equals it, or continues it with . or $ |
listed_at | When the listing was made, in milliseconds since the epoch. Every chunk of one listing carries the same value |
chunk_index, chunk_count | Which part this chunk is, counting from 0, and how many parts the listing has |
A listing that matches no class is one chunk with no names. A process sends no listing when it cannot read a directory, jar or nested jar it lists. Otherlode uses a listing only when it holds every chunk. See classes.
What the agent never sends
- The query string, headers, parameters or body of a request, or a response.
- The path of a request, unless you turn the route bridge for OpenTelemetry on. See endpoint routes.
- Argument values, return values, field values, or exception messages from your code.
- Environment variables or system properties.
- Host names, addresses, or user names, apart from a user name inside a jar path that is not under
user.homeor its real path. - Source code. Source file names and line numbers go out, and so does condition text rebuilt from bytecode, but no source file content.
A probe only increments a counter in an array. It reads no value.
The free text in skipped_classes, unreadable_classes, unprobed_classes and disabled_endpoint_modules is a reason from the JVM or the agent, such as a linkage error message. For disabled_endpoint_modules, when the module failed on an exception other than a linkage error, it is the exception’s class name, never its message. It names classes and holds no application data.
When the receiver is down or refuses a payload
The agent keeps no queue of payloads. After a failed send, the state that the send would have advanced stays where it was, and the next flush computes the payload again from live counts. The memory the agent uses for this is bounded by the size of your code, not by traffic or by how long the receiver is away.
Retries inside one send
One send makes up to 5 attempts. It waits 200 ms after the first failure and doubles the wait after each failure, up to a cap of 30 seconds. A static baseline or class listing chunk resent at a later flush gets a single attempt. The agent retries only when a retry can help:
- A connection error or a timeout.
- A
5xxstatus. - A
408or429status.
Every other status, including a 401, 403, 404 and a redirect, fails the send at once. Only a 202 confirms.
When a retried answer carries a Retry-After header, in seconds or as an HTTP date, the agent waits that long before the next attempt instead, if it is 2 seconds or less. A longer Retry-After ends the send at once, and the next flush sends the payload again. A receiver that answers with a Retry-After over 2 seconds during an outage therefore gets one request per payload a flush, not five. See forwarding for what a collector answers while it cannot reach Otherlode.
After a failed send
- Delta batch. The agent does not mark the counts as delivered. The next flush reports the live cumulative count again, so Otherlode recovers from a lost acknowledgement or a late batch. A refused request, meaning a
4xxstatus the agent does not retry, does not stop the flush. The later delta requests still go, and the agent builds the refused one again on the next flush. Any other failure stops the flush’s delta requests at that one. The failure does not affect the manifest, which goes out alongside. The requests the flush did confirm stay confirmed either way. Counts the receiver has not stored are pending. The next flush leads with an empty delta batch that says so, sent on its own so that it arrives even when the receiver refuses the batch with the counts for its size. A flush that then confirms every batch with counts ends with another empty batch, whosecounts_pending_sinceis 0 unless a manifest is still pending. - Manifest. A chunk the receiver did not store stays pending, and the agent builds it again on the next flush. The agent builds, sends and confirms one chunk at a time and stops at the first failure. A disabled endpoint module goes first, on a manifest of its own, before any class chunk.
- Static baseline. Chunks go out in order and the first failure stops the send. The agent sends the chunks left again, one per flush, after a flush whose own sends the receiver stored. A
400or422answer means the receiver refused the content, so the agent drops every chunk left and logs a warning. Any other failure keeps the chunks, such as a401while a token rotates, or a413. The agent never repeats the scan in a process. - Class listing. The agent sends and resends the listing as it does the static baseline, with the same rules for each status. A
400or422answer drops the listing for the process. Any other failure keeps the chunks, including a404from a collector that does not serve the route. - Resending a delivered payload. If the receiver stored a payload but the agent never saw the answer, the agent sends the same payload again. Cumulative counts and chunk indexes make the repeat harmless.
Each failed delta batch or manifest send logs a WARNING, such as these:
otherlode: delta export failed, will retry next flush
otherlode: manifest export failed, will retry next flush
For a static baseline or class listing, the agent logs only the first failed send in the process, where <payload> is static baseline or class listing:
otherlode: failed to send <payload> chunk <n> of <count>; it and the chunks after it are sent again after a flush whose payloads are stored
When the receiver later stores its chunks, the agent logs otherlode: the <payload> was stored after a retry at INFO. A flush that fails never stops the schedule.
What a crash loses
Counts and manifest state live only in the process. A crash during an outage loses what the receiver had not stored, which is at most the hits since the last confirmed flush. On a graceful exit, the agent tries to send that remainder, as the shutdown steps above say. A crash does not affect history the receiver already stored.
Where the schema lives
The wire schema is one file, src/main/proto/otherlode/v1/otherlode.proto, package otherlode.v1. Its comments describe each field. It is published to the Buf Schema Registry as buf.build/otherlode/otherlode.