The feature `Adding new metrics` exists in README but not implemented
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- databases, documentation
Research direction
Start with the README's “Adding new metrics” section and compare it with the documented config-file method and the current metricMaps implementation. Review commit 2a08787a90840a27d10ec519005ff92148055cd1, then update the documentation so the supported way to add metrics is accurate and verify that the obsolete Python example is resolved.
Written by the indexing model from the issue text.
Description
What did you do?
Read the README about how to add a new metric.
What did you expect to see?
Find the method about how to add a new metric.
What did you see instead? Under which circumstances?
In the README:
### Adding new metrics
The exporter will attempt to dynamically export additional metrics if they are added in the
future, but they will be marked as "untyped". Additional metric maps can be easily created
from Postgres documentation by copying the tables and using the following Python snippet:
x = """tab separated raw text of a documentation table"""
for l in StringIO(x):
column, ctype, description = l.split('\t')
print """"{0}" : {{ prometheus.CounterValue, prometheus.NewDesc("pg_stat_database_{0}", "{2}", nil, nil) }}, """.format(column.strip(), ctype, description.strip())
Adjust the value of the resultant prometheus value type appropriately. This helps build
rich self-documenting metrics for the exporter.
And I cannot find any way to add this Python code. And checked the code, there is no there method to add new metric except Adding new metrics via a config file.
Check the commit, the document comes from the very early commit https://github.com/prometheus-community/postgres_exporter/commit/2a08787a90840a27d10ec519005ff92148055cd1#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R31 looks it means I need to create a new view in PostgreSQL using PL/Python, then add a new metric type in metricMaps and recompile postgres_exporter.
I think this is a document mistake.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 838
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from prometheus-community/postgres_exporter
-
BDU:2025-02344Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
prometheus-community/postgres_exporter#1391 ·
Maintainers usually reply within 2 days
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
prometheus-community/postgres_exporter#1374 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
prometheus-community/postgres_exporter#1365 ·
Maintainers usually reply within 2 days
-
Bug: wal collector crashes on Aurora PostgreSQLPossibly taken @megative claimed this 141 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
prometheus-community/postgres_exporter#1309 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
prometheus-community/postgres_exporter#716 · 3 reactions ·
Maintainers usually reply within 2 days
All issues in prometheus-community/postgres_exporter
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
JuliusBrussee/caveman#1189 ·
Maintainers usually reply within 1 day
-
agent-review-finding chore
Difficulty 2/5 Half a day Newbie friendliness 78/100
jordansmall/spindrift#4497 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug from-studio
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
esengine/DeepSeek-Reasonix#12044 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100