TSDB: Add dimensions and timestamp to parse errors#84962
Merged
nik9000 merged 7 commits intoelastic:masterfrom Mar 17, 2022
Merged
TSDB: Add dimensions and timestamp to parse errors#84962nik9000 merged 7 commits intoelastic:masterfrom
nik9000 merged 7 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
This adds a list of dimensions and `@timestamp` to the parse errors we make in tsdb if the `_tsid` or `@timestamp` are built.
csoulios
approved these changes
Mar 15, 2022
| IndexableField timestampField = context.doc().getField(DataStreamTimestampFieldMapper.DEFAULT_PATH); | ||
| if (timestampField != null) { | ||
| String timestamp = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.formatMillis(timestampField.numericValue().longValue()); | ||
| description.append(" at ").append(timestamp); |
Contributor
There was a problem hiding this comment.
nit: we usually output values in error messages enclosed inside []. Dimensions above are a map, so toString() will automatically enclose them in {}. But maybe we can add it here so that users receive a message like this:
failed to parse field [foo] of type [long] in a time series document at [2021-04-28T00:01:00.000Z]. Preview of field's value: 'true'
Member
Author
|
This relates to #84957 |
nik9000
commented
Mar 15, 2022
| IndexableField tsidField = context.doc().getField(TimeSeriesIdFieldMapper.NAME); | ||
| if (tsidField != null) { | ||
| String tsid = TimeSeriesIdFieldMapper.decodeTsid(tsidField.binaryValue()).toString(); | ||
| description.append(" with dimensions ").append(tsid); |
Member
Author
There was a problem hiding this comment.
@henningandersen and I talked about limiting this to maybe 1k characters or something. I hate that it'd make debugging hard but it's nice defense against a huge bulk response.
Member
Author
|
@elasticmachine test this please |
Member
Author
|
@elasticmachine test this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a list of dimensions and
@timestampto the parse errors wemake in tsdb if the
_tsidor@timestampare built.