Langfuse hosting integration

Open
#2,283 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
clickhouse, csharp, docker, postgresql, redis

Research direction

Start by reviewing the linked implementation and documentation at https://github.com/EwanT-21/aspire-langfuse, then compare its APIs and dependency setup with existing hosting integrations in the Toolkit. The issue asks for feedback on the API, first PR scope, and local blob storage default; agree on those decisions before adapting the integration. Done means a Toolkit-convention implementation with its hosting behavior and tests agreed with maintainers.

Written by the indexing model from the issue text.

Description

integration request :mailbox_with_mail:
Aspire issue link

None existing,

Overview

I’d like to propose CommunityToolkit.Aspire.Hosting.Langfuse, a hosting integration for Langfuse (https://langfuse.com).

Running Langfuse locally requires coordinating its web and worker containers with PostgreSQL, Redis, ClickHouse, and blob storage. Setting this up in an Aspire AppHost involves configuring the connections, secrets, endpoints, and startup dependencies across those services.

The proposed integration would make Langfuse available through AddLangfuse, allowing developers to:

  • Start a local Langfuse stack alongside their application, with health checks and optional data persistence.
  • Reuse PostgreSQL, Redis, and storage resources already defined in their AppHost, or supply externally hosted dependencies.
  • Reference an existing self-hosted or Langfuse Cloud instance through AddLangfuseEndpoint.
  • Pass the Langfuse URL and project API keys to application resources through WithReference.

Application instrumentation would remain configured through the application’s SDK or OpenTelemetry exporter. The integration would handle hosting and connection configuration.

Usage example
var builder = DistributedApplication.CreateBuilder(args);

var langfuse = builder.AddLangfuse("langfuse", options =>
{
    options.UseDataVolumes = true;
});

builder.AddProject<Projects.Api>("api")
    .WithReference(langfuse)
    .WaitFor(langfuse);

Existing project API keys can be supplied through Aspire parameters:

var publicKey = builder.AddParameter("langfuse-public-key");
var secretKey = builder.AddParameter("langfuse-secret-key", secret: true);

langfuse.WithApiKeys(publicKey, secretKey);
Additional context

I started this integration because I need to use Langfuse with Aspire for a project at my current job.

The implementation is available under the MIT license, with source and documentation (https://github.com/EwanT-21/aspire-langfuse) and a published pre-release NuGet package (https://www.nuget.org/packages/EwanT21.Aspire.Hosting.Langfuse).

It targets .NET 10 and Aspire 13.6.1, with Langfuse v4 containers. It includes unit tests, a Docker smoke test harness for trace ingestion and retrieval, and an Ollama agent example that exports traces to Langfuse. CI builds, tests, and packages the integration.

Publishing through Aspire requires explicitly configured blob storage and deployment secrets in place of the local development defaults.

I’d like to contribute this implementation to the Toolkit and adapt it to the project’s conventions. I’d appreciate feedback on the proposed API, which features to include in the first PR, and whether to keep Aspire’s Azure Blob Storage emulator as the default for local development.

Help us help you

Yes, I'd like to be assigned to work on this item

Dominant language
C#
Stars
632
Forks
204
Avg merge
2d 14h
Merged PRs (30d)
92

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CommunityToolkit/Aspire

All issues in CommunityToolkit/Aspire

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.