monasca-api check for value_meta length is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Monasca |
Fix Committed
|
Undecided
|
Bradley Klein |
Bug Description
The current check (not to exceed schema varchar size of 2048) only looks at the value_meta value, but then adds key and other chars which exceed schema length. The current check:
if (name.length() > VALUE_META_
throw Exceptions.
name, VALUE_META_
}
if (value.length() > VALUE_META_
throw Exceptions.
value, VALUE_META_
}
dbadmin=> select value_meta from monmetrics.
-------
{"detail":"Running router checks for the host bfd02-control-
So the check is missing 7 chars plus the length of 'detail'.
This results in really bad things when this data gets pushed to vertica (see https:/
Changed in monasca: | |
status: | New → Triaged |
assignee: | nobody → Bradley Klein (brad-klein) |
Changed in monasca: | |
status: | Triaged → In Progress |
Reviewed: https:/ /review. openstack. org/230596 /git.openstack. org/cgit/ stackforge/ monasca- api/commit/ ?id=1b7e1322913 de85a955b99dd7c 574586fb377d5e
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1b7e1322913de85 a955b99dd7c5745 86fb377d5e
Author: bklei <email address hidden>
Date: Fri Oct 2 10:56:48 2015 -0600
Fix value_meta length check
For vertica, the value_meta name/value pair is persisted in a
varchar(2048) column, so we need to include the json chars and
name in the field length check. Very bad things happen if
metrics like this slip through to kafka and eventually the
persister, causing entire batches of metrics to never get
persisted.
Change-Id: I90d148000afbd9 f48b3e33f0e66ed ea2114e14a3
Closes-Bug: #1501929