Skip to content

Commit

Permalink
Remove SkipMapping flag
Browse files Browse the repository at this point in the history
  • Loading branch information
razmser committed Jan 23, 2025
1 parent 443a597 commit 8b00ab7
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 26 deletions.
4 changes: 0 additions & 4 deletions internal/aggregator/autocreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ type KnownTag struct {
ID string `json:"id,omitempty"`
Description string `json:"description,omitempty"`
RawKind string `json:"raw_kind,omitempty"`
SkipMapping bool `json:"skip_mapping,omitempty"`
Whitelist []string `json:"whitelist,omitempty"`
}

Expand Down Expand Up @@ -389,9 +388,6 @@ func publishDraftTags(meta *format.MetricMetaValue, knownTags []KnownTag) int {
draftTag.RawKind = rawKind
}
}
if knownTag.SkipMapping {
draftTag.SkipMapping = true
}
if len(meta.Tags) <= x {
meta.Tags = append(make([]format.MetricMetaTag, 0, x+1), meta.Tags...)
meta.Tags = meta.Tags[:x+1]
Expand Down
12 changes: 0 additions & 12 deletions internal/api/handler_easyjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/api/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ func (b *queryBuilder) writeTagCond(lod *data_model.LOD, in bool) {
sep, predicate = " AND ", " NOT IN "
}
metric := b.singleMetric()
version3StrcmpOn := b.version3StrcmpOn(metric, lod)
for i, filter := range f.Tags {
if filter.Empty() {
continue
}
b.WriteString(" AND (")
// mapped
tagID := format.TagID(i)
version3StrcmpOn := b.version3StrcmpOn(metric, i, lod)
var hasMapped bool
var hasValue bool
var version3HasEmpty bool
Expand Down
8 changes: 2 additions & 6 deletions internal/api/sql_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,8 @@ func (b *queryBuilder) tagValueIDsQueryV3(lod *data_model.LOD) *tagValuesSelectC
return &q
}

func (b *queryBuilder) version3StrcmpOn(metric *format.MetricMetaValue, tagX int, lod *data_model.LOD) bool {
version3StrcmpOn := lod.Version == Version3 && !b.strcmpOff
if !version3StrcmpOn || metric == nil || len(metric.Tags) <= tagX {
return version3StrcmpOn
}
return metric.Tags[tagX].SkipMapping
func (b *queryBuilder) version3StrcmpOn(metric *format.MetricMetaValue, lod *data_model.LOD) bool {
return lod.Version == Version3 && !b.strcmpOff
}

func (b *queryBuilder) mappedColumnNameV3(tagID string, lod *data_model.LOD) string {
Expand Down
1 change: 0 additions & 1 deletion internal/format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ type MetricMetaTag struct {
RawKind string `json:"raw_kind,omitempty"` // UI can show some raw values beautifully - timestamps, hex values, etc.
ID2Value map[int32]string `json:"id2value,omitempty"`
ValueComments map[string]string `json:"value_comments,omitempty"`
SkipMapping bool `json:"skip_mapping,omitempty"` // used only in v3 conveyor

Comment2Value map[string]string `json:"-"` // Should be restored from ValueComments after reading
IsMetric bool `json:"-"` // Only for built-in metrics so never saved or parsed
Expand Down
2 changes: 0 additions & 2 deletions internal/mapping/pipeline_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ func (mp *mapPipelineV2) mapTags(h *data_model.MappedMetricHeader, metric *tlsta
continue
}
switch {
case tagMeta.SkipMapping:
h.SetSTag(tagMeta.Index, v.Value, tagIDKey)
case tagMeta.Index == format.StringTopTagIndex:
h.TopValue.S = v.Value
if h.IsSKeySet {
Expand Down

0 comments on commit 8b00ab7

Please sign in to comment.