当前位置:网站首页>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
边栏推荐
- Construire un blog Cloud basé sur ECS (bénédiction sur le Code Cloud Xiaobao, explication détaillée de la tâche iphone13 gratuite)
- Basic concepts of database: OLTP / OLAP / HTAP, RPO / RTO, MPP
- switch case时连写常规判断表达式的错误 case和if并用 l
- Introduction to RDMA
- DDOS攻击/防御介绍
- Kubernetes CoreDNS常见问题资料参考
- Prometheus监控influxdb的方法及指标释义
- 异常记录-8
- 冬季实战营 动手实战-初识上云基础,动手实操ECS云服务器新手上路 领鼠标 云小宝 背包 无影
- VirtualBox如何修改“网络地址转换(NAT)”网络模式下分配给虚拟机的IP网段
猜你喜欢
Implementation of leetcode question brushing str ()
Using Prom label proxy to implement label based multi tenant reading of Prometheus thanos
Thanos compact component test summary (processing historical data)
LeetCode刷题|38外观数组
try catch 不能捕获异步错误
Analysis of Rdam principle
数据库基本概念:OLTP/OLAP/HTAP、RPO/RTO、MPP
[OSS file upload quick start]
通过源码探究@ModelAndView如何实现数据与页面的转发
Introduction to common APIs for EBFP programming
随机推荐
Detailed explanation of RDMA programming
rdam 原理解析
rdma 编程详解
Imitation scallop essay reading page
JS regular matching first assertion and last assertion
rdma网络介绍
MySQL【sql性能分析+sql调优】
Arranges the objects specified in the array in front of the array
Implementation of leetcode question brushing str ()
Prometheus监控influxdb的方法及指标释义
Prometheus Cortex架构概述(水平可扩展、高可用、多租户、长期存储)
MySQL索引【数据结构+索引创建原则】
阿里云日志服务sls的典型应用场景
memcached 源码分析
Kubernetes coredns FAQ reference
将博客搬至CSDN
异常记录-11
基于EMR离线数据分析-反馈有礼
Practice of openvswitch VLAN network
Leetcode integer plus one