Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Update the docs/sql_schema.md containment operator example
Browse files Browse the repository at this point in the history
Adds the SQL code formatting to relevant blocks queries that were missing it and fixes the invalid syntax in the containment operator example.
  • Loading branch information
timflannagan authored and Harkishen-Singh committed Oct 1, 2020
1 parent 9bec5c8 commit 2299d37
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/sql_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ For example:

Example query for single point with their labels:

```
```SQL
SELECT
jsonb(labels) as labels,
value
Expand All @@ -62,7 +62,7 @@ Results:

Example query for a rollup:

```
```SQL
SELECT
val(node_id) as node,
avg(value)
Expand Down Expand Up @@ -156,7 +156,6 @@ the following columns
new_tag | new_tag | new_tag_id | {value}
```


## Series Selectors

We have added simple-to-use series selectors for filtering series in either of the two views above.
Expand All @@ -170,7 +169,7 @@ For example to find all metrics on in the dev namespace and on node pinky, run:
```SQL
SELECT *
FROM prom_series.cpu_usage u
WHERE labels @> jsonb '{"namespace":"dev", "node": "pinky"'}
WHERE labels @> jsonb '{"namespace":"dev", "node": "pinky"}'
```

```
Expand Down Expand Up @@ -245,7 +244,7 @@ section above.

This default data retention period can be changed by using the SQL function
`set_default_retention_period(new interval)`. For example,
```
```SQL
SELECT set_default_retention_period(180 * INTERVAL '1 day')
```

Expand Down

0 comments on commit 2299d37

Please sign in to comment.