Code Monkey home page Code Monkey logo

snap-plugin-collector-etcd's Introduction

snap collector plugin - etcd

This plugin collects metrics from etcd's /metrics endpoint.

It's used in the snap framework.

  1. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  3. License
  4. Acknowledgements

Getting Started

System Requirements

Operating systems

All OSs currently supported by snap:

  • Linux/amd64
  • Darwin/amd64

Installation

Clone repo into $GOPATH/src/github.com/intelsdi-x/:

$ git clone https://github.com/intelsdi-x/snap-plugin-collector-etcd.git

Build the plugin by running make within the cloned repo:

$ make

This builds the plugin in /build/rootfs/

Configuration and Usage

  • Set up the snap framework
  • Ensure $SNAP_PATH is exported export SNAP_PATH=$GOPATH/src/github.com/intelsdi-x/snap/build

Documentation

Collected Metrics

This plugin collects the raw counters and a few other metrics from etcd. It is focused on the ones which are easily parsable and excludes ones which are formatted specifically for a Prometheus metric. There are also a handful of derivatives which take a sum over count average.

Here are the derivatives:

/intel/etcd/derivative/etcd_server_proposal_durations_avg
/intel/etcd/derivative/etcd_snapshot_save_marshalling_durations_seconds_avg
/intel/etcd/derivative/etcd_storage_db_compaction_pause_duration_milliseconds_avg
/intel/etcd/derivative/etcd_storage_db_compaction_total_duration_milliseconds_avg
/intel/etcd/derivative/etcd_storage_index_compaction_pause_duration_milliseconds_avg
/intel/etcd/derivative/etcd_wal_fsync_durations_seconds_avg

And the raw metrics:

/intel/etcd/etcd_server_file_descriptors_used_total
/intel/etcd/etcd_server_pending_proposal_total
/intel/etcd/etcd_server_proposal_durations_seconds_count
/intel/etcd/etcd_server_proposal_durations_seconds_sum
/intel/etcd/etcd_server_proposal_failed_total
/intel/etcd/etcd_snapshot_save_marshalling_durations_seconds_count
/intel/etcd/etcd_snapshot_save_marshalling_durations_seconds_sum
/intel/etcd/etcd_snapshot_save_total_durations_seconds_count
/intel/etcd/etcd_snapshot_save_total_durations_seconds_sum
/intel/etcd/etcd_storage_db_compaction_pause_duration_milliseconds_count
/intel/etcd/etcd_storage_db_compaction_pause_duration_milliseconds_sum
/intel/etcd/etcd_storage_db_compaction_total_duration_milliseconds_count
/intel/etcd/etcd_storage_db_compaction_total_duration_milliseconds_sum
/intel/etcd/etcd_storage_db_total_size_in_bytes
/intel/etcd/etcd_storage_delete_total
/intel/etcd/etcd_storage_events_total
/intel/etcd/etcd_storage_index_compaction_pause_duration_milliseconds_count
/intel/etcd/etcd_storage_index_compaction_pause_duration_milliseconds_sum
/intel/etcd/etcd_storage_keys_total
/intel/etcd/etcd_storage_pending_events_total
/intel/etcd/etcd_storage_put_total
/intel/etcd/etcd_storage_range_total
/intel/etcd/etcd_storage_slow_watcher_total
/intel/etcd/etcd_storage_txn_total
/intel/etcd/etcd_storage_watch_stream_total
/intel/etcd/etcd_storage_watcher_total
/intel/etcd/etcd_store_expires_total
/intel/etcd/etcd_store_watch_requests_total
/intel/etcd/etcd_store_watchers
/intel/etcd/etcd_wal_fsync_durations_seconds_count
/intel/etcd/etcd_wal_fsync_durations_seconds_sum
/intel/etcd/etcd_wal_last_index_saved
/intel/etcd/go_gc_duration_seconds_count
/intel/etcd/go_gc_duration_seconds_sum
/intel/etcd/go_goroutines
/intel/etcd/go_memstats_alloc_bytes
/intel/etcd/go_memstats_alloc_bytes_total
/intel/etcd/go_memstats_buck_hash_sys_bytes
/intel/etcd/go_memstats_frees_total
/intel/etcd/go_memstats_gc_sys_bytes
/intel/etcd/go_memstats_heap_alloc_bytes
/intel/etcd/go_memstats_heap_idle_bytes
/intel/etcd/go_memstats_heap_inuse_bytes
/intel/etcd/go_memstats_heap_objects
/intel/etcd/go_memstats_heap_released_bytes_total
/intel/etcd/go_memstats_heap_sys_bytes
/intel/etcd/go_memstats_last_gc_time_seconds
/intel/etcd/go_memstats_lookups_total
/intel/etcd/go_memstats_mallocs_total
/intel/etcd/go_memstats_mcache_inuse_bytes
/intel/etcd/go_memstats_mcache_sys_bytes
/intel/etcd/go_memstats_mspan_inuse_bytes
/intel/etcd/go_memstats_mspan_sys_bytes
/intel/etcd/go_memstats_next_gc_bytes
/intel/etcd/go_memstats_other_sys_bytes
/intel/etcd/go_memstats_stack_inuse_bytes
/intel/etcd/go_memstats_stack_sys_bytes
/intel/etcd/go_memstats_sys_bytes
/intel/etcd/process_cpu_seconds_total
/intel/etcd/process_max_fds
/intel/etcd/process_open_fds
/intel/etcd/process_resident_memory_bytes
/intel/etcd/process_start_time_seconds
/intel/etcd/process_virtual_memory_bytes

Examples

This is done from the snap directory.

In one terminal window, start the snap daemon (in this case with logging set to 1 and trust disabled):

$ $SNAP_PATH/bin/snapd -l 1 -t 0

In another terminal window: Load etcd plugin

$ $SNAP_PATH/bin/snapctl plugin load <path to built etcd plugin>

See available metrics for your system

$ $SNAP_PATH/bin/snapctl metric list

Create a task manifest file

{
    "version": 1,
    "schedule": {
        "type": "simple",
        "interval": "1s"
    },
    "workflow": {
        "collect": {
            "metrics": {
                "/intel/etcd/derivative/etcd_wal_fsync_durations_seconds_avg": {},
                "/intel/etcd/etcd_wal_fsync_durations_seconds_count": {},
                "/intel/etcd/etcd_wal_fsync_durations_seconds_sum": {}
            },
            "config": {
            }
        }
    }
}

Create task:

$ $SNAP_PATH/bin/snapctl task create -t task.json
Using task manifest to create task
Task created
ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850
Name: Task-02dd7ff4-8106-47e9-8b86-70067cd0a850
State: Running

Watch the task:

snapctl --url http://localhost:8182 task watch 02dd7ff4-8106-47e9-8b86-70067cd0a850
Watching Task (02dd7ff4-8106-47e9-8b86-70067cd0a850):
NAMESPACE                                                        DATA                    TIMESTAMP                                       SOURCE
/intel/etcd/derivative/etcd_wal_fsync_durations_seconds_avg      0.0004962833257018023   2016-01-11 16:33:22.728866474 -0800 PST         snap1
/intel/etcd/etcd_wal_fsync_durations_seconds_count               21053                   2016-01-11 16:33:22.728717791 -0800 PST         snap1
/intel/etcd/etcd_wal_fsync_durations_seconds_sum                 10.448252856000042      2016-01-11 16:33:22.728715613 -0800 PST         snap1

Stop task:

$ $SNAP_PATH/bin/snapctl task stop 02dd7ff4-8106-47e9-8b86-70067cd0a850
Task stopped:
ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850

Roadmap

There isn't a current roadmap for this plugin, but it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release. If you have a feature request, please add it as an issue and/or submit a pull request.

Community Support

This repository is one of many plugins in snap, a powerful telemetry framework. See the full project at http://github.com/intelsdi-x/snap.

To reach out to other users, head to the main framework.

Contributing

We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in CONTRIBUTING.md.

License

snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.

Acknowledgements

And thank you! Your contribution, through code and participation, is incredibly important to us.

snap-plugin-collector-etcd's People

Watchers

 avatar  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.