Skip to content

Latest commit

 

History

History
245 lines (197 loc) · 7.95 KB

File metadata and controls

245 lines (197 loc) · 7.95 KB

Tools

Metrictank comes with a bunch of helper tools.

Here is an overview of them all.

This file is generated by tools-to-doc


mt-index-cat

mt-index-cat

Retrieves a metrictank index and dumps it in the requested format
In particular, the vegeta outputs are handy to pipe requests for given series into the vegeta http benchmark tool

Usage:

  mt-index-cat [global config flags] <idxtype> [idx config flags] output 

global config flags:

  -addr string
    	graphite/metrictank address (default "http://localhost:6060")
  -from string
    	from. eg '30min', '5h', '14d', etc. or a unix timestamp (default "30min")
  -limit int
    	only show this many metrics.  use 0 to disable
  -max-age string
    	max age (last update diff with now) of metricdefs.  use 0 to disable (default "6h30min")
  -prefix string
    	only show metrics that have this prefix
  -substr string
    	only show metrics that have this substring
  -verbose
    	print stats to stderr

idxtype: only 'cass' supported for now

cass config flags:

  -auth
    	enable cassandra user authentication
  -ca-path string
    	cassandra CA certficate path when using SSL (default "/etc/raintank/ca.pem")
  -consistency string
    	write consistency (any|one|two|three|quorum|all|local_quorum|each_quorum|local_one (default "one")
  -enabled
    	
  -host-verification
    	host (hostname and server cert) verification when using SSL (default true)
  -hosts string
    	comma separated list of cassandra addresses in host:port form (default "localhost:9042")
  -keyspace string
    	Cassandra keyspace to store metricDefinitions in. (default "metrictank")
  -max-stale duration
    	clear series from the index if they have not been seen for this much time.
  -num-conns int
    	number of concurrent connections to cassandra (default 10)
  -password string
    	password for authentication (default "cassandra")
  -protocol-version int
    	cql protocol version to use (default 4)
  -prune-interval duration
    	Interval at which the index should be checked for stale series. (default 3h0m0s)
  -ssl
    	enable SSL connection to cassandra
  -timeout duration
    	cassandra request timeout (default 1s)
  -update-fuzzyness float
    	fuzzyness factor for update-interval. should be in the range 0 > fuzzyness <= 1. With an updateInterval of 4hours and fuzzyness of 0.5, metricDefs will be updated every 4-6hours. (default 0.5)
  -update-interval duration
    	frequency at which we should update the metricDef lastUpdate field. (default 3h0m0s)
  -username string
    	username for authentication (default "cassandra")
  -write-queue-size int
    	Max number of metricDefs allowed to be unwritten to cassandra (default 100000)

output: dump|list|vegeta-render|vegeta-render-patterns


EXAMPLES:
mt-index-cat -from 60min cass -hosts cassandra:9042 list

mt-index-migrate-050-to-054

mt-index-migrate-050-to054

Converts a metrictank index to the new 0.5.4 (and beyond) format, using cassandra instead of elasticsearch
differences:
 * schema 0 to schema 1 - proper metrics2.0 - (for 0.5.1, 576d8fcb47888b8a334e9a125d6aadf8e0e4d4d7)
 * store data in cassandra in the metric_def_ix table, as a messagepack encoded blob (cassandra idx new in 0.5.3 - 26be821bd8bead43db120e96d14d0ee88d6b6880)
 * use lastUpdate field (for 0.5.4, a07007ab8d4a22b122bbc5f9fadb51480e1c5b0c)

Flags:

  -cass-addr string
    	Address of cassandra host. (default "localhost")
  -dry-run
    	run in dry-run mode. No changes will be made. (default true)
  -es-addr string
    	address of elasticsearch host. (default "localhost")
  -index string
    	elasticsearch index that contains current metric index values. (default "metric")
  -keyspace string
    	Cassandra keyspace to use. (default "raintank")

mt-index-migrate-06-to-07

mt-index-migrate-06-to-07

Converts a metrictank v0.6 index to the v0.7 format
differences:
 * cassandra table: metric_def_idx -> metric_idx
 * data is stored as individual fields, not as messagepack encoded blob
 * support for partitioning. the partition field in cassandra will be set based on num-partitions and partition-schema

Flags:

  -cass-addr string
    	Address of cassandra host. (default "localhost")
  -dry-run
    	run in dry-run mode. No changes will be made. (default true)
  -keyspace string
    	Cassandra keyspace to use. (default "raintank")
  -log-level int
    	log level. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL (default 2)
  -num-partitions int
    	number of partitions in cluster (default 1)
  -partition-scheme string
    	method used for partitioning metrics. (byOrg|bySeries) (default "byOrg")

mt-replicator

mt-replicator

Replicates a kafka mdm topic on a given cluster to a topic on another

Flags:

  -compression string
    	compression: none|gzip|snappy (default "none")
  -dst-brokers string
    	tcp address for kafka cluster to consume from (may be be given multiple times as a comma-separated list) (default "localhost:9092")
  -dst-topic string
    	topic name on destination cluster (default "mdm")
  -group string
    	Kafka consumer group (default "mt-replicator")
  -log-level int
    	log level. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL (default 2)
  -partition-scheme string
    	method used for partitioning metrics. (byOrg|bySeries) (default "byOrg")
  -src-brokers string
    	tcp address of source kafka cluster (may be be given multiple times as a comma-separated list) (default "localhost:9092")
  -src-topic string
    	topic name on source cluster (default "mdm")
  -version
    	print version string

mt-store-cat

mt-store-cat

Retrieves timeseries data from the cassandra store. Either raw or with minimal processing

Usage:
	mt-store-cat [flags] <normal|summary> id <metric-id>
	mt-store-cat [flags] <normal|summary> query <org-id> <graphite query> (not supported yet)
Flags:
  -cassandra-addrs string
    	cassandra host (may be given multiple times as comma-separated list) (default "localhost")
  -cassandra-auth
    	enable cassandra authentication
  -cassandra-ca-path string
    	cassandra CA certificate path when using SSL (default "/etc/raintank/ca.pem")
  -cassandra-consistency string
    	write consistency (any|one|two|three|quorum|all|local_quorum|each_quorum|local_one (default "one")
  -cassandra-host-selection-policy string
    	 (default "roundrobin")
  -cassandra-host-verification
    	host (hostname and server cert) verification when using SSL (default true)
  -cassandra-keyspace string
    	cassandra keyspace to use for storing the metric data table (default "raintank")
  -cassandra-password string
    	password for authentication (default "cassandra")
  -cassandra-read-concurrency int
    	max number of concurrent reads to cassandra. (default 20)
  -cassandra-read-queue-size int
    	max number of outstanding reads before blocking. value doesn't matter much (default 100)
  -cassandra-retries int
    	how many times to retry a query before failing it
  -cassandra-ssl
    	enable SSL connection to cassandra
  -cassandra-timeout int
    	cassandra timeout in milliseconds (default 1000)
  -cassandra-username string
    	username for authentication (default "cassandra")
  -config string
    	configuration file path (default "/etc/raintank/metrictank.ini")
  -cql-protocol-version int
    	cql protocol version to use (default 4)
  -fix int
    	fix data to this interval like metrictank does quantization
  -from string
    	get data from (inclusive) (default "-24h")
  -mdp int
    	max data points to return
  -to string
    	get data until (exclusive) (default "now")
  -version
    	print version string
Notes:
 * points that are not in the `from <= ts < to` range, are prefixed with `-`. In range has prefix of '>`

mt-view-boundaries

mt-view-boundaries

Shows boundaries of rows in cassandra and of spans of specified size.
to see UTC times, just prefix command with TZ=UTC

  -span string
    	see boundaries for chunks of this span
  -version
    	print version string