From 917cfd7be7193c77bb170d76a1c1f12076516e65 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Thu, 26 Aug 2021 17:29:10 -0700 Subject: [PATCH] Add long_field_max_length configuration option (#493) --- specs/agents/README.md | 1 + specs/agents/field-limits.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 specs/agents/field-limits.md diff --git a/specs/agents/README.md b/specs/agents/README.md index 5aca2f9e3..9c406c21e 100644 --- a/specs/agents/README.md +++ b/specs/agents/README.md @@ -61,6 +61,7 @@ You can find details about each of these in the [APM Data Model](https://www.ela - [Agent Configuration](configuration.md) - [Agent logging](logging.md) - [Data sanitization](sanitization.md) +- [Field limits](field-limits.md) # Processes diff --git a/specs/agents/field-limits.md b/specs/agents/field-limits.md new file mode 100644 index 000000000..f7d561314 --- /dev/null +++ b/specs/agents/field-limits.md @@ -0,0 +1,31 @@ +## Field limits + +The maximum length of metadata, transaction, span, et al fields are determined +by the [APM Server Events Intake API schema](https://www.elastic.co/guide/en/apm/server/current/events-api.html). +Fields that are names or identifiers of some resource of typically limited to +1024 unicode characters. + +### `long_field_max_length` configuration + +Some APM event fields are not limited in the APM server intake API schema. +Agents SHOULD limit the maximum length of the following fields by truncating. + +- `transaction.context.request.body`, `error.context.request.body` +- `transaction.context.message.body`, `span.context.message.body`, `error.context.message.body` +- `span.context.db.statement` +- `error.exception.message` +- `error.log.message` + +Agents MAY support the `long_field_max_length` configuration option to allow +the user to configure this maximum length. This option defines a maximum number +of unicode characters for each field. + +| | | +|----------------|-----------| +| Type | `Integer` | +| Default | `10000` | +| Dynamic | `false` | +| Central config | `false` | + +Ultimately the maximum length of any field is limited by the [`max_event_size`](https://www.elastic.co/guide/en/apm/server/current/configuration-process.html#max_event_size) +configured for the receiving APM server.