funboost-observability

Configure Prometheus metrics, OpenTelemetry tracing, and alerting for funboost task queues.

892|166|Updated Dec 25, 2021
One-click install
npx skills add https://github.com/ydf0509/funboost --skill funboost-observability-ydf0509
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: funboost-observability
Source: https://github.com/ydf0509/funboost/tree/main/.agents/skills/funboost-observability
Command: npx skills add https://github.com/ydf0509/funboost --skill funboost-observability-ydf0509

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires funboost, prometheus_client, opentelemetry-api, opentelemetry-sdk, opentelemetry-exporter-otlp, pymongo, requests.

What problem does it solve? Adding monitoring, distributed tracing, and failure alerting to funboost message queue consumers normally requires modifying broker internals. This Skill shows how to attach production observability to any @boost-decorated function declaratively through Mixin classes and BoosterParams fields, without touching framework source code. ## Core Features & Use Cases - Prometheus Metrics: Record task counts, latency histograms, retries, and queue backlog via PrometheusConsumerMixin, with HTTP server mode for single-process and Pushgateway mode for multi-process consumers. - OpenTelemetry Tracing: Propagate W3C trace context across publishers and consumers with AutoOtelConsumerMixin and AutoOtelPublisherMixin, exporting spans to Jaeger or any OTLP-compatible backend. - Failure Alerting & Quotas: Send DingTalk, WeChat, Feishu, or webhook alerts on consecutive failures or error-rate thresholds with AlertNotifierConsumerMixin, and cap executions per period with PeriodicQuotaConsumerMixin. - Result Persistence: Save task status and return values to MongoDB via FunctionResultStatusPersistanceConfig, queryable in the funweb admin UI and usable with MongoAlertMonitor for aggregated alerts. - Use Case: An order-processing queue needs Grafana dashboards, cross-service tracing, and a WeChat alert after 5 consecutive failures. Combine the Prometheus, OTel, and AlertNotifier mixins through multiple inheritance and declare everything in one BoosterParams. ## Quick Start Add Prometheus metrics and failure alerting to my funboost task by configuring the appropriate consumer and publisher mixins in its BoosterParams.

Frequently Asked Questions about funboost-observability

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

FAQPage Schema
How do I add Prometheus metrics to a funboost consumer?▼

Use PrometheusConsumerMixin and PrometheusPublisherMixin via consumer_override_cls and publisher_override_cls in BoosterParams, or use the preconfigured PrometheusBoosterParams. Call start_prometheus_http_server(port=8000) for single-process mode, or configure a Pushgateway URL in user_options for multi-process consumers.

How to trace funboost tasks across services with OpenTelemetry?▼

Apply AutoOtelPublisherMixin and AutoOtelConsumerMixin (or OtelBoosterParams) to your tasks. The publisher injects trace context into the message and the consumer extracts it to create child spans. You must initialize a TracerProvider with an OTLP exporter before starting consumers.

Does funboost support alerting when tasks keep failing?▼

Yes, AlertNotifierConsumerMixin sends notifications to DingTalk, WeChat, Feishu, or custom webhooks. It supports a consecutive-failure strategy with a configurable threshold and an error-rate strategy over a sliding time window, plus automatic recovery notifications.

Can I limit how many times a funboost task runs per day?▼

Yes, PeriodicQuotaConsumerMixin caps total executions per period (seconds, minutes, hours, or days) with sliding or fixed windows. Unlike a rate limit, the quota can be consumed at any pace within the period, and it can be combined with the qps parameter for spacing.

Why are my OpenTelemetry spans not showing up in Jaeger?▼

The OTel mixins do not configure an exporter themselves. You must initialize a TracerProvider with a BatchSpanProcessor and OTLPSpanExporter pointing to your collector before calling consume(), otherwise spans are created but never exported.

What is the difference between AlertNotifier and CircuitBreaker in funboost?▼

AlertNotifierConsumerMixin only sends notifications when failures occur and never blocks consumption. CircuitBreakerConsumerMixin actively pauses consumption or degrades behavior when failure thresholds are exceeded. Choose alerting for visibility and circuit breaking for protection.