backend

Implement OpenTelemetry span instrumentation and cost calculation in Rust.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/agentglass/claude-trace --skill backend-agentglass
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend
Source: https://github.com/agentglass/claude-trace/tree/main/.claude-plugin/skills/backend
Command: npx skills add https://github.com/agentglass/claude-trace --skill backend-agentglass

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive context and tooling for developing the core Rust library of the claude-trace observability project, ensuring accurate and detailed tracing of Claude Agent SDK applications.

Core Features & Use Cases

  • Span Hierarchy Definition: Understands and implements the structured span hierarchy for sessions, turns, and tool calls.
  • OTel API Integration: Guides the correct usage of OpenTelemetry APIs for span creation, context propagation, and status setting.
  • Cost Calculation: Details the logic and pricing tables for accurately calculating LLM operational costs.
  • Security Best Practices: Enforces critical security rules for handling sensitive data, including content capture, header redaction, and API key sanitization.
  • Use Case: A developer needs to add a new span attribute to track tool input hashes. This Skill provides the exact checklist and code patterns required to implement this change safely and correctly within the Rust core.

Quick Start

Refer to the SKILL.md documentation for detailed guidance on implementing span attributes.

Frequently Asked Questions about backend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I instrument OpenTelemetry spans for LLM agent tracing in Rust?

Instrument LLM agent tracing in Rust by using the OpenTelemetry API to create structured span hierarchies for sessions, turns, and tool calls. The Skill provides code patterns for span creation, context propagation, and status setting.

What semantic convention attributes should I use for Claude Agent SDK observability?

Semantic convention attributes for Claude Agent SDK observability include span hierarchy details and tool input hashes. The Skill defines these semconv attributes to ensure accurate and detailed tracing of agent applications.

How do I calculate operational costs for LLM API calls in a Rust backend?

Calculate LLM operational costs in a Rust backend by applying pricing tables and logic defined in the Skill. It details the cost calculation models required to accurately track LLM API usage expenses.

How do I redact sensitive data and sanitize API keys when tracing LLM agents?

Redact sensitive data and sanitize API keys when tracing LLM agents by enforcing security rules for content capture and header redaction. The Skill specifies protocols to prevent exposing sensitive information in traces.

Can I use this Skill to add new span attributes for tool input hashes in Rust?

You can use this Skill to add new span attributes for tool input hashes in Rust. It provides the exact checklist and code patterns required to implement span attribute changes safely within the core library.

Do I need prior OpenTelemetry experience to implement tracing for Claude Agent applications?

Prior OpenTelemetry experience is helpful but not strictly required to implement tracing for Claude Agent applications. The Skill provides comprehensive documentation covering OTel API integration and module responsibilities for Rust development.