Agentsop Observability Setup
agentsope/SkillAlchemy
Enhancement-overlay skill — the DECISION + WIRING layer for LM observability that the single-backend skills [[langsmith]], [[phoenix]], [[mlflow]] do NOT cover.
Langfuse SDK best practices, patterns, and idiomatic usage. An agent skill from jeremylongshore/tons-of-skills-marketplace.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-sdk-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/langfuse-sdk-patterns .claude/skills/langfuse-sdk-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "langfuse-sdk-patterns" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/langfuse-sdk-patterns into .claude/skills/langfuse-sdk-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse-sdk-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/langfuse-sdk-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-sdk-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/.curated/langfuse-sdk-patterns .agents/skills/langfuse-sdk-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "langfuse-sdk-patterns" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/langfuse-sdk-patterns into .agents/skills/langfuse-sdk-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse-sdk-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-sdk-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/.curated/langfuse-sdk-patterns .cursor/skills/langfuse-sdk-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "langfuse-sdk-patterns" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/langfuse-sdk-patterns into .cursor/skills/langfuse-sdk-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse-sdk-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jeremylongshore/tons-of-skills-marketplace.git --path skills/.curated/langfuse-sdk-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-sdk-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/.curated/langfuse-sdk-patterns .gemini/skills/langfuse-sdk-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "langfuse-sdk-patterns" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/langfuse-sdk-patterns into .gemini/skills/langfuse-sdk-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse-sdk-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-sdk-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/.curated/langfuse-sdk-patterns .github/skills/langfuse-sdk-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "langfuse-sdk-patterns" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/langfuse-sdk-patterns into .github/skills/langfuse-sdk-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse-sdk-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-sdk-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/.curated/langfuse-sdk-patterns .opencode/skills/langfuse-sdk-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "langfuse-sdk-patterns" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/langfuse-sdk-patterns into .opencode/skills/langfuse-sdk-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse-sdk-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
langfuse-sdk-patternsLangfuse SDK best practices, patterns, and idiomatic usage. An agent skill from jeremylongshore/tons-of-skills-marketplace.
Langfuse SDK Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace. Langfuse SDK best practices, patterns, and idiomatic usage. Use when learning Langfuse SDK patterns, implementing proper tracing, or following best practices for LLM observability. Trigger with phrases like "langfuse patterns", "langfuse best practices", "langfuse SDK guide", "how to use langfuse", "langfuse idioms".
Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/implementation.md`). Compatibility notes: Designed for Claude Code
It sits in AI & LLM Engineering, covering LLM observability. It works with Langfuse and OpenTelemetry. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.
Read from SKILL.md and the folder at commit 80f86df. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteEditFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
langfuse.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Designed for Claude Code
From compatibility in the SKILL.md frontmatter.
Langfuse SDK Patterns loads about 2.3k tokens when it runs, and up to ~3.5k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 397 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jeremylongshore/tons-of-skills-marketplace at commit 80f86df, republished under its MIT licence (© jeremylongshore). 397 words, ~2,342 tokens.
.claude/skills/langfuse-sdk-patterns/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Production-quality patterns for the Langfuse SDK: singleton clients, the observe wrapper, startActiveObservation for nested traces, session tracking, graceful shutdown, and error-safe tracing.
langfuse-install-auth setup@langfuse/tracing, @langfuse/otel, @opentelemetry/sdk-node// src/lib/langfuse.ts -- single file, import everywhere
import { LangfuseClient } from "@langfuse/client";
import { LangfuseSpanProcessor } from "@langfuse/otel";
import { NodeSDK } from "@opentelemetry/sdk-node";
// Singleton client for prompts, datasets, scores
let client: LangfuseClient | null = null;
export function getLangfuseClient(): LangfuseClient {
if (!client) {
client = new LangfuseClient();
}
return client;
}
// One-time OTel setup (call at app entry point)
let sdk: NodeSDK | null = null;
export function initTracing(): NodeSDK {
if (!sdk) {
sdk = new NodeSDK({
spanProcessors: [new LangfuseSpanProcessor()],
});
sdk.start();
// Graceful shutdown on process exit
const shutdown = async () => {
await sdk?.shutdown();
process.exit(0);
};
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);
}
return sdk;
}Legacy v3 singleton:
import { Langfuse } from "langfuse";
let instance: Langfuse | null = null;
export function getLangfuse(): Langfuse {
if (!instance) {
instance = new Langfuse({
flushAt: 15,
flushInterval: 10000,
});
process.on("beforeExit", () => instance?.shutdownAsync());
}
return instance;
}observe Wrapper for Existing FunctionsThe observe wrapper is the most ergonomic way to add tracing. It wraps any function and auto-creates a span.
import { observe, updateActiveObservation } from "@langfuse/tracing";
// Wrap existing functions -- no internal changes needed
const fetchUserProfile = observe(async (userId: string) => {
updateActiveObservation({ input: { userId } });
const profile = await db.users.findById(userId);
updateActiveObservation({ output: { found: !!profile } });
return profile;
});
// Mark LLM calls as generations
const summarize = observe(
{ name: "summarize-text", asType: "generation" },
async (text: string) => {
updateActiveObservation({ model: "gpt-4o-mini", input: text });
const result = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: `Summarize: ${text}` }],
});
const output = result.choices[0].message.content;
updateActiveObservation({
output,
usage: {
promptTokens: result.usage?.prompt_tokens,
completionTokens: result.usage?.completion_tokens,
},
});
return output;
}
);
// When called inside another observed function, spans auto-nest
const pipeline = observe(async (userId: string) => {
const profile = await fetchUserProfile(userId);
const summary = await summarize(profile.bio);
return { profile, summary };
});startActiveObservation for Inline ControlUse when you need fine-grained control over observation lifecycle within a function:
import { startActiveObservation, updateActiveObservation } from "@langfuse/tracing";
async function processOrder(orderId: string) {
return await startActiveObservation("process-order", async () => {
updateActiveObservation({ input: { orderId } });
// Nested spans are automatic
const validated = await startActiveObservation("validate", async () => {
const result = await validateOrder(orderId);
updateActiveObservation({ output: { valid: result.valid } });
return result;
});
if (!validated.valid) {
updateActiveObservation({ output: { error: "validation failed" } });
return { success: false };
}
// Generation span for LLM call
const description = await startActiveObservation(
{ name: "generate-confirmation", asType: "generation" },
async () => {
updateActiveObservation({ model: "gpt-4o-mini" });
const result = await generateConfirmation(orderId);
updateActiveObservation({ output: result });
return result;
}
);
updateActiveObservation({ output: { success: true } });
return { success: true, description };
});
}Link traces across conversation turns for user-level analytics:
// v4+: Set session/user via observation metadata
await startActiveObservation("chat-turn", async () => {
updateActiveObservation({
metadata: {
sessionId: "session-abc-123",
userId: "user-456",
},
});
// All nested observations inherit this context
await handleUserMessage(message);
});
// v3: Set directly on trace
const trace = langfuse.trace({
name: "chat-turn",
sessionId: "session-abc-123", // Groups traces into a session
userId: "user-456", // Links to user analytics
input: { message },
});Never let tracing failures break your application:
import { observe, updateActiveObservation } from "@langfuse/tracing";
const safeObserve = <T extends (...args: any[]) => Promise<any>>(
name: string,
fn: T
): T => {
return (async (...args: Parameters<T>) => {
try {
return await observe({ name }, async () => {
updateActiveObservation({ input: args });
const result = await fn(...args);
updateActiveObservation({ output: result });
return result;
})();
} catch (tracingError) {
// If tracing fails, still run the function
console.warn(`Tracing error in ${name}:`, tracingError);
return fn(...args);
}
}) as T;
};
// Usage -- function works even if Langfuse is down
const processRequest = safeObserve("process-request", async (input: string) => {
return await callLLM(input);
});// Always use try/finally to ensure .end() is called
const span = trace.span({ name: "risky-operation", input: data });
try {
const result = await riskyOperation(data);
span.end({ output: result });
return result;
} catch (error) {
span.end({ level: "ERROR", statusMessage: String(error) });
throw error;
}| Anti-Pattern | Problem | Correct Pattern |
|---|---|---|
new Langfuse() per request | Memory leaks, duplicate traces | Singleton client |
| Awaiting flush in hot path | Adds latency to every request | Background flush, shutdown handler |
| Logging full request bodies | Trace payloads too large | Truncate/summarize inputs |
Missing .end() on spans (v3) | Spans show "in progress" forever | Use try/finally or observe wrapper |
| Hardcoding API keys | Security risk | Environment variables only |
Use this skill to produce a small integration plan and implementation diff: one process-lifetime client, trace and observation names that describe the user operation, safe input/output capture, and a shutdown path that drains pending events. Record the SDK generation assumed by the code so a future upgrade does not mix v3 span APIs with the v4+ OpenTelemetry APIs.
Treat observability as non-critical infrastructure. A tracing export failure
must be logged with enough context to diagnose it, but it must not replace or
mask the application result. Avoid retrying a failed user operation merely to
emit telemetry; instead rely on the SDK queue and alert on sustained export
failures. Confirm legacy spans are ended in a finally block so an exception
does not leave a permanently in-progress trace.
For a request handler, create an active observation named checkout-request,
attach a bounded summary of the request, call the business function once, then
attach its result summary. On process shutdown, await the tracing SDK shutdown
before closing the HTTP server. This gives one trace per request without adding
an extra network call to the request's success path.
For OpenAI/LangChain tracing examples, see langfuse-core-workflow-a.
© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in skills/.curated/langfuse-sdk-patterns of jeremylongshore/tons-of-skills-marketplace.
Open the folder on GitHubat commit 80f86df
Langfuse SDK Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Langfuse SDK Patterns this skilljeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2.3k | Automated safety check: Pass | MIT | |
| Agentsop Observability Setupagentsope/SkillAlchemy | 466 | — | ~4.4k | Automated safety check: Pass | MIT | |
| Olore Langfuse Latestolorehq/olore | 104 | — | ~1.2k | Automated safety check: Pass | MIT | |
| Telemetry AnalyzerIBM/ibm-watsonx-orchestrate-adk | 178 | — | ~10k | Automated safety check: Notes | MIT | |
| Ak Dev New Tracing Provideryaalalabs/agent-kernel | 192 | — | ~3.5k | Automated safety check: Pass | Apache-2.0 | |
| Backend Dev Guidelineslangfuse/langfuse | 36k | — | ~1.9k | Automated safety check: Pass | Custom licence |
agentsope/SkillAlchemy
Enhancement-overlay skill — the DECISION + WIRING layer for LM observability that the single-backend skills [[langsmith]], [[phoenix]], [[mlflow]] do NOT cover.
olorehq/olore
Local Langfuse documentation reference (latest). An agent skill from olorehq/olore.
IBM/ibm-watsonx-orchestrate-adk
A skill your agent uses when the user wants to analyze agent telemetry traces to find bugs and get fix recommendations — walks through exporting traces from a local or remote watsonx Orchestrate…
yaalalabs/agent-kernel
Step-by-step guide for adding a new observability/tracing provider to Agent Kernel.
langfuse/langfuse
Build or review Langfuse backend code. An agent skill from langfuse/langfuse.
ag2ai/build-with-ag2
Add OpenTelemetry traces to an AG2 beta Agent via TelemetryMiddleware (autogen.beta.middleware.builtin).
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.
jeremylongshore/tons-of-skills-marketplace
Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.
jeremylongshore/tons-of-skills-marketplace
Execute proactive auto-loading: automatically detects and loads agents.md files.
jeremylongshore/tons-of-skills-marketplace
Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.
jeremylongshore/tons-of-skills-marketplace
Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.
Works with
Categories
Langfuse SDK best practices, patterns, and idiomatic usage. An agent skill from jeremylongshore/tons-of-skills-marketplace. Langfuse SDK Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace. Langfuse SDK best practices, patterns, and idiomatic usage.
Langfuse SDK Patterns fits situations like: learning Langfuse SDK patterns; implementing proper tracing; following best practices for LLM observability; with phrases like langfuse patterns.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a claude-code`. Or copy the skill folder (skills/.curated/langfuse-sdk-patterns in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/langfuse-sdk-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a codex`. Or copy the skill folder (skills/.curated/langfuse-sdk-patterns in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/langfuse-sdk-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-sdk-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/langfuse-sdk-patterns, .gemini/skills/langfuse-sdk-patterns, .github/skills/langfuse-sdk-patterns and .opencode/skills/langfuse-sdk-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Langfuse SDK Patterns is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit. Compatibility (from SKILL.md): Designed for Claude Code.
SKILL.md names 1 domain. As links in the text: langfuse.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Langfuse SDK Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Langfuse SDK Patterns: Agentsop Observability Setup (agentsope/SkillAlchemy, 466 stars), Olore Langfuse Latest (olorehq/olore, 104 stars), Telemetry Analyzer (IBM/ibm-watsonx-orchestrate-adk, 178 stars) and Ak Dev New Tracing Provider (yaalalabs/agent-kernel, 192 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 2026.
Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.