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

refactor: self metric apis #1485

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

Conversation

shunjiazhu
Copy link
Contributor

@shunjiazhu shunjiazhu commented May 14, 2024

重构iLogtail自监控 API

  1. 支持注入额外静态Label,比如 flusher_http可以把 url 也打出来。
  2. 支持可变 Label Value, LabelKeys 需要在声明时提供(参考 prometheus sdk),定义好keys可以获得数倍性能提升。
  3. 部分非法打点用法不会生效,会有warning日志,比如使用未定义的 Label Keys等(prometheus直接 panic 过于激进)。
  4. 当前main分支上的打点用法保持不变。
  5. 尽可能和 v1.8.8 分支保持一致。

MetricsRecords ---> MetricsVector ----> Metric[Counter, Gauge, Latency, Str]
Pipeline接口变动:
image

用法:
声明 Metric 或者 MetricVector
image

MetricVector 需要使用 WithLabel API获取 一个 Metric:
image

Metric API 和原先基本保持一致。
image

@shunjiazhu shunjiazhu force-pushed the refactor/self-metric-stage-1 branch from 86cc213 to b228f61 Compare May 14, 2024 13:27
@shunjiazhu shunjiazhu force-pushed the refactor/self-metric-stage-1 branch from 62dcdc7 to 8dfb0ff Compare May 16, 2024 03:44
…stage-1

Change-Id: I5dc62d9c751d1096595e888feaa204f7752a9860
Change-Id: Ib1876ab352975a4fcf25cd279108137a28d685f7
Change-Id: I7428a399fc31502295bd4437c6f0f391910ee30a
Change-Id: I56c7fabb7fae01b4aae8fb8d495637cbeb2a4f08
Change-Id: I0b9650aae723bed41a8787f1ff6bc6c2881a7987
Change-Id: Ic188eb9f62eae63e344059062fdb7dfbbb692ac9
pkg/pipeline/self_metrics.go Show resolved Hide resolved
pkg/pipeline/self_metrics.go Outdated Show resolved Hide resolved
pkg/pipeline/context.go Outdated Show resolved Hide resolved
pkg/helper/self_metrics_v2_imp.go Outdated Show resolved Hide resolved
pkg/helper/self_metrics_v2_imp.go Outdated Show resolved Hide resolved
pkg/pipeline/context.go Show resolved Hide resolved
@shunjiazhu shunjiazhu force-pushed the refactor/self-metric-stage-1 branch from 0856b9c to 998799c Compare June 1, 2024 10:54
Change-Id: If5b0f4f2cebb0744a65b9a4aa1825415474b6324
@shunjiazhu shunjiazhu force-pushed the refactor/self-metric-stage-1 branch 2 times, most recently from 2542277 to f5a6d3f Compare June 3, 2024 11:11
@shunjiazhu shunjiazhu force-pushed the refactor/self-metric-stage-1 branch from f5a6d3f to 87020a7 Compare June 3, 2024 11:20
@shunjiazhu shunjiazhu force-pushed the refactor/self-metric-stage-1 branch from 16020f4 to c296068 Compare June 3, 2024 11:48
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