Skip to main content

Muffin-Metrics

Muffin-Metrics – Send data to Graphite/StatsD from Muffin application.

Build Status http://img.shields.io/pypi/v/muffin-metrics.svg?style=flat-square http://img.shields.io/pypi/dm/muffin-metrics.svg?style=flat-square Donate

Requirements

  • python >= 3.3

Installation

Muffin-Metrics should be installed using pip:

pip install muffin-metrics

Usage

Add muffin_metrics to PLUGINS in your Muffin Application configuration.

Options

METRICS_BACKENDS – Graphite backends in format ([])

METRICS_BACKENDS = (
    ('udp': 'udp://address:port'),
    ('tcp': 'tcp://address:port'),
    ('statsd_udp': 'udp+statsd://address:port'),
    ('statsd_tcp': 'tcp+statsd://address:port'),
)
METRICS_DEFAULT = 'udp'

METRICS_DEFAULT – Default backend (None)

METRICS_FAIL_SILENTLY – Don’t raise connection’s exceptions (False)

METRICS_MAXUDPSIZE – Max size of UDP message (512)

METRICS_PREFIX – Prefix for metrics (muffin.)

Usage

@app.register('/my')
def my_view(request):
    # Context manager (group metrics to pipeline and send them as one message)
    with (yield from app.ps.metrics.client()) as metrics:
        metrics.send(42, path='answer.to.the.ultimate.question')
        # ...
        metrics.send(31, path='some.some')

    # Send data
    yield from app.ps.metrics.send(100, path='one.hungred', backend='mybackend')

    # Create client and send data
    metrics = yield from app.ps.metrics.client(backend='tcp')
    metrics.send('twenty.four', 24)
    metrics.disconnect()

    # Send data to statsd
    with (yield from app.ps.metrics.client(backend='statsd_tcp')) as client:
        client.incr('request.method.%s' % request.method)
        client.timing('response.time', timer.ms)
        client.incr('response.status.%s' % response.status)

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-metrics/issues

Contributing

Development of Muffin-Metrics happens at: https://github.com/klen/muffin-metrics

Contributors

  • klen (Kirill Klenov)

License

Licensed under a MIT license.

Metadata

Release files for muffin-metrics 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for muffin-metrics 0.1.4
File Size Uploaded Provenance Actions
muffin-metrics-0.1.4.tar.gz 6.1 kB Without provenance Details for muffin-metrics-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for muffin-metrics 0.1.4
File Interpreter ABI Platform Actions
muffin_metrics-0.1.4-py3-none-any.whl Python 3 none any Details for muffin_metrics-0.1.4-py3-none-any.whl

Total release size: 13.2 kB

Release files / muffin-metrics-0.1.4.tar.gz

Download URL muffin-metrics-0.1.4.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0882645fe64317a8d209589b6086172b4d600dc3a3c0391bdfa4444937fddd7e
BLAKE2b-256 checksum
How to use checksums
9e538831a29ec8160a9995f7142820e264a7ffc3fafd1e345d35ca65ffbac6e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / muffin_metrics-0.1.4-py3-none-any.whl

Download URL muffin_metrics-0.1.4-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29d3b74d14f62852d5b2cf30a286b2a91973b09fb7cf1c7664bfd4a011d2dc81
BLAKE2b-256 checksum
How to use checksums
e64e34aa6597ddda19de27d8ecbb158277116b85095b1deb3af7be7d9469c14e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for muffin-metrics 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page