Skip to content

Commit

Permalink
NETOBSERV-265 and NETOBSERV-348 timestamp indexing
Browse files Browse the repository at this point in the history
As a result to using millisecond-based time fields (TimeFlowEndMs,
TimeFlowStartMs), we also need to change the time indexed field to keep
consistent queries (TimeFlowEnd => TimeFlowEndMs)

Take that opportunity to stop exposing this as a config, as it could
create troubles
  • Loading branch information
jotak committed May 11, 2022
1 parent d0a45a1 commit 9b50689
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 19 deletions.
4 changes: 0 additions & 4 deletions api/v1alpha1/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ type FlowCollectorLoki struct {
//+kubebuilder:default:={"app":"netobserv-flowcollector"}
// StaticLabels is a map of common labels to set on each flow
StaticLabels map[string]string `json:"staticLabels,omitempty"`

//+kubebuilder:default:="TimeFlowEnd"
// TimestampLabel is the label to use for time indexing in Loki. E.g. "TimeReceived", "TimeFlowStart", "TimeFlowEnd".
TimestampLabel string `json:"timestampLabel,omitempty"`
}

// FlowCollectorConsolePlugin defines the desired ConsolePlugin state of FlowCollector
Expand Down
5 changes: 0 additions & 5 deletions config/crd/bases/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1501,11 +1501,6 @@ spec:
description: Timeout is the maximum time connection / request
limit A Timeout of zero means no timeout.
type: string
timestampLabel:
default: TimeFlowEnd
description: TimestampLabel is the label to use for time indexing
in Loki. E.g. "TimeReceived", "TimeFlowStart", "TimeFlowEnd".
type: string
url:
default: http://loki:3100/
description: URL is the address of an existing Loki service to
Expand Down
3 changes: 2 additions & 1 deletion controllers/flowlogspipeline/flp_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ func (b *builder) configMap() (*corev1.ConfigMap, string) {
lokiWrite["staticLabels"] = b.desiredLoki.StaticLabels
lokiWrite["timeout"] = b.desiredLoki.Timeout.ToUnstructured()
lokiWrite["url"] = b.desiredLoki.URL
lokiWrite["timestampLabel"] = b.desiredLoki.TimestampLabel
lokiWrite["timestampLabel"] = "TimeFlowEndMs"
lokiWrite["timestampScale"] = "1ms"
}

loki = map[string]interface{}{"name": "loki",
Expand Down
9 changes: 0 additions & 9 deletions docs/FlowCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -2630,15 +2630,6 @@ Loki contains settings related to the loki client
<i>Default</i>: 10s<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>timestampLabel</b></td>
<td>string</td>
<td>
TimestampLabel is the label to use for time indexing in Loki. E.g. "TimeReceived", "TimeFlowStart", "TimeFlowEnd".<br/>
<br/>
<i>Default</i>: TimeFlowEnd<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>url</b></td>
<td>string</td>
Expand Down

0 comments on commit 9b50689

Please sign in to comment.