cloudfoundry/loggregator

LegacySelector is broken

Closed this issue · 3 comments

I am requesting specifically logs using LegacySelector...

&v2.EgressBatchRequest{
	ShardId: buildShardID(),
	LegacySelector: &v2.Selector{
		SourceId: *podName,
		Message: &v2.Selector_Log{
			Log: &v2.LogSelector{},
		},
	},
	UsePreferredTags: true,
}

...yet I get back counters and things that do not match my SourceId:

&loggregator_v2.Envelope{Timestamp:0, SourceId:"", InstanceId:"", DeprecatedTags:map[string]*loggregator_v2.Value(nil), Tags:map[string]string(nil), Message:(*loggregator_v2.Envelope_Counter)(0xc42000e0b0)}
&loggregator_v2.Envelope{Timestamp:0, SourceId:"", InstanceId:"", DeprecatedTags:map[string]*loggregator_v2.Value(nil), Tags:map[string]string(nil), Message:(*loggregator_v2.Envelope_Counter)(0xc42000e0c0)}

If this is going to continue to be part of the API it needs regression coverage.

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/153371903

The labels on this github issue will be updated when the story is started.

This is a mistake in the router component where LegacySelector is entirely ignored. See here.

We fixed it by having the RLP convert a LegacySelector to a Selector. The router therefore does not have to concern itself with LegacySelectors.