Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/linkerd-control-plane/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ spec:
podMetricsEndpoints:
- interval: {{ $podMonitor.scrapeInterval }}
scrapeTimeout: {{ $podMonitor.scrapeTimeout }}
{{- if not (kindIs "invalid" $podMonitor.serviceMirror.honorTimestamps) }}
honorTimestamps: {{ $podMonitor.serviceMirror.honorTimestamps }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_label_linkerd_io_control_plane_component
Expand Down Expand Up @@ -99,6 +102,9 @@ spec:
podMetricsEndpoints:
- interval: {{ $podMonitor.scrapeInterval }}
scrapeTimeout: {{ $podMonitor.scrapeTimeout }}
{{- if not (kindIs "invalid" $podMonitor.proxy.honorTimestamps) }}
honorTimestamps: {{ $podMonitor.proxy.honorTimestamps }}
{{- end }}
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_container_name
Expand Down
7 changes: 7 additions & 0 deletions charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,16 @@ podMonitor:
serviceMirror:
# -- Enables the creation of PodMonitor for the Service Mirror component
enabled: true
# -- Sets honorTimestamps for the Service Mirror PodMonitor endpoint. When set to false,
# Prometheus uses scrape time instead of exporter-provided timestamps.
honorTimestamps: false
proxy:
# -- Enables the creation of PodMonitor for the data-plane
enabled: true
# -- Sets honorTimestamps for the proxy PodMonitor endpoint. When set to false,
# Prometheus uses scrape time instead of exporter-provided timestamps,
# preventing duplicate timestamp drops in clusters with frequent pod restarts.
honorTimestamps: false


# Egress related configuration
Expand Down
3 changes: 2 additions & 1 deletion pkg/charts/linkerd2/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ type (

// PodMonitorComponent contains the fields to configure the Prometheus Operator `PodMonitor` for other components
PodMonitorComponent struct {
Enabled bool `json:"enabled"`
Enabled bool `json:"enabled"`
HonorTimestamps *bool `json:"honorTimestamps,omitempty"`
}

// PolicyController contains the fields to configure the policy controller container
Expand Down
4 changes: 2 additions & 2 deletions pkg/charts/linkerd2/values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ func TestNewValues(t *testing.T) {
- linkerd-viz
`,
},
ServiceMirror: &PodMonitorComponent{Enabled: true},
Proxy: &PodMonitorComponent{Enabled: true},
ServiceMirror: &PodMonitorComponent{Enabled: true, HonorTimestamps: func() *bool { b := false; return &b }()},
Proxy: &PodMonitorComponent{Enabled: true, HonorTimestamps: func() *bool { b := false; return &b }()},
},
DestinationController: &DestinationController{
MeshedHttp2ClientProtobuf: map[string]interface{}{
Expand Down