Kotlin
Kotlin/JVM is supported by Speedscale anywhere the underlying JDK, network client, and TLS provider are supported. Kotlin compiles to JVM bytecode, so it uses the Java agent, proxy, and truststore paths rather than a separate Kotlin capture mechanism.
- Support matrix: Technology Support
- Java agent compatibility: Java Agent Setup
- Java truststore reference: Java TLS Trust
- Shared proxymock proxy reference: Language Configuration
eBPF / Java Agent
The eBPF collector captures plaintext TCP traffic from Kotlin services without language-specific setup. For TLS, the Operator-managed Java agent observes supported socket and JSSE paths inside the JVM and sends the plaintext to nettap.
Enable the Java agent on the Kotlin workload:
kubectl annotate deployment my-kotlin-app -n my-namespace \
capture.speedscale.com/enabled="true" \
capture.speedscale.com/java-agent="true" --overwrite
The agent changes the pod template, so the workload must restart. Kotlin coroutines do not create a separate capture mechanism; compatibility depends on the actual client and transport beneath them. Follow Java agent setup and framework support for supported JDKs, clients, TLS providers, and known gaps.
Kubernetes Sidecar
Kotlin/JVM uses the same sidecar configuration as Java. Standard JVM HTTP clients do not use HTTP_PROXY or HTTPS_PROXY. Configure http.proxyHost, http.proxyPort, https.proxyHost, and https.proxyPort, or use the JVM SOCKS properties for a compatible client.
If tls-out is enabled, also configure the Speedscale JKS truststore. See Java proxy settings and Java TLS trust for the shared JVM behavior.
Demo App
- Public demo: speedscale/mock-lab (
languages/kotlindirectory) - Requirements: Kotlin compiler and JDK 17 or newer
- Stack: single-file Kotlin/JVM HTTP service using
java.net.http.HttpClientto call the CNCF projects API athttps://demo-api.trafficreplay.com - Build and run:
kotlinc App.kt -include-runtime -d app.jar && java -jar app.jar - Quick validation:
./lab/tests/run_tests.sh --recording
The demo uses the JVM SOCKS proxy and JKS truststore because its standard Java HTTP client ignores HTTP_PROXY and HTTPS_PROXY.
proxymock
Use this path for the fastest Kotlin first success on a developer workstation.
- 1. Install and initialize proxymock
brew install speedscale/tap/proxymock proxymock init proxymock admin certs --jksSet `JAVA_HOME` before generating the JKS truststore. Use browser sign-in by default; API keys are intended for CI and other headless environments.
- 2. Build the demo and start recording
git clone https://github.com/speedscale/mock-lab cd mock-lab/languages/kotlin kotlinc App.kt -include-runtime -d app.jar export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:-} -DsocksProxyHost=localhost -DsocksProxyPort=4140 -DsocksProxyVersion=5 -Djavax.net.ssl.trustStore=$HOME/.speedscale/certs/cacerts.jks -Djavax.net.ssl.trustStorePassword=changeit" proxymock record -- java -jar app.jarThe SOCKS properties route `java.net.http.HttpClient` through proxymock, and the truststore properties let it verify the proxymock CA.
- 3. Generate one real workflow
./lab/tests/run_tests.sh --recordingRun the test driver from the repo root. It drives the requests that become the exported production-style trace.
- 4. Stop the recording, then run with mocks
cd mock-lab/languages/kotlin export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:-} -DsocksProxyHost=localhost -DsocksProxyPort=4140 -DsocksProxyVersion=5 -Djavax.net.ssl.trustStore=$HOME/.speedscale/certs/cacerts.jks -Djavax.net.ssl.trustStorePassword=changeit" proxymock mock -- java -jar app.jarReuse the compiled jar. The mocked run should no longer need the live downstream dependency.
- 5. Replay the same traffic against a change
cd mock-lab/languages/kotlin proxymock replay --test-against http://localhost:8080Proxy and truststore properties are not needed for replay against the local application port.
TLS Trust
Kotlin/JVM uses a Java truststore. Generate the proxymock JKS with proxymock admin certs --jks, then set javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword in JAVA_TOOL_OPTIONS as shown above. IDE users can place the same -D properties in the application's VM options. See Java TLS trust for CI, Kubernetes, corporate CA, and troubleshooting details.