Instrumentation is application code that records operations, for example a tool’s arguments, duration, and output. New examples use Python 3.11+ or Node.js 22+ and require no Langfuse Cloud account, aiv CLI, or model key. For an existing app, keep a compatible runtime and check the validated SDK versions. AI Vision provides the account and credentials for native collection.
1. Get connection settings for your application
In the target space, open Agent Access → Agent Market → Custom Agent integrations and choose Via Langfuse SDK:- Choose your runtime language. For Node.js, select JavaScript / TypeScript → Manual instrumentation. For the minimal Python example, use Python → Already using Langfuse tracing to view connection settings. Here this option only supplies credentials: section 2 provides the complete code, so prior instrumentation is not required.
- Use Select project to choose the project for your application. To create one, enter a name and click Create project.
- In Environment variables, click Get credentials, then copy the connection settings for the selected project.
•••• mask. The mask cannot run the example. Obtain complete credentials, or ask the space administrator for authorized settings if you cannot generate them.
Replace the example URL and both placeholders with the values from that page. Set them in the terminal where you will run the application:
LANGFUSE_PUBLIC_KEY is this application’s Agent UUID, and LANGFUSE_SECRET_KEY is its SpaceKey. They are not your sign-in credentials or a model provider’s API key. Keep real values out of source control.
Checkpoint: all three values belong to the same application and space, and the application machine can reach the URL.
The screenshot shows the product connection page with demonstration projects and credentials. It does not prove a successful integration. Select a project and obtain complete credentials in your own space.
Existing Langfuse instrumentation
- In your target space’s Langfuse onboarding page, select Already using Langfuse tracing. Get the three settings for the application.
LANGFUSE_BASE_URLis the AI Vision base URL,LANGFUSE_PUBLIC_KEYis the project’s Agent UUID, andLANGFUSE_SECRET_KEYis the SpaceKey. Check SDK compatibility before changing the collection settings in a test environment. Use input approved for export. - Check the export protocol.
/api/public/otel/v1/tracesaccepts OTLP HTTP/protobuf. With the validated JS SDK 5 or 6, configure a protobuf exporter for your existingLangfuseSpanProcessor. Choose JavaScript / TypeScript in the minimal example to see the endpoint and authentication. - Restart the test process and send a request with a known tool or model call. Record the Trace ID, then verify the Trace in AI Vision. Match the call name, input, and output. AI Vision stores the data in its native pipeline. Choose SigNoz if the list shows a source selector.
2. Choose a language and run your first record
Complete only one of the following language tabs. The commands use Bash/zsh syntax. Keep the threeLANGFUSE_* environment variables from section 1 in your terminal. Both programs record local operations without model calls or model charges.
Choose JavaScript / TypeScript on Node.js 22 to run a local tool. After reading back this Trace, check the output of normalize-input.
- Python
- JavaScript / TypeScript
This generic manual Span example checks whether a record reaches the platform. A Span represents one operation. The example uses Python 3.11+ and Langfuse 5.x, with 5.0.2 as the verified SDK baseline. These versions are for a new tutorial environment. Existing compatible SDKs do not need an upgrade to connect; collection with Python SDK 3.15.0 / 4.16.0 is also verified, as listed in the compatibility table below. If your interpreter is called Save this code as In the directory containing the file, run it from the same terminal where you set the environment variables:The terminal should print
python3, replace python in both installation and execution commands. LangChain, LangGraph, Deep Agents and OpenAI use their integration-page dependencies; other frameworks, including Google ADK, retain their own version requirements.example.py:AI Vision trace_id: .... The finally block flushes pending records and shuts down the client before the short-lived process exits. Continue to section 3 to read the record back from the platform.3. Verify this Trace in AI Vision
- Copy this run’s
trace_idfrom the terminal. Select the same space and project on the Langfuse integration page. - In Verify this request, enter the ID in Trace ID for this request. Enter an independently known expected Span count if available, then select Verify this Trace.
- Check the unique Span count, storage count, completeness, parent relationships, and usage. Use the shared verification guide for partial or unknown results and affected Span IDs. Select Open this Trace. For an existing integration, find the tool or model call you triggered. For a starter example, check the following values.
Completion check: you can read this run’s Trace in the selected project and match its input and output. Neither starter calls a model: when the backend confirms there are no billable calls, usage coverage is not applicable. Missing evidence is unknown, not zero consumption. Reading all stored Spans checks transport and readback; it does not establish complete application instrumentation.
The connected label or historical Trace count cannot verify this run. If the record is missing, inspect SDK export logs. For connection errors, check that the application machine can reach the URL. For authentication errors, check complete credentials, space, and project; a masked key cannot authenticate. Refresh a time range covering this run, then follow No data troubleshooting if needed.
The name, input, and output in this diagram match the minimal Python example. After verifying your first record, instrument a real application request.
4. Instrument your application
No existing Langfuse instrumentation
Return to the integration page and choose your language and framework. Node.js offers LangChain, LangGraph, OpenAI, and Manual instrumentation. Use that example’s installation command. Choose Add to existing code to instrument your business code, or Run a complete example for a standalone program. Complete framework and OpenAI examples need a model provider’s API key, model name, and endpoint. These come from the provider and are separate from the three AI VisionLANGFUSE_* settings. Model connections configured in AI Vision for diagnosis are not automatically passed to your Agent. The manual instrumentation starter needs no model configuration; configure actual model calls in your application when you add them.
For Node.js, initialize OpenTelemetry once at service startup. If an SDK already exists, add the Langfuse processor to it. Use a callback, wrapper, or manual observation around actual model and tool operations. Keep the shared SDK alive between requests and close it only after all requests finish at service shutdown. Installing dependencies and setting environment variables alone does not record internal application calls.
The OpenAI JavaScript starter remains a non-streaming Chat Completions example. For text streaming, use the public lifecycle API example, which preserves completed records on cancellation or early exit. Keep the shared SDK alive until all requests finish, and do not instrument the same request twice.
Official references: JS/TS SDK, LangChain / LangGraph, and OpenAI JS. Official pages may show newer major versions. For a new example environment, use the installation commands here or on the relevant framework integration page. For an existing application, check its dependencies against the verified scope below; an upgrade solely to connect is unnecessary.
View historical records from external Langfuse
In the original Langfuse project, note one record’s Trace ID and timestamp. In Agent traces in AI Vision, choose the space and Agent that can query that external project, then set a time range covering the request. When SigNoz / Langfuse appears, select Langfuse. Search for the Trace ID and compare a tool or model call. When there is one source, the selector is omitted. If the record is missing, ask an administrator to verify the Agent is bound to the original project, then check the time range.
To investigate new requests, send them to native ingestion. For a tool failure, open the new Trace and run a rule diagnosis. To see what changed, compare two Traces from the native list. External Langfuse records are available for queries. Rule diagnosis and Trace comparison use native records. See the official Langfuse data model for its object definitions.
Compatibility
The official Langfuse integration catalog and AI Vision validation have separate scopes. Environment variables configure the connection; frameworks still need their callback, wrapper, or exporter. “Already using Langfuse tracing” does not mean every custom framework is verified. See Custom Agent integrations if you are still choosing collection. AI Vision supports collection with the verified older and newer SDK versions below, using the same collection endpoint. Existing compatible SDKs do not need an upgrade to connect. Retain the instrumentation APIs and dependencies for your installed version instead of copying newer SDK examples verbatim. The table records specific verified baselines; it does not establish validation of every release in a major series or every framework combination.
This page uses Python SDK 5 / JS SDK 6 to provide a consistent set of steps for reproducing the integration; these example versions are not minimum connection requirements. Each framework retains its own dependency constraints, including Google ADK. AI Vision accepts OTLP HTTP/protobuf. The verified JS 5.14.0 / 6.0.0 integrations require an explicit protobuf exporter because the default JS JSON exporter is not supported.
Collection SDK versions and query API versions have separate compatibility scopes. AI Vision supports the v1 compatibility query endpoints for Trace, Observation and Session. Here v1 / v2 refer to query API versions, independently of SDK major versions; this does not imply support for every Langfuse v1 API. Python SDK4 reads Observation v1 through
api.legacy.observations_v1. Langfuse v2 queries are not yet supported.
Data collected with Python SDK 5 / JS SDK 6 can be queried through AI Vision’s pages, native API or CLI. Python SDK5 removed SDK4’s legacy read methods, so api.legacy.observations_v1 cannot be reused in SDK5. The collection validation above does not establish validation of JS 5 / JS 6 query clients. Prompt management, offline experiments and historical data migration require separate assessment. Application plugin Privacy mode does not automatically filter SDK exports; control content in your instrumentation.
SpaceKeys are credentials. Keep their actual values out of public documentation and source code.
Langfuse SDK documentation


