Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance prometheus sharding in kubernetes #932

Merged
merged 7 commits into from Aug 3, 2023

Conversation

EvanLjp
Copy link
Collaborator

@EvanLjp EvanLjp commented Jun 15, 2023

历史使用ILOGTAIL_PROMETHEUS_CLUSTER_REPLICAS 环境变量扩缩容,但是环境变量无法感知scale 操作的扩缩容,因此分片模式运行时可能倒是抓取重复问题,目前使用动态k8s api 获取扩缩容的变化

logger.Error(p.context.GetRuntimeContext(), "KUBE_PROMETHEUS_ALARM", "read workload name err", p.workloadName)
return false
}
for i := 0; i < 3; i++ {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3次失败后怎么处理?

Copy link
Collaborator Author

@EvanLjp EvanLjp Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加了一下,如果一直失败,会退化成1副本,最差是采集重复

func (p *ServiceStaticPrometheus) StartKubeReloadScraper() {
go func() {
ticker := time.NewTicker(time.Second * 10)
for {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个功能是默认开的? daemonset每个节点都会调用?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是只要statefulset就可以了

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILOGTAIL_PROMETHEUS_CLUSTER_REPLICAS 有环境变量控制

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILOGTAIL_PROMETHEUS_CLUSTER_REPLICAS不是老的模式吗?新的模式怎么控制?

@linrunqi08 linrunqi08 merged commit 2856c5d into main Aug 3, 2023
24 checks passed
@EvanLjp EvanLjp deleted the enhance-prometheus-sharding branch August 3, 2023 08:31
@linrunqi08 linrunqi08 added this to the v1.7 milestone Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants