github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/README.md (about) 1 # M3 2 3 [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![FOSSA Status][fossa-img]][fossa] 4 5 <p align="center"><img src="site/static/images/logo-square.png" alt="M3 Logo" width="256" height="270"></p> 6 7 [Distributed TSDB](https://m3db.io/docs/reference/m3db/) and [Query Engine](https://m3db.io/docs/how_to/query/), [Prometheus Sidecar](https://m3db.io/docs/integrations/prometheus/), [Metrics Aggregator](https://m3db.io/docs/overview/reference/#m3-aggregator), and more such as [Graphite storage and query engine](https://m3db.io/docs/integrations/graphite/). 8 9 ## Table of Contents 10 11 - [More Information](#more-information) 12 - [Install](#install) 13 - [Dependencies](#dependencies) 14 - [Usage](#usage) 15 - [Contributing](#contributing) 16 17 ## More Information 18 19 - [Documentation](https://m3db.io/docs) 20 - [Contributing](CONTRIBUTING.md) 21 - [Slack](http://bit.ly/m3slack) 22 - [Forum (Google Group)](https://groups.google.com/forum/#!forum/m3db) 23 24 ### Community Meetings 25 26 You can find recordings of past meetups here: <https://vimeo.com/user/120001164/folder/2290331>. 27 28 ## Install 29 30 ### Dependencies 31 32 The simplest and quickest way to try M3 is to use Docker, read [the M3 quickstart section](https://m3db.io/docs/quickstart) for other options. 33 34 This example uses [jq](https://stedolan.github.io/jq/) to format the output of API calls. It is not essential for using M3DB. 35 36 ## Usage 37 38 The below is a simplified version of the [M3 quickstart guide](https://m3db.io/docs/quickstart/docker/), and we suggest you read that for more details. 39 40 1. Start a Container 41 42 ```shell 43 docker run -p 7201:7201 -p 7203:7203 --name m3db -v $(pwd)/m3db_data:/var/lib/m3db quay.io/m3db/m3dbnode:v1.0.0 44 ``` 45 46 2. Create a Placement and Namespace 47 48 ```shell 49 #!/bin/bash 50 curl -X POST http://localhost:7201/api/v1/database/create -d '{ 51 "type": "local", 52 "namespaceName": "default", 53 "retentionTime": "12h" 54 }' | jq . 55 ``` 56 57 3. Ready a Namespace 58 59 ```shell 60 curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{ 61 "name": "default" 62 }' | jq . 63 ``` 64 65 4. Write Metrics 66 67 ```shell 68 #!/bin/bash 69 curl -X POST http://localhost:7201/api/v1/json/write -d '{ 70 "tags": 71 { 72 "__name__": "third_avenue", 73 "city": "new_york", 74 "checkout": "1" 75 }, 76 "timestamp": '\"$(date "+%s")\"', 77 "value": 3347.26 78 }' 79 ``` 80 81 5. Query Results 82 83 **Linux** 84 85 ```shell 86 curl -X "POST" -G "http://localhost:7201/api/v1/query_range" \ 87 -d "query=third_avenue" \ 88 -d "start=$(date "+%s" -d "45 seconds ago")" \ 89 -d "end=$( date +%s )" \ 90 -d "step=5s" | jq . 91 ``` 92 93 **macOS/BSD** 94 95 ```shell 96 curl -X "POST" -G "http://localhost:7201/api/v1/query_range" \ 97 -d "query=third_avenue > 6000" \ 98 -d "start=$(date -v -45S "+%s")" \ 99 -d "end=$( date +%s )" \ 100 -d "step=5s" | jq . 101 ``` 102 103 ## Contributing 104 105 You can ask questions and give feedback in the following ways: 106 107 - [Create a GitHub issue](https://github.com/m3db/m3/issues) 108 - [In the public M3 Slack](http://bit.ly/m3slack) 109 - [In the M3 forum (Google Group)](https://groups.google.com/forum/#!forum/m3db) 110 111 M3 welcomes pull requests, read [contributing guide](CONTRIBUTING.md) to help you get setup for building and contributing to M3. 112 113 <hr> 114 115 This project is released under the [Apache License, Version 2.0](LICENSE). 116 117 [doc-img]: https://godoc.org/github.com/m3db/m3?status.svg 118 119 [doc]: https://godoc.org/github.com/m3db/m3 120 121 [ci-img]: https://badge.buildkite.com/5509d9360bfea7f99ac3a07fd029feb1aafa5cff9ed5ab667b.svg?branch=master 122 123 [ci]: https://buildkite.com/uberopensource/m3-monorepo-ci 124 125 [cov-img]: https://codecov.io/gh/m3db/m3/branch/master/graph/badge.svg 126 127 [cov]: https://codecov.io/gh/m3db/m3 128 129 [fossa-img]: https://app.fossa.io/api/projects/custom%2B4529%2Fgithub.com%2Fm3db%2Fm3.svg?type=shield 130 131 [fossa]: https://app.fossa.io/projects/custom%2B4529%2Fgithub.com%2Fm3db%2Fm3?ref=badge_shield