13 Aralık 2018 Perşembe

Envoyproxybeat: Elastic Beats for Envoy Proxy

What is the Envoyproxybeat


Envoyproxybeat is an Elastic Beat that reads stats from the Envoy Proxy and indexes them into Elasticsearch or Logstash.

Configuration Options

You need to adjust the envoyproxybeat.yml configuration file to your needs. Here is a sample configuration:

input:
  # Defines how often an event is sent to the output
  period: 30

  # Defines the http port serviced
  # Default to :9901
  port: :9901

  # Defines the http host serviced
  # Default to localhost
  host: localhost

Options

period
How often events are sent to the Elasticsearch.
period: 30

port and host
envoyproxybeat collect data from the Envoy Proxy the predefined to localhost: 5984. You should be careful when you change these settings.

port: :9901
host: localhost

Run Envoyproxybeat

First, setup Golang environment (if you don't have it already)

cd $GOPATH
mkdir -p src/github.com/berfinsari
cd src/github.com/berfinsari
git clone https://github.com/berfinsari/envoyproxybeat.git
cd envoyproxybeat
make

To run Envoyproxybeat with debugging output enabled, run:

./envoyproxybeat -c envoyproxybeat.yml -e -d "*"


Envoy Proxy Statistics

Envoy outputs numerous statistics which depend on how the server is configured. They can be seen locally via the /stats admin endpoint. The admin endpoint looks directly into the store to load all of the counters and gauges and print them.

Envoyproxybeat reads data from Envoy admin endpoint. For now, Envoyproxybeat collects non-dynamic statistics.

Document Example

  "envoyproxy": {
    "server": {
      "cluster_manager": {
        "warming_clusters": 0,
        "active_clusters": 1,
        "cluster_added": 1,
        "cluster_modified": 0,
        "cluster_removed": 0
      },
      "filesystem": {
        "write_buffered": 1,
        "write_completed": 1,
        "write_total_buffered": 0,
        "flushed_by_timer": 0,
        "reopen_failed": 0
      },
      "runtime": {
        "override_dir_exists": 0,
        "override_dir_not_exists": 0,
        "admin_overrides_active": 0,
        "load_error": 0,
        "load_success": 0,
        "num_keys": 0
      },
      "listener_manager": {
        "listener_added": 1,
        "listener_create_failure": 0,
        "listener_create_success": 4,
        "listener_modified": 0,
        "listener_removed": 0,
        "total_listeners_active": 1,
        "total_listeners_draining": 0,
        "total_listeners_warming": 0
      },
      "stats": {
        "overflow": 0
      },
      "server": {
        "live": 1,
        "memory_heap_size": 4194304,
        "watchdog_mega_miss": 0,
        "version": 4151803,
        "uptime": 15,
        "memory_allocated": 3168904,
        "parent_connections": 0,
        "days_until_first_cert_expiring": 2147483647,
        "watchdog_miss": 0,
        "total_connections": 0,
        "hot_restart_epoch": 0
      },
      "http2": {}
}