Skip to content

Commit 902b9df

Browse files
committed
docs: adjusted to suggestions
1 parent bbf5810 commit 902b9df

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/performance-tuning.asciidoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,15 @@ Limiting the number of spans that may be recorded will reduce memory usage.
176176
Reducing max spans could result in loss of useful data about what occurred within a request,
177177
if it is set too low.
178178

179-
Instead of limiting the number of spans, it can be better to drop spans with a very short duration. This will record the spans but discard them if they are very short.
180-
This can be implemented by providing a span-filter:
179+
An alternative to limiting the maximum number of spans can be to drop spans with a very short duration, as those might not be that relevant.
180+
181+
NOTE: Using a span filter does not reduce the load of recording the spans in your application, but merely filters them out before sending them to the APM Server.
182+
This, however, both reduces the amount of storage needed to store the spans in Elasticsearch, and the bandwidth needed to transport the data to the APM Server from the instrumented application.
181183

182-
```js
183-
const agent = require('elastic-apm-node').start({ /* configuration options */ })
184+
This can be implemented by providing a span-filter:
184185

186+
[source,js]
185187
agent.addSpanFilter(payload => {
186188
return payload.duration < 10 ? null : payload
187189
})
188-
```
190+
----

0 commit comments

Comments
 (0)