maple-python-style

Initialize module-scoped OpenTelemetry tracing, metrics, and logging for Maple Python services.

1.6k|107|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/Makisuo/maple --skill maple-python-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maple-python-style
Source: https://github.com/Makisuo/maple/tree/main/skills/maple-python-style
Command: npx skills add https://github.com/Makisuo/maple --skill maple-python-style

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishes a consistent OpenTelemetry setup pattern for Maple applications by providing module-scope tracer and meter initialization, reducing boilerplate and ensuring best practices across services.

Core Features & Use Cases

  • Module-scoped initialization for tracer and meter objects to reduce duplication.
  • Decorators for bounded work and clear span boundaries to improve observability.
  • Error handling and logging integration with OTLP exporters and LoggingInstrumentor for end-to-end visibility.
  • Inline endpoint and ingest key configuration to simplify deployment without env-tangle in code paths.
  • OTLP export and instrumentation for FastAPI and workers to enable end-to-end tracing and metrics.

Quick Start

Import the maple-python-style module and call init_observability() before starting components to enable tracing, metrics, and logs.

Frequently Asked Questions about maple-python-style

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

FAQPage Schema
How do I set up OpenTelemetry tracing and metrics for a FastAPI application?

You can establish OpenTelemetry tracing by calling init_observability() before starting FastAPI components. This provides module-scoped initialization for tracer and meter objects, reducing boilerplate while ensuring consistent observability across services.

What is module-scoped OpenTelemetry initialization and why use it?

Module-scoped OpenTelemetry initialization sets up tracer and meter objects at the module level to reduce duplication. It ensures consistent observability best practices across backend services by providing a single initialization point with an initialization guard to avoid reinitialization.

Can I use OpenTelemetry decorators to define span boundaries for worker tasks?

Yes, you can use decorators for bounded work to define clear span boundaries for worker tasks. This approach improves observability by automatically capturing tracing and metrics data for your background workers without manual span management.

Does this OpenTelemetry setup support logging integration with OTLP exporters?

Yes, the setup supports logging integration using OTLP exporters and LoggingInstrumentor for end-to-end visibility. It captures traces, metrics, and logs together, applying proper resource attributes across FastAPI, worker tasks, and CLI utilities.

How do I configure inline endpoints and ingest keys for OpenTelemetry without environment variable conflicts?

You can configure inline endpoint and ingest key settings directly to simplify deployment. This approach avoids env-tangle in code paths while satisfying requirements for capturing traces, metrics, and logs with OTLP exporters.

Why does my OpenTelemetry initialization run multiple times and how can I prevent it?

OpenTelemetry initialization might run multiple times if not guarded properly. This setup includes an initialization guard specifically to avoid reinitialization, ensuring module-scoped tracer and meter objects are only configured once during application startup.