-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
WIP feat: support customizing additional labels of metrics #6450
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -129,10 +129,28 @@ Here is an example: | |||||
|
||||||
```yaml | ||||||
plugin_attr: | ||||||
prometheus: | ||||||
prometheus: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There seems to be a mistake here. |
||||||
export_uri: /apisix/metrics | ||||||
``` | ||||||
|
||||||
## How to custom additional labels | ||||||
|
||||||
The plugin is supported to custom labels for metrics, `Status codes` and `Latency`, in the `plugin_attr` section of `conf/config.yaml` | ||||||
|
||||||
| Name | Type | Default | Description | | ||||||
| ---------- | ------ | ------- | --------------------------------- | | ||||||
| labels | array | | custom labels from [Nginx variables](http://nginx.org/en/docs/varindex.html) | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better include the references to APISIX build-in variables as well |
||||||
|
||||||
Here is an example: | ||||||
|
||||||
```yaml: | ||||||
plugin_attr: | ||||||
prometheus: | ||||||
labels: | ||||||
- request_method | ||||||
- server_addr | ||||||
``` | ||||||
|
||||||
### Grafana dashboard | ||||||
|
||||||
Metrics exported by the plugin can be graphed in Grafana using a drop in dashboard. | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -132,6 +132,24 @@ plugin_attr: | |||||
export_uri: /apisix/metrics | ||||||
``` | ||||||
|
||||||
## 如何自定义附加标签 | ||||||
|
||||||
该插件支持在`conf/config`的`plugin_attr`部分自定义度量标签`Status codes`和`Latency`。亚马尔` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
| 名称 | 类型 | 默认值 | 描述 | ||||||
| --------- | ----- | -------- | ------------------------- | | ||||||
| labels | array | | 使用 [Nginx 变量](http://nginx.org/en/docs/varindex.html)作为自定义标签 | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||||||
|
||||||
下面是一个例子: | ||||||
|
||||||
```yaml: | ||||||
plugin_attr: | ||||||
prometheus: | ||||||
labels: | ||||||
- request_method | ||||||
- server_addr | ||||||
``` | ||||||
|
||||||
### Grafana 面板 | ||||||
|
||||||
插件导出的指标可以在 Grafana 进行图形化绘制显示。 | ||||||
|
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.
This function is useful for us. we add metrics too on our code as hard code way.
Can you list lables or give a link which labels are support on doc ?