Rename and fix metric names and types #182
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here are a few changes that should bring this exporter closer to Prometheus best practices.
phpfpm_scrape_failuresis a counter and should end with _total. It has been renamed tophpfpm_scrape_failures_total(https://prometheus.io/docs/instrumenting/writing_exporters/#naming)phpfpm_start_sincehas been renamed tophpfpm_start_time_secondsto match standardprocess_start_time_secondsand contain unit. It has been changed to a gauge (https://www.robustperception.io/are-increasing-timestamps-counters-or-gauges).phpfpm_accepted_connectionsis a counter and should end with _total. It has been renamed tophpfpm_accepted_connections_total.phpfpm_idle_processes,phpfpm_active_processeshave been changed tophpfpm_processes{state="active"}andphpfpm_processes{state="idle"}.phpfpm_total_processeshas been dropped because it can be found assum without(state) phpfpm_processes.phpfpm_max_children_reachedis a counter and should end with _total, so it has been renamed tophpfpm_max_children_reached_total.process_last_request_memoryshould contain the unit, so it has been renamed toprocess_last_request_memory_bytes.process_request_durationhas been normalized to seconds and renamedphpfpm_process_last_request_duration_seconds.