-
Notifications
You must be signed in to change notification settings - Fork 434
feat: support dynamic label values and global metrics record. #2268
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
base: main
Are you sure you want to change the base?
Conversation
Change-Id: I0ed79c684700adfd35d0ec67385e1b5abc22aaa6
Change-Id: I7dbb706bb72494d5aff7d0be6c1732a56fe421fd
| // A metric may have three levels of labels | ||
| // 1. MetricsRecord Level Const Labels, like PluginType=flusher_http, PluginId=1 | ||
| // 2. Metric Level Const Labels, for example, flusher_http may have a const label: RemoteURL=http://aliyun.com/write | ||
| // 3. Metric Level Dynamic Labels, like status_code=200, status_code=204 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是可以这样理解:
- MetricsRecord级别有一些label,也有一些没有自己label的metrics,他们会输出一个metric记录,也就是Line45这一条
- 每个Metric会有自己的一些const和Dynamic label,当有这些label时,一个metric会变成一条单独的metric记录被暴露出来,例如上面的http_flusher_status_code_count * 2,http_flusher_error_count * 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
指标是有类型的,go这边key是metric_category,value是agent、runner、这些。https://observability.cn/project/loongcollector/internal-metrics-description/#_top
具有单独label的Metric,是不是需要定义为plugin_source级?这块有考虑过吗
| // 1. MetricsRecord Level Const Labels, like PluginType=flusher_http, PluginId=1 | ||
| // 2. Metric Level Const Labels, for example, flusher_http may have a const label: RemoteURL=http://aliyun.com/write | ||
| // 3. Metric Level Dynamic Labels, like status_code=200, status_code=204 | ||
| func (m *MetricsRecord) ExportMetricRecords() []map[string]string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
方便给一个前后对比吗?先前有问题的指标和修改之后的样子
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我晚点补一下
Change-Id: I40af41f54bec8b41545a2712526f652ea52fc933
Uh oh!
There was an error while loading. Please reload this page.