File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -306,6 +306,8 @@ def init(
306306 use_udp = False ,
307307 timeout = 22 ,
308308 ssl = False ,
309+ retention_policy_replication : str = "1" ,
310+ set_retention_policy_default = True ,
309311 ** kwargs ,
310312):
311313 """
@@ -326,6 +328,8 @@ def init(
326328 use_udp: 是否使用udp协议打点
327329 timeout: 与influxdb建立连接时的超时时间
328330 ssl: 是否使用https协议
331+ retention_policy_replication: 保留策略的副本数, 确保数据的可靠性和高可用性。如果一个节点发生故障,其他节点可以继续提供服务,从而避免数据丢失和服务不可用的情况
332+ set_retention_policy_default: 是否设置为默认的保留策略,当retention_policy初次创建时有效
329333 **kwargs: 可传递MetricsEmitter类的参数
330334
331335 Returns:
@@ -376,8 +380,8 @@ def init(
376380 influxdb_client .create_retention_policy (
377381 retention_policy ,
378382 retention_policy_duration ,
379- replication = "1" ,
380- default = True ,
383+ replication = retention_policy_replication ,
384+ default = set_retention_policy_default ,
381385 )
382386 except Exception as e :
383387 log .error ("metrics init falied: {}" .format (e ))
You can’t perform that action at this time.
0 commit comments