-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into linasn/bootstrap-out-of-retention-blocks-fix
* master: [dtest] endpoint to fetch tagged (#3138) Refactor FetchTagged to return an Iterator of results (#3141) [dbnode] Add aggregate term limit regression test (#3135) [DOCS] Adding Prometheus steps to quickstart (#3043) [dbnode] Revert AggregateQuery changes (#3133) Fix TestSessionFetchIDs flaky test (#3132) [dbnode] Alter multi-segments builder to order by size before processing (#3128) [dbnode] Emit aggregate usage metrics (#3123) [dbnode] Add Shard.OpenStreamingReader method (#3119)
- Loading branch information
Showing
41 changed files
with
1,976 additions
and
756 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
external_labels: | ||
monitor: 'codelab-monitor' | ||
|
||
remote_read: | ||
- url: "http://localhost:7201/api/v1/prom/remote/read" | ||
# To test reading even when local Prometheus has the data | ||
read_recent: true | ||
remote_write: | ||
- url: "http://localhost:7201/api/v1/prom/remote/write" | ||
|
||
scrape_configs: | ||
- job_name: 'prometheus' | ||
scrape_interval: 5s | ||
static_configs: | ||
- targets: ['localhost:9090'] | ||
|
||
- job_name: 'node' | ||
scrape_interval: 5s | ||
static_configs: | ||
- targets: ['localhost:8080', 'localhost:8081'] | ||
labels: | ||
group: 'production' | ||
- targets: ['localhost:8082'] | ||
labels: | ||
group: 'canary' | ||
|
||
- job_name: 'm3' | ||
static_configs: | ||
- targets: ['localhost:7203'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
To query metrics, use the _{{% apiendpoint %}}query_range_ endpoint with the following data in the request body, all fields are required: | ||
|
||
- `query`: A PromQL query | ||
- `start`: Timestamp in `RFC3339Nano` of start range for results | ||
- `end`: Timestamp in `RFC3339Nano` of end range for results | ||
- `step`: A duration or float of the query resolution, the interval between results in the timespan between `start` and `end`. | ||
|
||
Below are some examples using the metrics written above. | ||
|
||
#### Return results in past 45 seconds | ||
|
||
{{< tabs name="example_promql_regex" >}} | ||
{{% tab name="Linux" %}} | ||
|
||
<!-- TODO: Check this on Linux --> | ||
|
||
```shell | ||
curl -X "POST" -G "{{% apiendpoint %}}query_range" \ | ||
-d "query=third_avenue" \ | ||
-d "start=$(date "+%s" -d "45 seconds ago")" \ | ||
-d "end=$( date +%s )" \ | ||
-d "step=5s" | jq . | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab name="macOS/BSD" %}} | ||
|
||
```shell | ||
curl -X "POST" -G "{{% apiendpoint %}}query_range" \ | ||
-d "query=third_avenue" \ | ||
-d "start=$( date -v -45S +%s )" \ | ||
-d "end=$( date +%s )" \ | ||
-d "step=5s" | jq . | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab name="Output" %}} | ||
|
||
```json | ||
{ | ||
"status": "success", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"__name__": "third_avenue", | ||
"checkout": "1", | ||
"city": "new_york" | ||
}, | ||
"values": [ | ||
[ | ||
{{% now %}}, | ||
"3347.26" | ||
], | ||
[ | ||
{{% now %}}, | ||
"5347.26" | ||
], | ||
[ | ||
{{% now %}}, | ||
"7347.26" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
{{% /tab %}} | ||
{{< /tabs >}} | ||
|
||
#### Values above a certain number | ||
|
||
{{< tabs name="example_promql_range" >}} | ||
{{% tab name="Linux" %}} | ||
|
||
<!-- TODO: Check Linux command --> | ||
|
||
```shell | ||
curl -X "POST" -G "{{% apiendpoint %}}query_range" \ | ||
-d "query=third_avenue > 6000" \ | ||
-d "start=$(date "+%s" -d "45 seconds ago")" \ | ||
-d "end=$( date +%s )" \ | ||
-d "step=5s" | jq . | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab name="macOS/BSD" %}} | ||
|
||
```shell | ||
curl -X "POST" -G "{{% apiendpoint %}}query_range" \ | ||
-d "query=third_avenue > 6000" \ | ||
-d "start=$(date -v -45S "+%s")" \ | ||
-d "end=$( date +%s )" \ | ||
-d "step=5s" | jq . | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab name="Output" %}} | ||
|
||
```json | ||
{ | ||
"status": "success", | ||
"data": { | ||
"resultType": "matrix", | ||
"result": [ | ||
{ | ||
"metric": { | ||
"__name__": "third_avenue", | ||
"checkout": "1", | ||
"city": "new_york" | ||
}, | ||
"values": [ | ||
[ | ||
{{% now %}}, | ||
"7347.26" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
{{% /tab %}} | ||
{{< /tabs >}} |
Oops, something went wrong.