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

WIP feat: support customizing additional labels of metrics #6450

Closed
wants to merge 1 commit into from

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

@@ -438,6 +438,9 @@ plugin_attr:
export_addr:
ip: 127.0.0.1
port: 9091
# labels:
#remote_addr: $remote_addr
#request_method: $request_method
Copy link
Contributor

@zhendongcmss zhendongcmss 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?

@@ -132,6 +132,24 @@ plugin_attr:
export_uri: /apisix/metrics
```

## 如何自定义附加标签

该插件支持在`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" ?

@@ -129,10 +129,28 @@ Here is an example:

```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

@@ -132,6 +132,24 @@ plugin_attr:
export_uri: /apisix/metrics
```

## 如何自定义附加标签

该插件支持在`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