Skip to content

Add metrics collection support #44

@Nancy-Chauhan

Description

@Nancy-Chauhan

Feature Request\n\nWhile the SDK has a Metric model and can serialize/send metrics, there's no high-level API for collecting metrics from an application.\n\n## Proposed API\n\npython\nfrom acme_sdk.metrics import MetricsCollector, Counter, Histogram\n\ncollector = MetricsCollector(client=client)\n\n# Define metrics\nrequest_count = collector.counter(\n name="http.request.count",\n description="Total HTTP requests",\n tags={"service": "api"},\n)\n\nrequest_duration = collector.histogram(\n name="http.request.duration",\n description="Request duration in ms",\n buckets=[10, 50, 100, 250, 500, 1000],\n)\n\n# Record values\nrequest_count.increment()\nrequest_duration.record(42.5)\n\n# Auto-flush every 60 seconds\ncollector.start(flush_interval=60)\n\n\n## Requirements\n\n- Counter, Gauge, Histogram, Summary metric types\n- Thread-safe recording\n- Periodic background flush\n- Tags/labels support\n- Integration with existing exporters\n\nThis is a large feature that should be scoped carefully for v2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv2.0Targeted for v2.0 release

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions