prometheus-community / prometheus-community/postgres_exporter
The feature `Adding new metrics` exists in README but not implemented
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 835
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 10
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.
Contributor guide
No contributing guide indexed for this repository
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.
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.
Assessment
- Tech stack
- go, postgres, python
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100