Commit Graph

34 Commits (4e2a16c459183e0adc5946b242d014b2090de206)

Author SHA1 Message Date
Jason Wilder 0926b19e6b Prevent creating points with NaN float values
Float values are not supported in the existing engine and the tsm1
engines.  This changes NewPoint to return an error if a field value
contains a NaN field.  It also allows us to validate fields to prevent
other unsupported types from sneaking in through other input plugins.
2015-10-27 17:12:52 -06:00
Cameron Sparr 2add55107e Fix graphite parser merge error, nargs 2015-10-08 11:15:03 -06:00
Cameron Sparr 3bea25b428 graphite parser: apply tags from the Parser on the template 2015-10-08 10:56:13 -06:00
Rob Wilson a27186fb7a raise exception when field keyword is specified multiple times 2015-10-07 20:31:46 +01:00
Rob Wilson bcd6c06173 Merge remote-tracking branch 'upstream/master' into graphite-template-custom-field
Conflicts:
	services/graphite/parser.go
2015-10-07 17:48:34 +01:00
Cameron Sparr 883d32cfd0 Add public function to graphite parser to apply template 2015-10-06 17:42:36 -06:00
Rob Wilson ef35d6dcc2 formatting 2015-09-21 12:26:43 +01:00
Rob Wilson 27c1cc23fd Working prototype.. 2015-09-21 12:18:19 +01:00
Rob Wilson 9121b422f8 comment out tests for now.. 2015-09-21 10:47:42 +01:00
Rob Wilson 20e4fdfa9a allow specifying fieldname in graphite template 2015-09-20 21:17:50 +01:00
Cory LaNou d19a510ad2 refactor Points and Rows to dedicated packages 2015-09-16 15:33:08 -05:00
Jason Wilder 73510a0a68 Fix invalid time stamp in graphite metric causes panic
If a timestamp was larger than the max epoch value was sent via
graphite it would cause the timestamp to overflow when it was
marshaled/unmarshaled back from the raft log.  The overflow cause
the shard group to get created with the wrong timestamp which cause
a panic when writing the point.  The panic was caused because the
timestamp that were supposed to exists in a map created by MapShards
did not actually exist so a nil ShardGroup was used.

The change prevents creating the point with an invalid timestamp.  Since
graphite using a timestamp in seconds, the maximum range is known and
can be prevented.  This also adds a check for the minimum range as well.

Fixes #3785
2015-09-08 10:07:47 -06:00
Alexander Morozov 675eacbf2c Fix style issues with else
In go it's better to just continue flow without "else", if it is return in
"if" statement.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-17 11:10:23 -07:00
Jason Wilder 4a71692b88 Allow extra tags using graphite default template
Fixes #3223
2015-07-06 16:14:02 -06:00
Jason Wilder 0b481d55f4 Fix graphite filter searching matching wrong template
Default template would get chosen in some cases when a matching filter
existed.

Fixes #3245
2015-07-06 16:14:02 -06:00
Jason Wilder 562d7cd37d Handle timestamp special cases
If no timestamp is sent or the value -1 is sent, the current UTC
time is used.
2015-06-24 23:53:13 -06:00
Jason Wilder c5a10cf93d Use raw metric name when default template fails to match 2015-06-24 23:38:10 -06:00
Jason Wilder fbfb90d66c Code review fixes 2015-06-24 23:33:42 -06:00
Jason Wilder 320a951575 Fix default template being returned when partially matching
another filter.
2015-06-24 23:09:08 -06:00
Jason Wilder ba7187f554 Add comments to graphite parser 2015-06-24 23:09:08 -06:00
Jason Wilder f70eee6e7a Add support for multiple measurement fields in templates
Provides a little more flexibility in controlling the parsed
metric names for metris like:

  servers.localhost.cpu.cpu0.user

Previously, you could only use a single field like "cpu", "user"
or a wildcard to match "cpu.cpu0.user".  You can now pull out "cpu"
and "user" and join them together in the metric name using a custom
separator character.  By default this is ".".
2015-06-24 23:09:08 -06:00
Jason Wilder a2a1956048 Use search tree for filter matching
This adds a sorted search tree for matchining filters to a template
more efficiently.  Each filter is split on "." and each element is
added to the tree.  Patterns with matching prefixes are added under
the same subtree.
2015-06-24 23:09:08 -06:00
Jason Wilder 98cbfdca51 Update tempalte format comment 2015-06-24 23:09:07 -06:00
Jason Wilder dd0e6e5e02 Use strings.Fields to bef more forgiving of whitespace 2015-06-24 23:09:07 -06:00
Jason Wilder b55981f090 Add support for per-template default tags
These are tags that can be added at the template level.  They
will override any global tags and any parsed tags with the same
name from the metric will override these.
2015-06-24 23:09:07 -06:00
Jason Wilder 9cd82ae316 Add support for global tags
These are tags that can be add to all metrics.
2015-06-24 23:09:07 -06:00
Jason Wilder cab9e36111 Add basic template filtering support
This filter implementation is fairly naive and won't scale well
to large numbers of templates and filters.  It will be replaced
with a trie-based approach in the future.
2015-06-24 23:09:07 -06:00
Jason Wilder e5fbf249ff Remove DecodeNameAndTags func 2015-06-24 23:09:07 -06:00
Jason Wilder 46046c6d32 Add matcher for match a metric to a template
If no template matches, use a default template that just matches
the whole metric name as the measurement.
2015-06-24 23:09:07 -06:00
Jason Wilder 9bcbbd9875 Rename matcher to template 2015-06-24 23:09:07 -06:00
Jason Wilder d69a21c4e4 Allow skipping fields in templates 2015-06-24 23:09:07 -06:00
Jason Wilder a7d4d97743 Convert template matching to matcher struct 2015-06-24 23:09:06 -06:00
Jason Wilder d132263f08 Add support for measurement* 2015-06-24 23:09:06 -06:00
Jason Wilder d539b23817 Move graphite parser to separate file 2015-06-24 23:09:06 -06:00