Skip to content

Commit

Permalink
[docs] Clarify Prom querying in single_node docs (#1612)
Browse files Browse the repository at this point in the history
  • Loading branch information
benraskin92 authored May 8, 2019
1 parent ef41854 commit d75fc7f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ curl http://localhost:9003/writetagged -s -X POST -d '{
"namespace": "default",
"id": "foo",
"tags": [
{
"name": "__name__",
"value": "user_login"
},
{
"name": "city",
"value": "new_york"
Expand Down
19 changes: 18 additions & 1 deletion docs/how_to/single_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ curl -sS -X POST http://localhost:9003/writetagged -d '{
"namespace": "default",
"id": "foo",
"tags": [
{
"name": "__name__",
"value": "user_login"
},
{
"name": "city",
"value": "new_york"
Expand All @@ -74,7 +78,16 @@ curl -sS -X POST http://localhost:9003/writetagged -d '{
'
```

And reading the metrics you've written:
**Note:** In the above example we include the tag `__name__`. This is because `__name__` is a
reserved tag in Prometheus and will make querying the metric much easier. For example, if you have
[M3Query](query.md) setup as a Prometheus datasource in Grafana, you can then query for the metric
using the following PromQL query:

```
user_login{city="new_york",endpoint="/request"}
```

And reading the metrics you've written using the M3DB `/query` endpoint:
```json
curl -sS -X POST http://localhost:9003/query -d '{
"namespace": "default",
Expand All @@ -93,6 +106,10 @@ curl -sS -X POST http://localhost:9003/query -d '{
{
"id": "foo",
"tags": [
{
"name": "__name__",
"value": "user_login"
},
{
"name": "city",
"value": "new_york"
Expand Down

0 comments on commit d75fc7f

Please sign in to comment.