-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cassandra] Allow turning off tags/logs indexing (#1915)
* Added options to enable/disable indexing of tags by type Signed-off-by: Joe Elliott <[email protected]> * Added drop all filter Signed-off-by: Joe Elliott <[email protected]> * Added drop filters Signed-off-by: Joe Elliott <[email protected]> * Removed enable Signed-off-by: Joe Elliott <[email protected]> * Fixed issue in chained tag filter Signed-off-by: Joe Elliott <[email protected]> * make fmt Signed-off-by: Joe Elliott <[email protected]> * Removed NewCompositeFilter Signed-off-by: Joe Elliott <[email protected]> * Removed uber copyright Signed-off-by: Joe Elliott <[email protected]> * Changed TagFilterDropAll to use pointer receivers Signed-off-by: Joe Elliott <[email protected]>
- Loading branch information
1 parent
0313d0d
commit b6086ec
Showing
9 changed files
with
228 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
plugin/storage/cassandra/spanstore/dbmodel/log_fields_filter.go
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
plugin/storage/cassandra/spanstore/dbmodel/log_fields_filter_test.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
plugin/storage/cassandra/spanstore/dbmodel/tag_filter_drop_all.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright (c) 2019 The Jaeger Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package dbmodel | ||
|
||
import ( | ||
"github.com/jaegertracing/jaeger/model" | ||
) | ||
|
||
// TagFilterDropAll filters all fields of a given type. | ||
type TagFilterDropAll struct { | ||
dropTags bool | ||
dropProcessTags bool | ||
dropLogs bool | ||
} | ||
|
||
// NewTagFilterDropAll return a filter that filters all of the specified type | ||
func NewTagFilterDropAll(dropTags bool, dropProcessTags bool, dropLogs bool) *TagFilterDropAll { | ||
return &TagFilterDropAll{ | ||
dropTags: dropTags, | ||
dropProcessTags: dropProcessTags, | ||
dropLogs: dropLogs, | ||
} | ||
} | ||
|
||
// FilterProcessTags implements TagFilter | ||
func (f *TagFilterDropAll) FilterProcessTags(span *model.Span, processTags model.KeyValues) model.KeyValues { | ||
if f.dropProcessTags { | ||
return model.KeyValues{} | ||
} | ||
return processTags | ||
} | ||
|
||
// FilterTags implements TagFilter | ||
func (f *TagFilterDropAll) FilterTags(span *model.Span, tags model.KeyValues) model.KeyValues { | ||
if f.dropTags { | ||
return model.KeyValues{} | ||
} | ||
return tags | ||
} | ||
|
||
// FilterLogFields implements TagFilter | ||
func (f *TagFilterDropAll) FilterLogFields(span *model.Span, logFields model.KeyValues) model.KeyValues { | ||
if f.dropLogs { | ||
return model.KeyValues{} | ||
} | ||
return logFields | ||
} |
Oops, something went wrong.