-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSDB: Add dimensions and timestamp to parse errors #84962
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
This relates to #84957 |
IndexableField tsidField = context.doc().getField(TimeSeriesIdFieldMapper.NAME); | ||
if (tsidField != null) { | ||
String tsid = TimeSeriesIdFieldMapper.decodeTsid(tsidField.binaryValue()).toString(); | ||
description.append(" with dimensions ").append(tsid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks!
@elasticmachine test this please |
@elasticmachine test this please |
This adds a list of dimensions and
@timestamp
to the parse errors wemake in tsdb if the
_tsid
or@timestamp
are built.