Skip to content

Commit

Permalink
Removing span.context.message.body from long-field spec (elastic#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalkoren authored Mar 20, 2023
1 parent 80a4e4c commit 7898764
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions specs/agents/field-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,30 @@

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.
Except for special cases, fields are typically limited to 1024 unicode characters.
Unless listed below as knowm "long fields", agents SHOULD truncate filed values to 1024 characters, as specified [below](#truncating-field-values).

### `long_field_max_length` configuration
### Long fields

Some APM event fields are not limited in the APM server intake API schema.
Such fields are considered "long fields".

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.
Agents SHOULD treat the following fields as long fields:

- `transaction.context.request.body`, `error.context.request.body`
- `transaction.context.message.body`, `span.context.message.body`, `error.context.message.body`
- `transaction.context.message.body`, `error.context.message.body`
- `span.context.db.statement`

In addition, agents MAY treat the following fields as long fields:

- `error.exception.message`
- `error.log.message`

Agents SHOULD limit the maximum length of long fields by [truncating](#truncating-field-values) them to 10,000 unicode characters,
or based on user configuration for long field length, as specified [below](#long_field_max_length-configuration).

### `long_field_max_length` configuration

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.
Expand All @@ -29,3 +39,8 @@ of unicode characters for each field.

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.

### Truncating field values

When field values exceed the maximum allowed number of unicode characters, agents SHOULD truncate the values to fit the maximum allowed length,
replacing the last character of the eventual value with the ellipsis character (unicode character `U+2026`: "…").

0 comments on commit 7898764

Please sign in to comment.