Langfuse.HTTP (Langfuse v0.2.0)
View SourceHTTP client for Langfuse API.
This module handles all HTTP communication with the Langfuse API, including authentication, automatic retries with exponential backoff, and telemetry instrumentation.
Authentication
Requests are authenticated using HTTP Basic Auth with the configured public key and secret key.
Retries
Failed requests are automatically retried with exponential backoff. The base delay starts at 1 second and doubles with each attempt, capped at 30 seconds. Random jitter is added to prevent thundering herd.
Telemetry
HTTP requests emit telemetry events. See Langfuse.Telemetry for details.
This module is used internally by the SDK. For direct API access,
use Langfuse.Client instead.
Summary
Types
HTTP response result.
Functions
Checks if the connection to Langfuse is working.
Makes a GET request to the Langfuse API.
Fetches a prompt from the prompts API.
Sends a batch of events to the ingestion API.
Makes a POST request to the Langfuse API.
Types
Functions
@spec auth_check() :: boolean()
Checks if the connection to Langfuse is working.
Makes a simple authenticated request to verify credentials are valid and the Langfuse server is reachable.
Returns true if the connection is successful, false otherwise.
Makes a GET request to the Langfuse API.
Returns {:error, :not_configured} if credentials are not set.
Fetches a prompt from the prompts API.
Used internally by Langfuse.Prompt.
Options
:version- Specific version number:label- Label to fetch (e.g., "production"):resolve- Whether to resolve prompt dependencies before returning (defaults totrueon server)
Sends a batch of events to the ingestion API.
Used internally by Langfuse.Ingestion to flush event batches.
Makes a POST request to the Langfuse API.
Returns {:error, :not_configured} if credentials are not set.