Skip to content

Commit

Permalink
Fix links in the titles. (#12335)
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-sheng authored Jun 16, 2024
1 parent bef9eec commit 6e5ac57
Showing 1 changed file with 40 additions and 12 deletions.
52 changes: 40 additions & 12 deletions docs/en/api/promql-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ The following doc describes the details of the supported protocol and compared i
If not mentioned, it will not be supported by default.

### Time series Selectors
#### [Instant Vector Selectors](https://prometheus.io/docs/prometheus/latest/querying/basics/#instant-vector-selectors)
#### Instant Vector Selectors
[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/basics/#instant-vector-selectors)

For example: select metric `service_cpm` which the service is `$service` and the layer is `$layer`.
```text
service_cpm{service='$service', layer='$layer'}
```
**Note: The label matching operators only support `=` instead of regular expressions.**

#### [Range Vector Selectors](https://prometheus.io/docs/prometheus/latest/querying/basics/#range-vector-selectors)
#### Range Vector Selectors
[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/basics/#range-vector-selectors)

For example: select metric `service_cpm` which the service is `$service` and the layer is `$layer` within the last 5 minutes.
```text
service_cpm{service='$service', layer='$layer'}[5m]
```

#### [Time Durations](https://prometheus.io/docs/prometheus/latest/querying/basics/#time-durations)
#### Time Durations
[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/basics/#time-durations)

| Unit | Definition | Support |
|------|--------------|---------|
| ms | milliseconds | yes |
Expand All @@ -37,7 +43,10 @@ service_cpm{service='$service', layer='$layer'}[5m]
| y | years | **no** |

### Binary operators
#### [Arithmetic binary operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators)
#### Arithmetic binary operators

[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/operators/#arithmetic-binary-operators)

| Operator | Definition | Support |
|----------|----------------------|---------|
| + | addition | yes |
Expand Down Expand Up @@ -67,7 +76,10 @@ service_cpm{service='$service', layer='$layer'} + service_cpm{service='$service'

**Note: The operations between vectors require the same metric and labels, and don't support [Vector matching](https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching).**

#### [Comparison binary operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators)
#### Comparison binary operators

[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators)

| Operator | Definition | Support |
|----------|------------------|---------|
| == | equal | yes |
Expand Down Expand Up @@ -98,7 +110,10 @@ service_cpm{service='service_A', layer='$layer'} > service_cpm{service='service_

#### Expression queries

##### [Instant queries](https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries)
##### Instant queries

[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries)

```text
GET|POST /api/v1/query
```
Expand Down Expand Up @@ -138,7 +153,10 @@ Result:
}
```

##### [Range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries)
##### Range queries

[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries)

```text
GET|POST /api/v1/query_range
```
Expand Down Expand Up @@ -204,7 +222,9 @@ Result:

#### Querying metadata

##### [Finding series by label matchers](https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers)
##### Finding series by label matchers
[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers)

```text
GET|POST /api/v1/series
```
Expand Down Expand Up @@ -264,7 +284,9 @@ Result:
- instance_traffic
- endpoint_traffic

#### [Getting label names](https://prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names)
#### Getting label names
[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names)

```text
GET|POST /api/v1/labels
```
Expand Down Expand Up @@ -295,7 +317,9 @@ Result:
}
```

#### [Querying label values](https://prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values)
#### Querying label values
[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values)

```text
GET /api/v1/label/<label_name>/values
```
Expand Down Expand Up @@ -333,7 +357,9 @@ Result:
}
```

#### [Querying metric metadata](https://prometheus.io/docs/prometheus/latest/querying/api/#querying-metric-metadata)
#### Querying metric metadata
[Prometheus Docs Reference](https://prometheus.io/docs/prometheus/latest/querying/api/#querying-metric-metadata)

```text
GET /api/v1/metadata
```
Expand Down Expand Up @@ -381,7 +407,7 @@ Result:

## Metrics Type For Query

### Supported Metrics [Scope](../../../oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/enumeration/Scope.java)(Catalog)
### Supported Metrics Scope(Catalog)
Not all scopes are supported for now, please check the following table:

| Scope | Support |
Expand All @@ -395,6 +421,8 @@ Not all scopes are supported for now, please check the following table:
| Process | no |
| ProcessRelation | no |

All Scopes could be found [here](../../../oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/enumeration/Scope.java).

### General labels
Each metric contains general labels: [layer](../../../oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java).
Different metrics will have different labels depending on their Scope and metric value type.
Expand Down

0 comments on commit 6e5ac57

Please sign in to comment.