m3

module
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2018 License: Apache-2.0

README

M3 GoDoc Build Status Coverage Status Gitter chat

M3 Logo

Distributed TSDB and Query Engine, Prometheus Sidecar, Metrics Aggregator, and more.

More information:

Test it out

(For a fully comprehsensive getting started guide, see our single node how-to).

Starting a node
# to build a local m3dbnode process
make m3dbnode (note that we currently require at least Go 1.10 or higher)

# run it with the sample configuration
./bin/m3dbnode -f ./src/dbnode/config/m3dbnode-local-etcd.yml

To cross-compile and build for Linux AMD64 build with make m3dbnode-linux-amd64.

Creating a namespace to store metrics
curl -X POST http://localhost:7201/api/v1/database/create -d '{
  "type": "local",
  "namespaceName": "default",
  "retentionTime": "2h"
}'
Test RPC

To test out some of the functionality of M3DB there are some user friendly HTTP JSON APIs that you can use. These use the DB node cluster service endpoints.

Note: performance sensitive users are expected to use the more performant endpoints via either the Go src/dbnode/client/Session API, or the GRPC endpoints exposed via src/coordinator.

Write a datapoint
curl http://localhost:9003/writetagged -s -X POST -d '{
  "namespace": "default",
  "id": "foo",
  "tags": [
    {
      "name": "city",
      "value": "new_york"
    },
    {
      "name": "endpoint",
      "value": "/request"
    }
  ],
  "datapoint": {
    "timestamp":'"$(date +"%s")"',
    "value": 42.123456789
  }
}'
Query for reverse indexed time series data
curl http://localhost:9003/query -s -X POST -d '{
  "namespace": "default",
  "query": {
    "regexp": {
      "field": "city",
      "regexp": ".*"
    }
  },
  "rangeStart": 0,
  "rangeEnd":'"$(date +"%s")"'
}' | jq .

Building with Docker

A Dockerfile is included for both development and production deployment purposes. It uses a multi-stage build in order to produce a lightweight production image from a single Dockerfile. Accordingly, it requires Docker 17.05 or later to build.

docker build -t m3dbnode:$(git rev-parse head) .
docker run --name m3dbnode m3dbnode:$(git rev-parse head)

If you wish to build an image with the source code included you can stop the build after the builder stage:

docker build -t m3dbnode:$(git rev-parse head) --target builder .

Configuration

The default Docker image will start a single m3dbnode process with an embedded etcd instance to mimic a production environment. If you would like to further customize the configuration, you must provide your own and mount it into the container:

docker run --name m3dbnode -v /host/config.yml:/etc/m3dbnode/myconfig.yml m3dbnode:tag -f /etc/m3dbnode/myconfig.yml

This project is released under the Apache License, Version 2.0.

Directories

Path Synopsis
src
aggregator/aggregation/quantile/cm
Package cm implements the Cormode-Muthukrishnan algorithm for computing biased quantiles over data streams from "Effective Computation of Biased Quantiles over Data Streams" and is largely based on statsite's implementation in C: https://github.com/statsite/statsite/blob/master/src/cm_quantile.c
Package cm implements the Cormode-Muthukrishnan algorithm for computing biased quantiles over data streams from "Effective Computation of Biased Quantiles over Data Streams" and is largely based on statsite's implementation in C: https://github.com/statsite/statsite/blob/master/src/cm_quantile.c
aggregator/aggregation/quantile/tdigest
Package tdigest implements the t-digest algorithm for accurate on-line accumulation of rank-based statistics such as quantiles from "Computing Extremely Accurate Quantiles Using t-Digests" and is based on Ted Dunning's implementation in Java: https://github.com/tdunning/t-digest/blob/master/src/main/java/com/tdunning/math/stats/
Package tdigest implements the t-digest algorithm for accurate on-line accumulation of rank-based statistics such as quantiles from "Computing Extremely Accurate Quantiles Using t-Digests" and is based on Ted Dunning's implementation in Java: https://github.com/tdunning/t-digest/blob/master/src/main/java/com/tdunning/math/stats/
aggregator/aggregator
Package aggregator is a generated GoMock package.
Package aggregator is a generated GoMock package.
aggregator/aggregator/handler
Package handler is a generated GoMock package.
Package handler is a generated GoMock package.
aggregator/aggregator/handler/common
Package common is a generated GoMock package.
Package common is a generated GoMock package.
aggregator/aggregator/handler/router
Package router is a generated GoMock package.
Package router is a generated GoMock package.
aggregator/aggregator/handler/writer
Package writer is a generated GoMock package.
Package writer is a generated GoMock package.
aggregator/client
Package client is a generated GoMock package.
Package client is a generated GoMock package.
aggregator/generated/proto/flush
Package flush is a generated protocol buffer package.
Package flush is a generated protocol buffer package.
aggregator/hash
Package hash is a temporary measure used as in between while m3aggregator is upgraded to use native source generated maps now accessible in m3x, these types are missing from m3x when native source generated maps were added.
Package hash is a temporary measure used as in between while m3aggregator is upgraded to use native source generated maps now accessible in m3x, these types are missing from m3x when native source generated maps were added.
aggregator/runtime
Package runtime is a generated GoMock package.
Package runtime is a generated GoMock package.
aggregator/tools/deploy
Package deploy is a generated GoMock package.
Package deploy is a generated GoMock package.
collector/reporter
Package reporter is a generated GoMock package.
Package reporter is a generated GoMock package.
dbnode/client
Package client is a generated GoMock package.
Package client is a generated GoMock package.
dbnode/digest
Package digest is a generated GoMock package.
Package digest is a generated GoMock package.
dbnode/encoding
Package encoding is a generated GoMock package.
Package encoding is a generated GoMock package.
dbnode/generated/proto/index
Package index is a generated protocol buffer package.
Package index is a generated protocol buffer package.
dbnode/generated/proto/namespace
Package namespace is a generated protocol buffer package.
Package namespace is a generated protocol buffer package.
dbnode/generated/proto/pagetoken
Package pagetoken is a generated protocol buffer package.
Package pagetoken is a generated protocol buffer package.
dbnode/generated/thrift/rpc
Package rpc is a generated GoMock package.
Package rpc is a generated GoMock package.
dbnode/persist
Package persist is a generated GoMock package.
Package persist is a generated GoMock package.
dbnode/persist/fs
Package fs is a generated GoMock package.
Package fs is a generated GoMock package.
dbnode/persist/fs/commitlog
Package commitlog is a generated GoMock package.
Package commitlog is a generated GoMock package.
dbnode/retention
Package retention is a generated GoMock package.
Package retention is a generated GoMock package.
dbnode/runtime
Package runtime is a generated GoMock package.
Package runtime is a generated GoMock package.
dbnode/storage
Package storage is a generated GoMock package.
Package storage is a generated GoMock package.
dbnode/storage/block
Package block is a generated GoMock package.
Package block is a generated GoMock package.
dbnode/storage/bootstrap
Package bootstrap is a generated GoMock package.
Package bootstrap is a generated GoMock package.
dbnode/storage/index
Package index is a generated GoMock package.
Package index is a generated GoMock package.
dbnode/storage/namespace
Package namespace is a generated GoMock package.
Package namespace is a generated GoMock package.
dbnode/storage/series
Package series is a generated GoMock package.
Package series is a generated GoMock package.
dbnode/topology
Package topology is a generated GoMock package.
Package topology is a generated GoMock package.
dbnode/x/xio
Package xio is a generated GoMock package.
Package xio is a generated GoMock package.
m3em/build
Package build is a generated GoMock package.
Package build is a generated GoMock package.
m3em/generated/proto/heartbeat
Package heartbeat is a generated protocol buffer package.
Package heartbeat is a generated protocol buffer package.
m3em/generated/proto/m3em
Package m3em is a generated GoMock package.
Package m3em is a generated GoMock package.
m3em/node
Package node is a generated GoMock package.
Package node is a generated GoMock package.
m3em/os/exec/mocks
Package exec is a generated GoMock package.
Package exec is a generated GoMock package.
m3em/os/fs/mocks
Package fs is a generated GoMock package.
Package fs is a generated GoMock package.
m3ninx/doc
Package doc is a generated GoMock package.
Package doc is a generated GoMock package.
m3ninx/generated/proto/fswriter
Package fswriter is a generated protocol buffer package.
Package fswriter is a generated protocol buffer package.
m3ninx/generated/proto/querypb
Package querypb is a generated protocol buffer package.
Package querypb is a generated protocol buffer package.
m3ninx/index
Package index is a generated GoMock package.
Package index is a generated GoMock package.
m3ninx/index/segment
Package segment is a generated GoMock package.
Package segment is a generated GoMock package.
m3ninx/index/segment/fst
Package fst is a generated GoMock package.
Package fst is a generated GoMock package.
m3ninx/index/segment/mem
Package mem is a generated GoMock package.
Package mem is a generated GoMock package.
m3ninx/persist
Package persist is a generated GoMock package.
Package persist is a generated GoMock package.
m3ninx/postings
Package postings is a generated GoMock package.
Package postings is a generated GoMock package.
m3ninx/search
Package search is a generated GoMock package.
Package search is a generated GoMock package.
m3ninx/search/proptest
Package proptest contains a collection of generative tests to validate query behaviour in a variety of situations.
Package proptest contains a collection of generative tests to validate query behaviour in a variety of situations.
m3nsch/rpc
Package rpc is a generated protocol buffer package.
Package rpc is a generated protocol buffer package.
query/block
Package block is a generated GoMock package.
Package block is a generated GoMock package.
query/generated/proto/admin
Package admin is a generated protocol buffer package.
Package admin is a generated protocol buffer package.
query/generated/proto/prompb
Package prompb is a generated protocol buffer package.
Package prompb is a generated protocol buffer package.
query/generated/proto/rpcpb
Package rpcpb is a generated protocol buffer package.
Package rpcpb is a generated protocol buffer package.
query/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
x/serialize
Package serialize is a generated GoMock package.
Package serialize is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL