Skip to content

Return WordPress version as _info metric #15

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

Closed
C-Duv opened this issue Mar 10, 2023 · 4 comments
Closed

Return WordPress version as _info metric #15

C-Duv opened this issue Mar 10, 2023 · 4 comments

Comments

@C-Duv
Copy link
Contributor

C-Duv commented Mar 10, 2023

Hello,

Could the plugin return the WordPress version as a metric?

This is something various exporters do via an _info metric:

The Prometheus Proxmox VE Exporter:

pve_version_info{instance="pve.example.com:9221",job="pve",release="7.3",repoid="d69b70d4",version="7.3-4"} 1

The Node exporter:

go_info{instance="foo.example.com:9100",job="node",version="go1.11.6"} 1

I've also done it on self-made applications:

mycompany_app_info{instance="app.example.com:443",job="app",version="42",build="ab2d3ef2ad62"} 1

The wp_info could be used:

wp_info{host="https://wp.example.com",version="6.1.1"} 1

If it's OK with you I can open a PR for this.

@Mte90
Copy link
Member

Mte90 commented Mar 10, 2023

Yes just do a PR :-)

@C-Duv
Copy link
Contributor Author

C-Duv commented Mar 10, 2023

Should I target master or v3.0 branch?

I don't see any CONTRIBUTING file so I'll try to mimic what I can from existing code.

@Mte90
Copy link
Member

Mte90 commented Mar 10, 2023

use the 3.0 (that I didn't noticed that exist, the other maintainer added it in october).
We will merge the 3.0 on master after your pr.

C-Duv added a commit to C-Duv/Prometheus-Metrics-in-WordPress that referenced this issue Mar 10, 2023
This adds a new wp_info metric that returns WordPress code and database
versions.

Versions are in the "version" and "db_version" labels.

Issue: CodeAtCode#15
C-Duv added a commit to C-Duv/Prometheus-Metrics-in-WordPress that referenced this issue Mar 10, 2023
This adds a new wp_info metric that returns WordPress code and database
versions.

Versions are in the "version" and "db_version" labels.

Issue: CodeAtCode#15
@C-Duv
Copy link
Contributor Author

C-Duv commented Mar 10, 2023

PR opened (#16) but it looks like it need some more work to make it work.

I'll give it another shot this week-end...

@Mte90 Mte90 closed this as completed Mar 13, 2023
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

No branches or pull requests

2 participants