Skip to content

Create a New LLM Monitoring Application


  1. Navigate to Agent Monitoring > Application List.
  2. Click "Create Application".
  3. Select the LLM Monitoring Application tab.

Integration Type

On the Create Application page, the default integration is Langfuse:

Access Configuration

Three options are available here:

Integrate Python

Integrate JS/TS

Integrate Other Models/Frameworks

Integrate Python

1. Install Dependencies

pip install langfuse

2. Initialize the Client

Set the following environment variables in your application environment:

LANGFUSE_PUBLIC_KEY="app_id"
LANGFUSE_SECRET_KEY="llm_bb0f30d.....66eec"
LANGFUSE_HOST="https://llm-openway.guance.com"

Initialize in code:

from langfuse import Langfuse
langfuse = Langfuse()

Pass configuration parameters directly in code:

from langfuse import Langfuse
langfuse = Langfuse(
  public_key="app_id",
  secret_key="llm_bb0f30d.....66eec",
  host="https://llm-openway.guance.com"
)

3. Verify Connection

You can use langfuse.auth_check() to verify successful integration. This is not recommended in production because it increases application latency.

from langfuse import Langfuse
# Initialize (by constructor parameters)
langfuse = Langfuse(
    public_key="app_id",
    secret_key="llm_d9f06c320a9***6e9807",
    host="https://llm-openway.guance.com"
)
# Verify connection. This is a synchronous call, not recommended for production. This method is only for configuration validation.
if langfuse.auth_check():
    print("Langfuse client is authenticated and ready!")

If integration fails, you may encounter the following error:

langfuse.api.resources.commons.errors.unauthorized_error.UnauthorizedError: status_code: 401, body: {}

This error usually indicates that the App ID or Client Token is incorrect. Please check your parameter configuration.

For more details and end-to-end examples, see Python.

Integrate JS/TS

Note

This configuration only applies to the Langfuse JS/TS SDK v4. Version v3 is not supported.

1. Install Dependencies

npm install @langfuse/tracing @langfuse/otel @opentelemetry/sdk-node

Click to view more package information.

2. Register Credentials

Set the following environment variables in your application environment. Ensure there is a .env file in your project root and a package like dotenv to load the variables.

LANGFUSE_SECRET_KEY="llm_122f6b85d0c7454fa0f9*****d360"
LANGFUSE_PUBLIC_KEY="pk-lf-..."
LANGFUSE_BASE_URL="https://llm-openway.guance.com",

3. Initialize OpenTelemetry

The Langfuse SDK tracing is built on OpenTelemetry, so you need to set up the OpenTelemetry SDK. The LangfuseSpanProcessor is a key component for sending traces to Langfuse.

import { NodeSDK } from "@opentelemetry/sdk-node";
import { LangfuseSpanProcessor } from "@langfuse/otel";
const sdk = new NodeSDK({
  spanProcessors: [new LangfuseSpanProcessor()],
});
sdk.start();

Click to view the Ollama integration example.

For more details and end-to-end examples, see JS/TS.

Integrate Others

For integrations with other models/frameworks, such as DeepSeek, Ollama, LangChain, Dify, etc., refer to the Langfuse official documentation for configuration.

LangChain OpenTelemetry Integration

Supports integrating LangChain applications via OpenTelemetry. After integration, you can view call traces, inputs, outputs, and token consumption in the LLM monitoring application.

The system parses OpenTelemetry gen_ai related attributes and displays:

  • Input: The input content of the model call;
  • Output: The output content returned by the model;
  • Token: Input, output, and total token consumption;
  • Model, service, call status, and other related information.
Note

The displayed content depends on whether the reported data contains the corresponding gen_ai attributes. Fields that are not reported will not be displayed, but this does not affect other trace data queries.

Fill in Variables in Code

Fill in the following information on the right side of the page:

Field Description
Application Name Custom application name
Application ID Public key, supports only English letters, digits, and underscores. Used to attribute the current application in traces, logs, and metrics.
Service Address Enter the Dataway gateway address
Client Token Automatically generated after application creation, used to send data from user devices
What is a Client Token?

After creating the application, the system automatically generates a Client Token for you. This token is used to send data from user devices.

For more details, see Client Token Management.

After confirming the information is correct, click Create to complete the LLM monitoring application integration.

Feedback

Is this page helpful?