Skip to content

Commit

Permalink
fix(data-apis): Make minor formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rhetoric101 committed Apr 15, 2024
1 parent 28889b6 commit 57365c7
Showing 1 changed file with 12 additions and 5 deletions.
Expand Up @@ -211,10 +211,13 @@ You can use `getField()` to extract those fields. For example, if you want to us
The average value of a metric is computed as `total` over `count`, so the following query returns metric data where the result of the `average()` value function is greater than 2.

```
FROM Metric SELECT average(apm.service.transaction.duration) WHERE appName = 'MyApp' AND getField(apm.service.transaction.duration, total) / getField(apm.service.transaction.duration, count) > 2
FROM Metric
SELECT average(apm.service.transaction.duration)
WHERE appName = 'MyApp'
AND getField(apm.service.transaction.duration, total) / getField(apm.service.transaction.duration, count) > 2
```

or with the shorthand:
Or, you can use the shorthand:

```
FROM Metric SELECT average(apm.service.transaction.duration) WHERE appName = 'MyApp' AND apm.service.transaction.duration[total] / apm.service.transaction.duration[count] > 2
Expand All @@ -227,12 +230,16 @@ You can use `getField()` to extract those fields. For example, if you want to us
This example query returns a list of gauge metrics:

```
FROM Metric SELECT uniques(metricName) WHERE getField(%, type) = 'gauge'
FROM Metric
SELECT uniques(metricName)
WHERE getField(%, type) = 'gauge'
```

or with the shorthand:
Or, you can use the shorthand:
```
FROM Metric SELECT uniques(metricName) WHERE %[type] = 'gauge'
FROM Metric
SELECT uniques(metricName)
WHERE %[type] = 'gauge'
```

Note the use of the `%` wildcard to target any matching `metricName`.
Expand Down

0 comments on commit 57365c7

Please sign in to comment.