betfair / opentsp

Time Series Pipeline (TSP) is an open metric gathering and routing system.
Apache License 2.0
27 stars 5 forks source link

Possible to have duplicated objects #6

Closed andredasilvapinto closed 9 years ago

andredasilvapinto commented 9 years ago

Even though the configuration doesn't allow to have duplicated targets, it is possible to provoke duplicated objects, if, for example, we erroneously search for a process that is a cluster id as view.Objects just appends the result of host and process queries without caring if they include duplicates.

https://github.com/betfair/opentsp/blob/master/cmd/tsp-controller/control/collect-jmx/control.go#L319

https://github.com/betfair/opentsp/blob/master/cmd/tsp-controller/control/collect-jmx/control.go#L319

masiulaniec commented 9 years ago

The check for redeclared jmx query is deliberately absent from the query code path. These declarations reside in a file so they can be caught ahead of time at configuration load time. The -n command-line exists to allow operators to prevent such errors from propagating to the production environment. This is good because it designs away a failure mode.

The Update function is where configuration validation occurs. It has support for detecting some redeclarations but it might be incomplete. Could you provide a test case that illustrates the issue? It would be a good addition to control_test.go.

On 12 December 2014 at 10:59, André Pinto notifications@github.com wrote:

Even though the configuration doesn't allow to have duplicated targets, it is possible to provoke duplicated objects, if, for example, we erroneously search for a process that is a cluster id as view.Objects just appends the result of host and process queries without caring if they include duplicates.

https://github.com/betfair/opentsp/blob/master/cmd/tsp-controller/control/collect-jmx/control.go#L319

https://github.com/betfair/opentsp/blob/master/cmd/tsp-controller/control/collect-jmx/control.go#L319

— Reply to this email directly or view it on GitHub https://github.com/betfair/opentsp/issues/6.

masiulaniec commented 9 years ago

I think this will become a non-issue once #5 is fixed.