Skip to content

Conversation

@dmsolr
Copy link
Member

@dmsolr dmsolr commented Feb 25, 2022

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

#4273

port: 9091
# labels:
#remote_addr: $remote_addr
#request_method: $request_method
Copy link
Contributor

@qizhendong1 qizhendong1 Feb 28, 2022

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 ?

Copy link
Contributor

@starsz starsz left a comment

Choose a reason for hiding this comment

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

Hi, @dmsolr Can you add test cases to cover this good feature?


## 如何自定义附加标签

该插件支持在`conf/config`的`plugin_attr`部分自定义度量标签`Status codes`和`Latency`。亚马尔`
Copy link
Contributor

Choose a reason for hiding this comment

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

亚马尔 ??
Maybe `yaml" ?

```yaml
plugin_attr:
prometheus:
prometheus:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
prometheus:
prometheus:

There seems to be a mistake here.


| Name | Type | Default | Description |
| ---------- | ------ | ------- | --------------------------------- |
| labels | array | | custom labels from [Nginx variables](http://nginx.org/en/docs/varindex.html) |
Copy link
Member

Choose a reason for hiding this comment

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

Better include the references to APISIX build-in variables as well


## 如何自定义附加标签

该插件支持在`conf/config`的`plugin_attr`部分自定义度量标签`Status codes`和`Latency`。亚马尔`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
该插件支持在`conf/config``plugin_attr`部分自定义度量标签`Status codes``Latency`亚马尔`
该插件支持在 `conf/config``plugin_attr` 部分自定义度量标签 `Status codes``Latency`


| 名称 | 类型 | 默认值 | 描述
| --------- | ----- | -------- | ------------------------- |
| labels | array | | 使用 [Nginx 变量](http://nginx.org/en/docs/varindex.html)作为自定义标签 |
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

@dmsolr dmsolr closed this Apr 2, 2022
@dmsolr dmsolr deleted the plugins/prometheus branch April 2, 2022 05:39
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.

4 participants