{"library":"statsd-tags","title":"StatsD Tags Client","type":"library","description":"A lightweight Python client for StatsD, extending the basic StatsD protocol with DogStatsD-compatible tags. It simplifies sending metrics with key-value tags to StatsD servers that support the DataDog extension. The current version is 3.2.1.post1, and the project is actively maintained with a stable release cadence.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install statsd-tags"],"cli":null},"imports":["from statsd_tags import StatsClient"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/toddjames/statsd-tags","docs":null,"changelog":null,"pypi":"https://pypi.org/project/statsd-tags/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\nfrom statsd_tags import StatsClient\n\n# Configure host/port via environment variables for easy deployment\nstatsd_host = os.environ.get('STATSD_HOST', 'localhost')\nstatsd_port = int(os.environ.get('STATSD_PORT', '8125'))\n\n# Initialize the StatsD client with a prefix and default tags\nclient = StatsClient(\n    host=statsd_host,\n    port=statsd_port,\n    prefix='my_application',\n    tags={'environment': 'production'}\n)\n\n# Increment a counter metric with additional, specific tags\nclient.incr('request_count', tags={'endpoint': '/api/v1/data', 'status': '200'})\n\n# Set a gauge metric value with custom tags\nclient.gauge('cpu_utilization', 45.7, tags={'server': 'web_01'})\n\n# Record a timing metric (milliseconds) with event-specific tags\nclient.timing('db_query_time', 123.45, tags={'query_type': 'read'})\n\nprint(f\"Sent metrics (incr, gauge, timing) to StatsD at {statsd_host}:{statsd_port}\")\nprint(\"Note: StatsD uses UDP, so there's no direct confirmation of receipt.\")","lang":"python","description":"Initialize the `StatsClient` with a host, port, optional prefix, and default tags. Then use methods like `incr`, `gauge`, and `timing` to send various metric types, providing specific tags for each metric call that override or merge with default client tags.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}