Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Oct 12, 2023
1 parent 8f892eb commit d0b2c88
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ objects:
- --log.level=${THANOS_LOG_LEVEL}
- --objstore.config=$(OBJSTORE_CONFIG)
- --remote-write.address=0.0.0.0:19291
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-receive-router
sampler_type: ratelimiting
sampler_param: 2
- --tsdb.path=/var/thanos/receive
env:
- name: OBJSTORE_CONFIG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,25 @@ objects:
observatorium/tenant: default
name: observatorium-thanos-receive-controller-default
namespace: rhobs
- apiVersion: v1
data:
receive-limits.yaml: |
write:
default:
request:
samples_limit: 100000
kind: ConfigMap
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: database-write-hashring-router
app.kubernetes.io/instance: observatorium
app.kubernetes.io/name: thanos-receive-router
app.kubernetes.io/part-of: observatorium
app.kubernetes.io/version: v0.32.4
observatorium/tenant: default
name: receive-limits-config-default
namespace: rhobs
- apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -248,6 +267,12 @@ objects:
- --receive.hashrings-file-refresh-interval=5s
- --receive.limits-config-file=/etc/thanos/receive-limits/limits.yaml
- --remote-write.address=0.0.0.0:19291
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-receive-router
sampler_type: ratelimiting
sampler_param: 2
image: quay.io/thanos/thanos:v0.32.4
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -342,7 +367,7 @@ objects:
name: thanos-receive-hashring-generated-default
name: hashring-config
- configMap:
name: receive-limits-config
name: receive-limits-config-default
name: receive-limits-config
- apiVersion: v1
kind: Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ objects:
- --objstore.config=$(OBJSTORE_CONFIG)
- --selector.relabel-config-file=/tmp/config/hashmod-config.yaml
- --store.enable-index-header-lazy-reader=true
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-store
sampler_type: ratelimiting
sampler_param: 2
env:
- name: HOST_IP_ADDRESS
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ objects:
- --objstore.config=$(OBJSTORE_CONFIG)
- --selector.relabel-config-file=/tmp/config/hashmod-config.yaml
- --store.enable-index-header-lazy-reader=true
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-store
sampler_type: ratelimiting
sampler_param: 2
env:
- name: HOST_IP_ADDRESS
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ objects:
- --objstore.config=$(OBJSTORE_CONFIG)
- --selector.relabel-config-file=/tmp/config/hashmod-config.yaml
- --store.enable-index-header-lazy-reader=true
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-store
sampler_type: ratelimiting
sampler_param: 2
env:
- name: HOST_IP_ADDRESS
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ objects:
- --objstore.config=$(OBJSTORE_CONFIG)
- --selector.relabel-config-file=/tmp/config/hashmod-config.yaml
- --store.enable-index-header-lazy-reader=true
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-store
sampler_type: ratelimiting
sampler_param: 2
env:
- name: HOST_IP_ADDRESS
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ objects:
- --objstore.config=$(OBJSTORE_CONFIG)
- --selector.relabel-config-file=/tmp/config/hashmod-config.yaml
- --store.enable-index-header-lazy-reader=true
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-store
sampler_type: ratelimiting
sampler_param: 2
env:
- name: HOST_IP_ADDRESS
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ objects:
- --objstore.config=$(OBJSTORE_CONFIG)
- --selector.relabel-config-file=/tmp/config/hashmod-config.yaml
- --store.enable-index-header-lazy-reader=true
- |
--tracing.config=type: JAEGER
config:
service_name: thanos-store
sampler_type: ratelimiting
sampler_param: 2
env:
- name: HOST_IP_ADDRESS
valueFrom:
Expand Down
10 changes: 9 additions & 1 deletion services_go/instances/rhobs/rhobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ func ClusterConfigs() []observatorium.Observatorium {
ThanosTenantConfig: observatorium.ThanosTenantConfig[receive.Router]{
Tenant: "default",
},
ReceiveLimits: []struct{}{},
ReceiveLimits: &receive.ReceiveLimitsConfig{
WriteLimits: receive.WriteLimitsConfig{
DefaultLimits: receive.DefaultLimitsConfig{
RequestLimits: receive.RequestLimitsConfig{
SamplesLimit: 100000,
},
},
},
},
ReceiveControllerImageTag: "main-2023-09-22-f168dd7",
},
},
Expand Down
25 changes: 15 additions & 10 deletions services_go/observatorium/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
"github.com/observatorium/observatorium/configuration_go/abstr/kubernetes/thanos/store"
"github.com/observatorium/observatorium/configuration_go/k8sutil"

Check failure on line 13 in services_go/observatorium/metrics.go

View workflow job for this annotation

GitHub Actions / build

github.com/observatorium/[email protected]: replacement directory ../observatorium does not exist
"github.com/observatorium/observatorium/configuration_go/openshift"

Check failure on line 14 in services_go/observatorium/metrics.go

View workflow job for this annotation

GitHub Actions / build

github.com/observatorium/[email protected]: replacement directory ../observatorium does not exist
"github.com/observatorium/observatorium/configuration_go/schemas/thanos/common"
"github.com/observatorium/observatorium/configuration_go/schemas/thanos/log"

Check failure on line 15 in services_go/observatorium/metrics.go

View workflow job for this annotation

GitHub Actions / build

github.com/observatorium/[email protected]: replacement directory ../observatorium does not exist
"github.com/observatorium/observatorium/configuration_go/schemas/thanos/objstore"

Check failure on line 16 in services_go/observatorium/metrics.go

View workflow job for this annotation

GitHub Actions / build

github.com/observatorium/[email protected]: replacement directory ../observatorium does not exist
objstore3 "github.com/observatorium/observatorium/configuration_go/schemas/thanos/objstore/s3"

Check failure on line 17 in services_go/observatorium/metrics.go

View workflow job for this annotation

GitHub Actions / build

github.com/observatorium/[email protected]: replacement directory ../observatorium does not exist
thanostime "github.com/observatorium/observatorium/configuration_go/schemas/thanos/time"

Check failure on line 18 in services_go/observatorium/metrics.go

View workflow job for this annotation

GitHub Actions / build

github.com/observatorium/[email protected]: replacement directory ../observatorium does not exist
trclient "github.com/observatorium/observatorium/configuration_go/schemas/thanos/tracing/client"

Check failure on line 19 in services_go/observatorium/metrics.go

View workflow job for this annotation

GitHub Actions / build

github.com/observatorium/[email protected]: replacement directory ../observatorium does not exist
"github.com/observatorium/observatorium/configuration_go/schemas/thanos/tracing/jaeger"
routev1 "github.com/openshift/api/route/v1"
Expand Down Expand Up @@ -54,10 +55,14 @@ func makeReceiveRouter(namespace, imageTag string, cfg ThanosReceiveRouterConfig
router.PodResources.Requests[corev1.ResourceMemory] = resource.MustParse("200Gi")
router.PodResources.Limits[corev1.ResourceMemory] = resource.MustParse("200Gi")
router.Sidecars = []k8sutil.ContainerProvider{makeJaegerAgent("observatorium-tools")}
receiveLimitsConfigMap := "receive-limits-config-" + cfg.Tenant
router.ConfigMaps[receiveLimitsConfigMap] = map[string]string{
"receive-limits.yaml": cfg.ReceiveLimits.String(),
}

// Router config
router.Options.LogLevel = common.LogLevelWarn
router.Options.LogFormat = common.LogFormatLogfmt
router.Options.LogLevel = log.LogLevelWarn
router.Options.LogFormat = log.LogFormatLogfmt
router.Options.TracingConfig = &trclient.TracingConfig{
Type: trclient.Jaeger,
Config: jaeger.Config{
Expand All @@ -81,7 +86,7 @@ func makeReceiveRouter(namespace, imageTag string, cfg ThanosReceiveRouterConfig
routerDeployment := getObject[*appsv1.Deployment](manifests)
routerDeployment.Spec.Template.Spec.Volumes = []corev1.Volume{
k8sutil.NewPodVolumeFromConfigMap("hashring-config", generatedHashringCm),
k8sutil.NewPodVolumeFromConfigMap("receive-limits-config", "receive-limits-config"),
k8sutil.NewPodVolumeFromConfigMap("receive-limits-config", receiveLimitsConfigMap),
}

// Add thanos-receive-controller
Expand Down Expand Up @@ -140,8 +145,8 @@ func makeReceiveIngestor(namespace, imageTag string, cfg ThanosTenantConfig[rece
ingestor.Sidecars = []k8sutil.ContainerProvider{makeJaegerAgent("observatorium-tools")}

// Router config
ingestor.Options.LogLevel = common.LogLevelWarn
ingestor.Options.LogFormat = common.LogFormatLogfmt
ingestor.Options.LogLevel = log.LogLevelWarn
ingestor.Options.LogFormat = log.LogFormatLogfmt
ingestor.Options.TracingConfig = &trclient.TracingConfig{
Type: trclient.Jaeger,
Config: jaeger.Config{
Expand Down Expand Up @@ -198,7 +203,7 @@ func makeCompactor(namespace, imageTag string, cfg ThanosTenantConfig[compactor.
compactorSatefulset.Sidecars = []k8sutil.ContainerProvider{makeOauthProxy(10902, namespace, compactorSatefulset.Name, tlsSecret)}

// Compactor config
compactorSatefulset.Options.LogLevel = common.LogLevelWarn
compactorSatefulset.Options.LogLevel = log.LogLevelWarn
compactorSatefulset.Options.RetentionResolutionRaw = 0
compactorSatefulset.Options.RetentionResolution5m = 0
compactorSatefulset.Options.RetentionResolution1h = 0
Expand Down Expand Up @@ -353,11 +358,11 @@ func makeStore(namespace, imageTag string, cfg ThanosTenantConfig[store.StoreSta
}

// Store config
storeStatefulSet.Options.LogLevel = common.LogLevelWarn
storeStatefulSet.Options.LogFormat = common.LogFormatLogfmt
storeStatefulSet.Options.LogLevel = log.LogLevelWarn
storeStatefulSet.Options.LogFormat = log.LogFormatLogfmt
storeStatefulSet.Options.IgnoreDeletionMarksDelay = 24 * time.Hour
maxTimeDur := time.Duration(-22) * time.Hour
storeStatefulSet.Options.MaxTime = &common.TimeOrDurationValue{Dur: &maxTimeDur}
storeStatefulSet.Options.MaxTime = &thanostime.TimeOrDurationValue{Dur: &maxTimeDur}
storeStatefulSet.Options.SelectorRelabelConfigFile = "/tmp/config/hashmod-config.yaml"
storeStatefulSet.Options.TracingConfig = &trclient.TracingConfig{
Type: trclient.Jaeger,
Expand Down
2 changes: 1 addition & 1 deletion services_go/observatorium/observatorium.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type ThanosTenantConfig[T compactor.CompactorStatefulSet | store.StoreStatefulSe

type ThanosReceiveRouterConfig struct {
ThanosTenantConfig[receive.Router]
ReceiveLimits []struct{}
ReceiveLimits *receive.ReceiveLimitsConfig
ReceiveControllerImageTag string
}

Expand Down

0 comments on commit d0b2c88

Please sign in to comment.