OpenTelemetry for Spring Boot
The OpenTelemetry Java agent instruments Spring MVC and WebFlux, JDBC and Hibernate, Kafka, RabbitMQ, the common HTTP clients, and Logback and Log4j when the JVM starts. Add the Flowhawk extension to the same agent to tag each request with its business flow.
What you get
- Every request as a trace, with its database calls and outgoing HTTP calls, in Traces.
- Requests matched to your business flows by service and route on our side, so you see "checkout is failing at place order" rather than a list of endpoints.
- Exceptions grouped into Issues, slow and N+1 database queries on each database's page, and deploys found from
service.version. - Alerts, incidents and the on-call agent, which reads these traces when something breaks.
Set it up
1. Download the agent and the Flowhawk extension
curl -LO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
curl -L -o flowhawk-sdk.jar https://repo1.maven.org/maven2/dev/flowhawk/flowhawk-sdk/0.1.0/flowhawk-sdk-0.1.0.jar
2. Point it at Flowhawk
First create an ingest key: in the app, open Settings > API keys and pick Services. In the examples below, KEY stands for that key. Keep it out of your repository, like any other secret.
FLOWHAWK_API_KEY=KEY
FLOWHAWK_CONTROL_URL=https://api.flowhawk.dev
FLOWHAWK_ENVIRONMENT=production
OTEL_SERVICE_NAME=orders
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.flowhawk.dev
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20KEY
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production,service.version=1.4.2
The space in the header is written %20. Set service.version to your release, so a deploy shows as a change next to the flows it made better or worse.
3. Start the JVM with the agent
java -javaagent:opentelemetry-javaagent.jar -Dotel.javaagent.extensions=flowhawk-sdk.jar -jar app.jar
In a container, copy both jars into the image and set the flags once:
ENV JAVA_TOOL_OPTIONS="-javaagent:/otel/opentelemetry-javaagent.jar -Dotel.javaagent.extensions=/otel/flowhawk-sdk.jar"
Leave out the extension and the FLOWHAWK_ variables to send plain OpenTelemetry: Flowhawk still matches requests to flows by service and route on our side.
Check it arrived
Open Setup in the app. It lists each service that sent data in the last 15 minutes. If yours isn't there, Help and troubleshooting says why telemetry can be refused (a wrong key, an empty balance) and how to see it.
Common questions
Does it work with Kotlin?
Yes. The agent works on the JVM, whatever language compiled the classes. The SDK needs Java 17 or later.
Can I use the SDK without the agent?
Add dev.flowhawk:flowhawk-sdk from Maven Central and call Flowhawk.init(Flowhawk.options("orders")) first in main (Java guide).