Skip to main content

Langfuse Setup: Connect Your Telemetry

Connect your Langfuse account to Jetty Agent for automated LLM usage analysis and optimization PRs.

Prerequisites

  • A Langfuse account (cloud at cloud.langfuse.com or self-hosted)
  • A Langfuse project with existing traces
  • A Jetty account

1. Get Your Langfuse API Keys

In your Langfuse project settings, create or find your API keys:

  • Public Key — Used to identify your project
  • Secret Key — Used to authenticate API requests (stored encrypted)

If you're self-hosting Langfuse, you'll also need your instance URL.

2. Connect via the Jetty Dashboard

Navigate to the connect flow at https://launch.jetty.io/connect:

  1. Sign in — Create an account or sign in with Google
  2. Enter credentials — Provide your Langfuse public key, secret key, and host URL
  3. Select project — Choose which Langfuse project to analyze
  4. (Optional) Connect GitHub — Install the Jetty GitHub App to enable automatic PR creation

3. Security

Your credentials are handled securely:

  • Read-only access — Jetty only retrieves traces, never modifies your Langfuse data
  • Encrypted at rest — Secret keys stored with AES-256-GCM encryption
  • Validated on entry — Credentials verified via GET /api/public/projects before storage

4. Trigger Analysis

Once connected, Jetty triggers an agentic workflow that:

  1. Fetches your recent traces from Langfuse
  2. Analyzes token usage patterns and cost hotspots
  3. Identifies latency outliers and prompt inefficiencies
  4. Produces structured recommendations with estimated savings

The analysis runs asynchronously. Results are delivered to your dashboard via webhook callback.

5. Review Recommendations

Analysis results appear in your Jetty dashboard as pending recommendations. Each includes:

  • Summary — What was found and estimated impact
  • Specific changes — File-level code modifications
  • Cost estimates — Projected savings

No code changes happen without your explicit approval.

6. Create PRs

For each approved recommendation:

  1. Click Create PR in the dashboard
  2. Jetty generates a pull request via the GitHub App
  3. Review and merge in GitHub as you normally would

The Feedback Loop

Every merged PR feeds back into future analyses. Jetty tracks which recommendations were accepted, modified, or rejected to improve over time.

API Integration

If you prefer to trigger analysis programmatically:

curl -X POST "https://launch.jetty.io/api/admin/users/$USER_ID/trigger-analysis" \
-H "Authorization: Bearer $JETTY_API_TOKEN" \
-H "Content-Type: application/json"

Next Steps