Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Add metrics metadata #3

Closed
remh opened this issue Aug 10, 2015 · 5 comments
Closed

Add metrics metadata #3

remh opened this issue Aug 10, 2015 · 5 comments

Comments

@remh
Copy link
Contributor

remh commented Aug 10, 2015

The template should include a CSV file that list the metrics, their type, their meaning with the following format:

metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name
postgresql.connections,gauge,,connection,,The number of active connections to this database.,0,postgres,pg conns
postgresql.commits,gauge,,transaction,second,The number of transactions that have been committed in this database.,0,postgres,pg commits
postgresql.rollbacks,gauge,,transaction,second,The number of transactions that have been rolled back in this database.,-1,postgres,pg rollbacks
postgresql.disk_read,gauge,,block,second,The number of disk blocks read in this database.,0,postgres,pg disk read
postgresql.buffer_hit,gauge,,hit,second,"The number of times disk blocks were found in the buffer cache, preventing the need to read from the database. ",1,postgres,pg buff hit
postgresql.rows_returned,gauge,,row,second,The number of rows returned by queries in this database,0,postgres,pg rows ret
postgresql.rows_fetched,gauge,,row,second,The number of rows fetched by queries in this database,0,postgres,pg rows fetch
postgresql.rows_inserted,gauge,,row,second,The number of rows inserted by queries in this database,0,postgres,pg rows insrt
postgresql.rows_updated,gauge,,row,second,The number of rows updated by queries in this database,0,postgres,pg rows updt
postgresql.rows_deleted,gauge,,row,second,The number of rows deleted by queries in this database,0,postgres,pg rows del
postgresql.database_size,gauge,,byte,,The disk space used by this database.,0,postgres,pg db size
postgresql.deadlocks,gauge,,,,The number of deadlocks detected in this database,-1,postgres,pg deadlocks
postgresql.temp_bytes,gauge,,byte,second,The amount of data written to temporary files by queries in this database.,0,postgres,pg temp bytes
postgresql.temp_files,gauge,,file,second,The number of temporary files created by queries in this database.,0,postgres,pg temp files
postgresql.bgwriter.checkpoints_timed,count,,,,The number of scheduled checkpoints that were performed.,0,postgres,pg bgw cp timed
postgresql.bgwriter.checkpoints_requested,count,,,,The number of requested checkpoints that were performed.,0,postgres,pg bgw cp req
postgresql.bgwriter.buffers_checkpoint,count,,,,The number of buffers written during checkpoints.,0,postgres,pg bgw buff cp
postgresql.bgwriter.buffers_clean,count,,,,The number of buffers written by the background writer.,0,postgres,pg bgw buff clean
postgresql.bgwriter.maxwritten_clean,count,,,,The number of times the background writer stopped a cleaning scan due to writing too many buffers.,0,postgres,pg bgw maxwr clean
postgresql.bgwriter.buffers_backend,count,,buffer,,The number of buffers written directly by a backend.,0,postgres,pg bgw buff bkend
postgresql.bgwriter.buffers_alloc,count,,,,The number of buffers allocated,0,postgres,pg bgw buff alloc
postgresql.bgwriter.buffers_backend_fsync,count,,,,The of times a backend had to execute its own fsync call instead of the background writer.,0,postgres,pg bgw buff bkend fsync
postgresql.bgwriter.write_time,count,,millisecond,,The total amount of checkpoint processing time spent writing files to disk.,0,postgres,pg bgw wrt time
postgresql.bgwriter.sync_time,count,,millisecond,,The total amount of checkpoint processing time spent synchronizing files to disk.,0,postgres,pg bgw sync time
postgresql.locks,gauge,,lock,,The number of locks active for this database.,0,postgres,pg locks
postgresql.seq_scans,gauge,,,,The number of sequential scans initiated on this table.,0,postgres,pg seq scans
postgresql.seq_rows_read,gauge,,row,second,The number of live rows fetched by sequential scans.,0,postgres,pg seq rows rd
postgresql.index_scans,gauge,,,,The number of index scans initiated on this table.,0,postgres,pg idx scans
postgresql.index_rows_fetched,gauge,,row,second,The number of live rows fetched by index scans.,0,postgres,pg idx rows fetch
postgresql.rows_hot_updated,gauge,,row,second,"The number of rows HOT updated, meaning no separate index update was needed.",0,postgres,pg rows hot updated
postgresql.live_rows,gauge,,row,,The estimated number of live rows.,0,postgres,pg live rows
postgresql.dead_rows,gauge,,row,,The estimated number of dead rows.,0,postgres,pg dead rows
postgresql.index_rows_read,gauge,,row,second,The number of index entries returned by scans on this index.,0,postgres,pg idx rows read
postgresql.table_size,gauge,,byte,,"The total disk space used by the specified table. Includes TOAST, free space map, and visibility map. Excludes indexes.",0,postgres,pg tbl size
postgresql.index_size,gauge,,byte,,The total disk space used by indexes attached to the specified table.,0,postgres,pg idx size
postgresql.total_size,gauge,,byte,,"The total disk space used by the table, including indexes and TOAST data.",0,postgres,pg tot size
postgresql.table.count,gauge,,table,,The number of user tables in this database.,0,postgres,pg tbl count
postgresql.max_connections,gauge,,connection,, The maximum number of client connections allowed to this database.,0,postgres,pg max conns
postgresql.percent_usage_connections,gauge,,fraction,,The number of connections to this database as a fraction of the maximum number of allowed connections.,0,postgres,pg pct usg conns
postgresql.heap_blocks_read,gauge,,block,second,The number of disk blocks read from this table.,0,postgres,pg heap blks read
postgresql.heap_blocks_hit,gauge,,hit,second,The number of buffer hits in this table.,0,postgres,pg heap blks hit
postgresql.index_blocks_read,gauge,,block,second,The number of disk blocks read from all indexes on this table.,0,postgres,pg idx blks read
postgresql.index_blocks_hit,gauge,,hit,second,The number of buffer hits in all indexes on this table.,0,postgres,pg idx blks hit
postgresql.toast_blocks_read,gauge,,block,second,The number of disk blocks read from this table's TOAST table.,0,postgres,pg toast blks read
postgresql.toast_blocks_hit,gauge,,hit,second,The number of buffer hits in this table's TOAST table.,0,postgres,pg toast blks hit
postgresql.toast_index_blocks_read,gauge,,block,second,The number of disk blocks read from this table's TOAST table index.,0,postgres,pg toast idx blks read
postgresql.toast_index_blocks_hit,gauge,,block,second,The number of buffer hits in this table's TOAST table index.,0,postgres,pg toast idx blks hit

We will use that in the web app to to provide more information about the metrics.

@2bethere
Copy link
Contributor

@remh What does the column orientation mean? Do you have an example for unit_name and per_unit_name?

@remh
Copy link
Contributor Author

remh commented Aug 11, 2015

orientation answers the questions: what's the better state for this metric ?

e.g.
system.cpu.user: the lower it is, the better it is. Its orientation should be 0

on the contrary
system.cpu.idle: the higher it is, the better it is. Its orientation should be 1 ( i think, @domoench do you confirm ?)

For unit_name and per_unit_name: here are some examples:

postgresql.max_connnections => unit_name: connections, per_unit_name: None
system.net.bytes_rcvd => unit_name: bytes, per_unit_name: second (so it will be displayed as bytes per second on the dashboards)

Does that make sense ?

@domoench can you confirm my explanation ?

@2bethere
Copy link
Contributor

That's great. I'll update shortly.

@2bethere
Copy link
Contributor

Closed by 8cd6e92

@domoench
Copy link

@remh @2bethere You've got the meaning of orientation correct, but it can actually have one of 3 integer values: -1, 0, or 1.

-1 means smaller is better. For example smaller system.cpu.user values are generally better.
1 means larger is better. Larger system.cpu.idle values are generally better.
0 means there is no clear better or worse. Such as system.net.bytes_sent

The eventual use case for this orientation info is mapping metric values to color gradients (better to worse values => green to red), change graphs, etc.

Documentation of the metric metadata attributes are currently HERE.
Let me know if anything else is unclear. Thanks!

@2bethere 2bethere reopened this Aug 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants