Compare commits

...

5 Commits

Author SHA1 Message Date
Calle Pettersson
3a19fe4e7d Merge pull request #393 from breed808/net_gauge
Set current_bandwidth to gauge type
2019-08-28 22:18:47 +02:00
Calle Pettersson
26a468f17a Merge pull request #392 from breed808/doc
Additional collector documentation
2019-08-28 22:18:17 +02:00
Ben Reedy
2c155a12bd Set current_bandwidth to gauge type
Bandwidth estimate for an interface may decrease or increase
2019-08-28 21:12:14 +10:00
Ben Reedy
e1141c3ec0 Add documentation for tcp collector 2019-08-28 21:06:23 +10:00
Ben Reedy
b635ecc6c1 Add documentation for os collector 2019-08-28 20:57:34 +10:00
4 changed files with 52 additions and 26 deletions

View File

@@ -252,7 +252,7 @@ func (c *NetworkCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Des
) )
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
c.CurrentBandwidth, c.CurrentBandwidth,
prometheus.CounterValue, prometheus.GaugeValue,
float64(nic.CurrentBandwidth), float64(nic.CurrentBandwidth),
name, name,
) )

View File

@@ -33,7 +33,7 @@ Name | Description | Type | Labels
`wmi_net_packets_received_unknown` | Total packets received by interface that were discarded because of an unknown or unsupported protocol | counter | `nic` `wmi_net_packets_received_unknown` | Total packets received by interface that were discarded because of an unknown or unsupported protocol | counter | `nic`
`wmi_net_packets_total` | Total packets received and transmitted by interface | counter | `nic` `wmi_net_packets_total` | Total packets received and transmitted by interface | counter | `nic`
`wmi_net_packets_sent_total` | Total packets transmitted by interface | counter | `nic` `wmi_net_packets_sent_total` | Total packets transmitted by interface | counter | `nic`
`wmi_net_current_bandwidth` | Estimate of the interface's current bandwidth in bits per second (bps) | counter | `nic` `wmi_net_current_bandwidth` | Estimate of the interface's current bandwidth in bits per second (bps) | gauge | `nic`
### Example metric ### Example metric
Query the rate of transmitted network traffic Query the rate of transmitted network traffic

View File

@@ -16,24 +16,50 @@ None
Name | Description | Type | Labels Name | Description | Type | Labels
-----|-------------|------|------- -----|-------------|------|-------
`wmi_os_paging_limit_bytes` | _Not yet documented_ | gauge | None `wmi_os_paging_limit_bytes` | Total number of bytes that can be sotred in the operating system paging files. 0 (zero) indicates that there are no paging files | gauge | None
`wmi_os_paging_free_bytes` | _Not yet documented_ | gauge | None `wmi_os_paging_free_bytes` | Number of bytes that can be mapped into the operating system paging files without causing any other pages to be swapped out | gauge | None
`wmi_os_physical_memory_free_bytes` | _Not yet documented_ | gauge | None `wmi_os_physical_memory_free_bytes` | Bytes of physical memory currently unused and available | gauge | None
`wmi_os_time` | _Not yet documented_ | gauge | None `wmi_os_time` | Current time as reported by the operating system, in [Unix time](https://en.wikipedia.org/wiki/Unix_time). See [time.Unix()](https://golang.org/pkg/time/#Unix) for details | gauge | None
`wmi_os_timezone` | _Not yet documented_ | gauge | `timezone` `wmi_os_timezone` | Current timezone as reported by the operating system. See [time.Zone()](https://golang.org/pkg/time/#Time.Zone) for details | gauge | `timezone`
`wmi_os_processes` | _Not yet documented_ | gauge | None `wmi_os_processes` | Number of process contexts currently loaded or running on the operating system | gauge | None
`wmi_os_processes_limit` | _Not yet documented_ | gauge | None `wmi_os_processes_limit` | Maximum number of process contexts the operating system can support. The default value set by the provider is 4294967295 (0xFFFFFFFF) | gauge | None
`wmi_os_process_memory_limix_bytes` | _Not yet documented_ | gauge | None `wmi_os_process_memory_limit_bytes` | Maximum number of bytes of memory that can be allocated to a process | gauge | None
`wmi_os_users` | _Not yet documented_ | gauge | None `wmi_os_users` | Number of user sessions for which the operating system is storing state information currently. For a list of current active logon sessions, see [`logon`](collector.logon.md) | gauge | None
`wmi_os_virtual_memory_bytes` | _Not yet documented_ | gauge | None `wmi_os_virtual_memory_bytes` | Bytes of virtual memory | gauge | None
`wmi_os_visible_memory_bytes` | _Not yet documented_ | gauge | None `wmi_os_visible_memory_bytes` | Total bytes of physical memory available to the operating system. This value does not necessarily indicate the true amount of physical memory, but what is reported to the operating system as available to it | gauge | None
`wmi_os_virtual_memory_free_bytes` | _Not yet documented_ | gauge | None `wmi_os_virtual_memory_free_bytes` | Bytes of virtual memory currently unused and available | gauge | None
### Example metric ### Example metric
_This collector does not yet have explained examples, we would appreciate your help adding them!_ Show current number of processes
```
wmi_os_processes{instance="localhost"}
```
## Useful queries ## Useful queries
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_ Find all devices not set to UTC timezone
```
wmi_os_timezone{timezone != "UTC"}
```
## Alerting examples ## Alerting examples
_This collector does not yet have alerting examples, we would appreciate your help adding them!_ **prometheus.rules**
```
# Alert on hosts that have exhausted all available physical memory
- alert: MemoryExhausted
expr: wmi_os_physical_memory_free_bytes == 0
for: 10m
labels:
severity: high
annotations:
summary: "Host {{ $labels.instance }} is out of memory"
description: "{{ $labels.instance }} has exhausted all available physical memory"
# Alert on hosts with greater than 90% memory usage
- alert: MemoryLow
expr: 100 - 100 * wmi_os_physical_memory_free_bytes / wmi_cs_physical_memory_bytes > 90
for: 10m
labels:
severity: warning
annotations:
summary: "Memory usage for host {{ $labels.instance }} is greater than 90%"
```

View File

@@ -16,15 +16,15 @@ None
Name | Description | Type | Labels Name | Description | Type | Labels
-----|-------------|------|------- -----|-------------|------|-------
`wmi_tcp_connection_failures` | _Not yet documented_ | counter | None `wmi_tcp_connection_failures` | Number of times TCP connections have made a direct transition to the CLOSED state from the SYN-SENT state or the SYN-RCVD state, plus the number of times TCP connections have made a direct transition from the SYN-RCVD state to the LISTEN state | counter | None
`wmi_tcp_connections_active` | _Not yet documented_ | counter | None `wmi_tcp_connections_active` | Number of times TCP connections have made a direct transition from the CLOSED state to the SYN-SENT state.| counter | None
`wmi_tcp_connections_established` | _Not yet documented_ | counter | None `wmi_tcp_connections_established` | Number of TCP connections for which the current state is either ESTABLISHED or CLOSE-WAIT. | counter | None
`wmi_tcp_connections_passive` | _Not yet documented_ | counter | None `wmi_tcp_connections_passive` | Number of times TCP connections have made a direct transition from the LISTEN state to the SYN-RCVD state. | counter | None
`wmi_tcp_connections_reset` | _Not yet documented_ | counter | None `wmi_tcp_connections_reset` | Number of times TCP connections have made a direct transition from the LISTEN state to the SYN-RCVD state. | counter | None
`wmi_tcp_segments_total` | _Not yet documented_ | counter | None `wmi_tcp_segments_total` | Total segments sent or received using the TCP protocol | counter | None
`wmi_tcp_segments_received_total` | _Not yet documented_ | counter | None `wmi_tcp_segments_received_total` | Total segments received, including those received in error. This count includes segments received on currently established connections | counter | None
`wmi_tcp_segments_retransmitted_total` | _Not yet documented_ | counter | None `wmi_tcp_segments_retransmitted_total` | Total segments retransmitted. That is, segments transmitted that contain one or more previously transmitted bytes | counter | None
`wmi_tcp_segments_sent_total` | _Not yet documented_ | counter | None `wmi_tcp_segments_sent_total` | Total segments sent, including those on current connections, but excluding those containing *only* retransmitted bytes | counter | None
### Example metric ### Example metric
_This collector does not yet have explained examples, we would appreciate your help adding them!_ _This collector does not yet have explained examples, we would appreciate your help adding them!_