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

add K8s meta self metrics #1765

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

add K8s meta self metrics #1765

wants to merge 18 commits into from

Conversation

Abingcbc
Copy link
Collaborator

@Abingcbc Abingcbc commented Sep 18, 2024

1. 新增可观测指标:

  • API Server 缓存(进程级)
    1. Add、Update、Delete 数量
    2. 写入队列长度
    3. 当前缓存资源数量
  • HTTP Server(进程级)
    1. QPS
    2. 平均延迟
    3. 最大延迟
  • Entity Store(插件级)
    1. 事件条数

2. 调整部分entity和link字段

  • domain
  • PodNodeLink 的 type
  • Container EntityID的计算方法(加入了Pod名,防止冲突)

3. 支持没有采集配置时,仍然可以启动HTTP Server(ebpf场景)

s.metaManager = k8smeta.GetMetaManagerInstance()
s.configName = context.GetConfigName()

metricRecord := s.context.GetMetricRecord()
s.entityCount = helper.NewCounterMetricAndRegister(metricRecord, "k8s_meta_entity_count")
Copy link
Collaborator

Choose a reason for hiding this comment

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

命名规范

@@ -33,19 +34,27 @@ type ServiceK8sMeta struct {
Ingress bool
Copy link
Collaborator

Choose a reason for hiding this comment

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

domain去掉,增加个部署形态参数。

部署形态决定集群类型,以及entity前缀

Copy link
Collaborator

Choose a reason for hiding this comment

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

连边acs.k8s.pod --> acs.ack.cluster

"value.k8s_meta_http_avg_latency": avgLatency,
"value.k8s_meta_http_max_latency": strconv.FormatInt(m.maxLatency.Load(), 10),
}
m.requestCount.Add(-m.requestCount.Load())
Copy link
Collaborator

Choose a reason for hiding this comment

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

再确认下

@@ -369,8 +372,8 @@ func (m *metaCollector) generateClusterEntity() models.PipelineEvent {
log.Contents = models.NewLogContents()
log.Timestamp = uint64(time.Now().Unix())
log.Contents.Add(entityDomainFieldName, m.serviceK8sMeta.Domain)
log.Contents.Add(entityTypeFieldName, "infra.k8s.cluster")
log.Contents.Add(entityIDFieldName, m.genKey("", ""))
log.Contents.Add(entityTypeFieldName, m.genEntityTypeKey("cluster"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

container等定义成常量

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.

2 participants