Giter Club home page Giter Club logo

scrapy-statsd's Introduction

Scrapy-Statsd

Publish Scrapy stats to statsd daemon to see your spider stats in real time.

Table of Contents

Details

Exporting scrapy's metrics into statsd required was not a perfect one to one mapping. The naming conventions and values some adjustment. Please, see them below.

Stat Names

The stats will be transformed from the forward slashed notation that is commonly seen on stats dumps to a more common dotted notation for statsd. Furthermore, if there is a spider present it will be prefixed to the stat name. For instance:

Scrapy Notation StatsD Notation
downloader/exception_count downloader.exception_count
downloader/exception_type_count/twisted.internet.error.DNSLookupError downloader.exception_type_count.twisted.internet.error.DNSLookupError
downloader/request_count downloader.request_count
downloader/response_status_count/200 downloader.response_status_count.200

Value Types

Only numeric types are exported to statsd. No other types are exported. One might be inclined why set_value is not translated into a set within statsd. There is a mismatch in the purpose of setting a non-numeric value from scarpy to statsd. The statsd set counts the number of unique items. This is fundamentally different than setting a value with Scrapy's default stats module.

Start Ignored for Counters

The operations increment or decrement do not use the parameter start. Scrapy has a notion that the stats are being collected in a single dictionary where you can check if the value has been set. Statsd doesn't act like a key value store. There is no mechanism to check if a value has been set for a given metric.

Installation

  1. Pip install the package

    pip install scrapy-statsd
    

    Note: The requirements state Scrapy version 1.0.5 or higher, but that'll be reduce once testing is done.

  2. Add the following lines to your settings.py of your Scrapy project

    STATS_CLASS = 'scrapy_statsd.statscollectors.StatsDStatsCollector'
    
    STATSD_HOST = 'localhost'
    STATSD_PORT = 8125
    

scrapy-statsd's People

Contributors

isra17 avatar lopuhin avatar vinayan3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.