当前位置:网站首页>How does thanos configure different data retention durations for different tenants
How does thanos configure different data retention durations for different tenants
2022-04-23 07:05:00 【A sunny afternoon】
In previous practice, we have achieved prometheus Multi tenant read write :Prometheus and Thanos Receiver Of “ Write multi tenant ” Realization _ A sunny afternoon blog -CSDN Blog
The new requirement is to configure different data retention periods for different tenants . at present compactor Components naturally do not have the ability of multi tenancy , But it has one parameter
--selector.relabel-config=<content>
Alternative to 'selector.relabel-config-file'
flag (mutually exclusive). Content of YAML file
that contains relabeling configuration that
allows selecting blocks. It follows native
Prometheus relabel-config syntax. See format
details:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#
It can make compactor In the synchronization object store block Filter according to the defined rules , Take advantage of this feature , We can implement the concept of multi tenancy .
By configuring hashring, Different tenants are in different receive Will form different block flow ( It can be downloaded from compactor Component or bucketweb Component's UI Interface view ), these block The stream has tags similar to the following :
replica: thanos-prod-receive-1
tenant_id: tenant-a
So we can create one for each tenant compactor, adopt selector.relabel-config Specify the compactor Process only for this tenant block flow :
# Tenant tenant-a Of compactor To configure
- |
--selector.relabel-config=
- action: keep
source_labels: ["tenant_id"]
regex: "tenant-a"
- --retention.resolution-raw=180d
- --retention.resolution-5m=180d
- --retention.resolution-1h=180d
# Tenant tenant-b Of compactor To configure
- |
--selector.relabel-config=
- action: keep
source_labels: ["tenant_id"]
regex: "tenant-b"
- --retention.resolution-raw=60d
- --retention.resolution-5m=60d
- --retention.resolution-1h=60d
The above configuration can realize tenant-a Data retention 180d,tenant-b Data retention 60d.
compactor Still abide by the principle of singleton , Only one can be configured for each tenant compactor.
版权声明
本文为[A sunny afternoon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230600558278.html
边栏推荐
猜你喜欢

BPF program of type XDP

基于ECS搭建云上博客(体验有礼)

Number of stair climbing methods of leetcode
![[OSS file upload quick start]](/img/db/9043d1df0163a7154bebac8e79097f.png)
[OSS file upload quick start]

qs.stringify 接口里把入参转为&连接的字符串(配合application/x-www-form-urlencoded请求头)

基於ECS搭建雲上博客(雲小寶碼上送祝福,免費抽iphone13任務詳解)

【ES6快速入门】

Winter combat camp hands-on combat - cloud essential environment preparation, hands-on practical operation, quickly build lamp environment, lead mouse cloud Xiaobao backpack without shadow

Web登录小案例(含验证码登录)

LeetCode刷题|13罗马数字转整数
随机推荐
Oracle Net Service:监听器与服务名解析方法
EMR Based offline data analysis - polite feedback
SSM项目在阿里云部署
[fish in the net] ansible awx calls playbook to transfer parameters
异常记录-16
Kids and COVID: why young immune systems are still on top
Prometheus Cortex架构概述(水平可扩展、高可用、多租户、长期存储)
异常记录-5
qs.stringify 接口里把入参转为&连接的字符串(配合application/x-www-form-urlencoded请求头)
LeetCode刷题|897递增顺序搜索树
如何使用TiUP部署一个TiDB v5.0集群
try catch 不能捕获异步错误
Analysis of Rdam principle
异常记录-13
用Future与CountDownLatch实现多线程执行多个异步任务,任务全部完成后返回结果
Will restarting the Oracle listener break the existing connection
将博客搬至CSDN
基于ECS搭建云上博客(体验有礼)
Prometheus Thanos快速指南
[MySQL basics] startup options, system variables and status variables