MCPcopy
hub / github.com/m3db/m3

github.com/m3db/m3 @upgrade-etcd-client-3.4.3-2020-01-15 sqlite

repository ↗ · DeepWiki ↗ · release upgrade-etcd-client-3.4.3-2020-01-15 ↗
39,176 symbols 185,527 edges 2,520 files 16,645 documented · 42%
README

M3 GoDoc Build Status Coverage Status FOSSA Status

M3 Logo

Distributed TSDB and Query Engine, Prometheus Sidecar, Metrics Aggregator, and more. "More" now includes Graphite storage and query engine!

More information:

Community meetings

M3 contributors and maintainers have monthly (every four weeks) meetings. Join our M3 meetup group to receive notifications on upcoming meetings: https://www.meetup.com/M3-Community/.

Test it out

The easiest way to testing out M3 is to follow one of the guides from the documentation. For a fully comprehensive 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": "__name__",
      "value": "user_login"
    },
    {
      "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 -f docker/m3dbnode/Dockerfile -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 -f docker/m3dbnode/Dockerfile -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.

Extension points exported contracts — how you extend this code

Readable (Interface)
Readable provides a point-in-time accessor to the documents in an index. [8 implementers]
src/m3ninx/index/types.go
CounterElemPool (Interface)
CounterElemPool provides a pool of counter elements. [109 implementers]
src/aggregator/aggregator/elem_pool.go
AggregatedDecoderPool (Interface)
AggregatedDecoderPool is a pool of aggregated decoders. [109 implementers]
src/metrics/encoding/protobuf/aggregated_decoder_pool.go
ReporterOptions (Interface)
ReporterOptions provide a set of options for the reporter. [35 implementers]
src/collector/reporter/m3aggregator/options.go
Closer (Interface)
Closer is a resource that can be closed. [500 implementers]
src/x/close/close.go
Unmarshaler (Interface)
Unmarshaler can be unmarshalled from bytes. [195 implementers]
src/msg/protocol/proto/types.go
Params (Interface)
Params is a function definition. It is immutable and contains no state. [14 implementers]
src/query/parser/interface.go
Session (Interface)
Session can write and read to a cluster. [9 implementers]
src/dbnode/client/types.go

Core symbols most depended-on inside this repo

Equal
called by 3573
src/x/ident/types.go
n
called by 3240
src/ctl/public/r2/v1/swagger/swagger-ui-bundle.js
Errorf
called by 2924
src/x/test/reporter.go
Return
called by 2812
src/dbnode/persist/fs/types.go
Error
called by 2176
src/dbnode/persist/fs/files.go
Equal
called by 1567
src/m3ninx/search/types.go
n
called by 1498
src/ctl/public/r2/v1/swagger/swagger-ui.js
Equal
called by 1352
src/cluster/services/types.go

Shape

Method 22,873
Function 10,617
Struct 3,827
Interface 759
FuncType 560
TypeAlias 540

Languages

Go99%
TypeScript1%

Modules by API surface

src/dbnode/generated/thrift/rpc/rpc.go1,965 symbols
src/dbnode/client/client_mock.go710 symbols
src/dbnode/storage/storage_mock.go620 symbols
src/query/generated/proto/rpcpb/query.pb.go528 symbols
src/cluster/placement/placement_mock.go382 symbols
src/dbnode/encoding/encoding_mock.go312 symbols
src/dbnode/storage/block/block_mock.go282 symbols
src/dbnode/storage/types.go266 symbols
src/cluster/services/services_mock.go258 symbols
src/dbnode/storage/index/index_mock.go238 symbols
src/m3ninx/index/segment/segment_mock.go222 symbols
src/dbnode/client/types.go207 symbols

Dependencies from manifests, versioned

antd2.12.5 · 1×
axios0.19.0 · 1×
babel-eslint7.2.3 · 1×
basscss8.0.3 · 1×
date-fns1.29.0 · 1×
eslint4.18.2 · 1×
eslint-config-prettier2.3.0 · 1×
eslint-config-react-app1.0.5 · 1×
eslint-config-uber-es20153.1.2 · 1×
eslint-config-uber-jsx3.3.3 · 1×
eslint-plugin-flowtype2.33.0 · 1×
eslint-plugin-import2.2.0 · 1×

For agents

$ claude mcp add m3 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact