Musterby Elitery
Integrations

Quarkus + LangChain4j

Trace Quarkus LangChain4j AI services in Muster via Quarkus's OpenTelemetry support.

Quarkus LangChain4j brings LangChain4j into the Quarkus ecosystem. Muster captures Quarkus LangChain4j AI service calls via Quarkus's first-class OpenTelemetry support.

Setup

1. Add the OpenTelemetry extension

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-opentelemetry</artifactId>
</dependency>

2. Configure application.properties

quarkus.otel.exporter.otlp.traces.protocol=http/protobuf
quarkus.langchain4j.tracing.include-prompt=true
quarkus.langchain4j.tracing.include-completion=true

quarkus.otel.exporter.otlp.endpoint=https://app.getmuster.io/api/public/otel
quarkus.otel.exporter.otlp.headers=Authorization=Basic <base64(pk:sk)>,x-langfuse-ingestion-version=4

3. Define an AI service

@RegisterAiService
public interface MyAiService {
    @SystemMessage("You are a professional poet")
    @UserMessage("Write a poem about {topic}")
    String writeAPoem(String topic);
}

Calls to writeAPoem(...) automatically produce traces in Muster with prompt, completion, token usage, and latency.

See also