-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat: filter metric value using regex #240
base: master
Are you sure you want to change the base?
feat: filter metric value using regex #240
Conversation
4266921
to
2fadfb1
Compare
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.
Please add unit tests and update the documentation/configuration file example so that users can understand how this feature works and how to use it.
The implementation looks good to me. Thanks for the PR!
config/config.go
Outdated
@@ -30,6 +30,7 @@ type Metric struct { | |||
EpochTimestamp string | |||
Help string | |||
Values map[string]string | |||
Regex 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.
Regex string | |
IncludeRegex string |
That feature would be very helpful, cause' it seems like there's no other way to convert string values like this |
@rustycl0ck Thanks for the PR! |
We have been using this feature for some time and it is very useful to us. It fully meets the expected requirements. We hope you can merge this request as soon as possible. This is really important for us. Thank you very much !!!!!! |
For example, using Gauge metrics to represent memory usage, number of connections, etc. Can convert string to float 1.52GB.
|
we cannot alter the source json. We cannot apply any transformation on the exporter's side. How are we supposed to extract any non-float data as a metric in order to plot it in grafana. We seriously need this feature or a similar solution. |
@SuperQ |
…theus-community#231) Signed-off-by: raed altuwaijri <[email protected]>
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.42.0 to 0.44.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](prometheus/common@v0.42.0...v0.44.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.9.1 to 0.10.0. - [Release notes](https://github.com/prometheus/exporter-toolkit/releases) - [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md) - [Commits](prometheus/exporter-toolkit@v0.9.1...v0.10.0) --- updated-dependencies: - dependency-name: github.com/prometheus/exporter-toolkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.27.1 to 0.27.2. - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](kubernetes/client-go@v0.27.1...v0.27.2) --- updated-dependencies: - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
* [FEATURE] Allow timestamps from metrics prometheus-community#167 * [FEATURE] Support Value Conversions prometheus-community#172 Signed-off-by: SuperQ <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: rustyclock <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: prombot <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: eli_eli <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: eli_eli <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: eli_eli <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: eli_eli <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: eli_eli <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: eli_eli <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: raed altuwaijri <[email protected]>
Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.27.2 to 0.28.1. - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](kubernetes/client-go@v0.27.2...v0.28.1) --- updated-dependencies: - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: prombot <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.15.1...v1.16.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
Signed-off-by: prombot <[email protected]> Signed-off-by: raed altuwaijri <[email protected]>
962da12
to
e7082f9
Compare
Signed-off-by: raedtwj <[email protected]>
Documentation and unit tests have been added, Special thanks to @eli-eli333 and @liubo20210831 |
this change let you filter metric values using regex
Ex config.yml
this config will be parsed
{"availableMemory": "1000 MB"}
to
and won't throwing parse error since the suffix is not matched by the pattern