Module Assign NameStore Str TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Import alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias alias Assign NameStore NameLoad Expr Call NameLoad NameLoad Str Str keyword NameLoad keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword NameLoad keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword NameLoad keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword NameLoad keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword Num keyword Num keyword Num keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword Num keyword Num keyword Num keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword Num keyword Num keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword BinOpMult Num Num keyword Num keyword NameLoad Expr Call NameLoad NameLoad Str Str keyword BinOpMult Num Num keyword BinOpMult Num Num keyword NameLoad Expr Call NameLoad NameLoad Str Str Expr Call NameLoad NameLoad Str Str Expr Call NameLoad NameLoad Str Str Expr Call NameLoad NameLoad Str Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad Str If CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad keyword Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad keyword Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad keyword Num keyword Num decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr orelse If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr orelse FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list Assign AttributeStore NameLoad attr Call NameLoad keyword NameLoad keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad keyword Dict Str NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword Str Return TryExcept body For TupleStore NameStore NameStore NameLoad body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad keyword Dict Str NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str Call NameLoad NameLoad decorator_list decorator_list
N/A N/A __author__ czerwin@scalyr.com N/A N/A N/A cPickle pickle N/A N/A N/A ImportError N/A N/A pickle scalyr_agent StoppableThread scalyr_agent ScalyrMonitor define_config_option define_log_field scalyr_agent.monitor_utils ServerProcessor LineRequestParser Int32RequestParser N/A __monitor__ __name__ N/A N/A define_config_option __monitor__ module Always ``scalyr_agent.builtin_monitors.graphite_monitor`` convert_to str required_option True N/A N/A define_config_option __monitor__ only_accept_local Optional (defaults to true). If true, then the plugin only accepts connections from localhost. If false, all network connections are accepted. default True convert_to bool N/A N/A define_config_option __monitor__ accept_plaintext Optional (defaults to true). If true, then the plugin accepts connections in Graphite's "plain text" procotol. default True convert_to bool N/A N/A define_config_option __monitor__ accept_pickle Optional (defaults to true). If true, then the plugin accepts connections in Graphite's "pickle" procotol. default True convert_to bool N/A N/A define_config_option __monitor__ plaintext_port Optional (defaults to 2003). The port number on which the plugin listens for plain text connections. Unused if ``accept_plaintext`` is false. default 2003 min_value 1 max_value 65535 convert_to int N/A N/A define_config_option __monitor__ pickle_port Optional (defaults to 2004). The port number on which the plugin listens for pickle connections. Unused if ``accept_pickle `` is false. default 2004 min_value 1 max_value 65535 convert_to int N/A N/A define_config_option __monitor__ max_connection_idle_time Optional (defaults to 300).  The maximum number of seconds allowed between requests before the Graphite server will close the connection. default 300.0 min_value 1 convert_to float N/A N/A define_config_option __monitor__ max_request_size Optional (defaults to 100K).  The maximum size of a single request in bytes. default N/A 100 1024 min_value 1000 convert_to int N/A N/A define_config_option __monitor__ buffer_size Optional (defaults to 100KB).  The maximum buffer size in bytes for buffering incoming requests per connection default N/A 100 1024 min_value N/A 10 1024 convert_to int N/A N/A define_log_field __monitor__ monitor Always ``graphite_monitor``. N/A N/A define_log_field __monitor__ metric The Graphite metric name. N/A N/A define_log_field __monitor__ value The Graphite metric value. N/A N/A define_log_field __monitor__ orig_time The Graphite timestamp. GraphiteMonitor N/A ScalyrMonitor N/A N/A A Scalyr agent monitor acts as a Graphite server, accepting metrics over a network connection and then sends
    them to Scalyr.
     _initialize N/A N/A self N/A N/A N/A Performs monitor-specific initialization.
         N/A N/A self __only_accept_local N/A N/A N/A self _config get only_accept_local N/A N/A self __accept_plaintext N/A N/A N/A self _config get accept_plaintext N/A N/A self __accept_pickle N/A N/A N/A self _config get accept_pickle N/A N/A self __plaintext_port N/A N/A N/A self _config get plaintext_port N/A N/A self __pickle_port N/A N/A N/A self _config get pickle_port N/A N/A self __max_connection_idle_time N/A N/A N/A self _config get max_connection_idle_time N/A N/A self __max_request_size N/A N/A N/A self _config get max_request_size N/A N/A self __buffer_size N/A N/A N/A self _config get buffer_size N/A N/A self __extra_thread None N/A N/A N/A N/A self __accept_plaintext N/A N/A self __accept_pickle N/A N/A N/A Exception Invalid config state for Graphite Monitor.  At least one of accept_plaintext or accept_pickle must be true N/A N/A N/A self __max_request_size N/A self __buffer_size N/A N/A N/A Exception N/A The max_request_size of %d cannot be greater than the buffer size of %d N/A N/A self __max_request_size N/A self __buffer_size N/A N/A self _log_write_rate N/A N/A N/A self _config get monitor_log_write_rate convert_to int default -1 N/A N/A self _log_max_write_burst N/A N/A N/A self _config get monitor_log_max_write_burst convert_to int default -1 N/A N/A self _log_flush_delay N/A N/A N/A self _config get monitor_log_flush_delay convert_to float default 1.0 min_value 0 N/A run N/A N/A self N/A N/A N/A N/A self __accept_plaintext N/A N/A text_server N/A GraphiteTextServer N/A self __only_accept_local N/A self __plaintext_port N/A self _run_state N/A self __buffer_size N/A self __max_request_size N/A self __max_connection_idle_time N/A self _logger N/A N/A text_server None N/A N/A self __accept_pickle N/A N/A pickle_server N/A GraphitePickleServer N/A self __only_accept_local N/A self __pickle_port N/A self _run_state N/A self __buffer_size N/A self __max_request_size N/A self __max_connection_idle_time N/A self _logger N/A N/A pickle_server None N/A N/A N/A self __accept_plaintext N/A N/A N/A N/A pickle_server run N/A N/A N/A N/A self __accept_pickle N/A N/A N/A N/A text_server run N/A run_text_server N/A N/A run_state N/A N/A N/A N/A N/A text_server run N/A N/A N/A self __extra_thread N/A StoppableThread target run_text_server name Graphite monitor text server thread N/A N/A N/A N/A self __extra_thread start N/A N/A N/A pickle_server run N/A stop N/A N/A self wait_on_join join_timeout N/A True 5 N/A N/A N/A N/A ScalyrMonitor stop self wait_on_join wait_on_join join_timeout join_timeout N/A N/A N/A self __extra_thread None N/A N/A N/A N/A N/A self __extra_thread stop wait_on_join wait_on_join join_timeout join_timeout N/A N/A GraphiteTextServer N/A ServerProcessor N/A N/A Accepts connections on a server socket and handles them using Graphite's plaintext protocol format, emitting
    the received metrics to the log.
     __init__ N/A N/A self only_accept_local port run_state buffer_size max_request_size max_connection_idle_time logger N/A N/A N/A Creates a new instance.

        @param only_accept_local: If true, only accept local connections.
        @param port: The port on which to accept connections.
        @param run_state: The run_state to use to control when this server should stop accepting connections and new
            requests. If 'run_state's 'stop' method is invoked, then 'run' will terminate.
        @param buffer_size: The maximum buffer size for buffering incoming requests per connection.
        @param max_request_size: The maximum size of an individual request. If this is exceeded, then the connection
            responsible is terminated.
        @param max_connection_idle_time: The maximum time to wait on a connection between requests before closing it.
        @param logger: The logger to use to record errors and metrics.
         N/A N/A self __logger logger N/A N/A self __parser N/A LineRequestParser max_request_size N/A N/A N/A ServerProcessor __init__ self port localhost_socket only_accept_local max_request_size max_request_size max_connection_idle_time max_connection_idle_time buffer_size buffer_size run_state run_state N/A execute_request N/A N/A self request N/A N/A N/A N/A N/A N/A metric value orig_timestamp N/A N/A N/A N/A request strip split N/A value N/A float value N/A orig_timestamp N/A float orig_timestamp N/A N/A N/A N/A self __logger emit_value metric value extra_fields N/A orig_time orig_timestamp N/A N/A N/A ValueError N/A N/A N/A N/A N/A self __logger warn Could not parse incoming metric line from graphite plaintext server, ignoring error_code graphite_monitor/badPlainTextLine N/A parse_request N/A N/A self request_input num_available_bytes N/A N/A N/A N/A N/A N/A self __parser parse_request request_input num_available_bytes N/A report_connection_problem N/A N/A self exception N/A N/A N/A N/A N/A N/A self __logger exception N/A Exception seen while processing Graphite connect on text port, closing connection: "%s" N/A str exception N/A N/A GraphitePickleServer N/A ServerProcessor N/A N/A Accepts connections on a server socket and handles them using Graphite's pickle protocol format, emitting
    the received metrics to the log.
     __init__ N/A N/A self only_accept_local port run_state buffer_size max_request_size max_connection_idle_time logger N/A N/A N/A Creates a new instance.

        @param only_accept_local: If true, only accept local connections.
        @param port: The port on which to accept connections.
        @param run_state: The run_state to use to control when this server should stop accepting connections and new
            requests. If 'run_state's 'stop' method is invoked, then 'run' will terminate.
        @param buffer_size: The maximum buffer size for buffering incoming requests per connection.
        @param max_request_size: The maximum size of an individual request. If this is exceeded, then the connection
            responsible is terminated.
        @param max_connection_idle_time: The maximum time to wait on a connection between requests before closing it.
        @param logger: The logger to use to record errors and metrics.
         N/A N/A self __logger logger N/A N/A self __request_parser N/A Int32RequestParser max_request_size N/A N/A N/A ServerProcessor __init__ self port localhost_socket only_accept_local max_request_size max_request_size max_connection_idle_time max_connection_idle_time buffer_size buffer_size run_state run_state N/A execute_request N/A N/A self request N/A N/A N/A N/A N/A data_object N/A N/A pickle loads request N/A N/A N/A N/A N/A N/A N/A self __logger warn Could not parse incoming metric line from graphite pickle server, ignoring error_code graphite_monitor/badUnpickle N/A N/A N/A N/A N/A metric datapoint data_object N/A N/A value N/A float N/A datapoint N/A 1 N/A orig_timestamp N/A float N/A datapoint N/A 0 N/A N/A N/A N/A self __logger emit_value metric value extra_fields N/A orig_time orig_timestamp N/A N/A N/A ValueError N/A N/A N/A N/A N/A self __logger warn Could not parse incoming metric line from graphite pickle server, ignoring error_code graphite_monitor/badPickleLine N/A parse_request N/A N/A self request_input num_available_bytes N/A N/A N/A N/A N/A N/A self __request_parser parse_request request_input num_available_bytes N/A report_connection_problem N/A N/A self exception N/A N/A N/A N/A N/A N/A self __logger exception N/A Exception seen while processing Graphite connect on pickle port, closing connection: "%s" N/A str exception N/A N/A