Skip to content

Commit

Permalink
Add socket_summary to default system metricsets
Browse files Browse the repository at this point in the history
Add support for Windows now that it is supported by gopsutil and remove
the experimental tag. Enable it by default.
  • Loading branch information
jsoriano committed Dec 20, 2018
1 parent e79f64a commit 97ba003
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha1...master[Check the HEAD d
- Add support for multi-core thread_id in postgresql module {issue}9156[9156] {pull}9482[9482]
- Added module for parsing Google Santa logs. {pull}9540[9540]
- Added netflow input type that supports NetFlow v1, v5, v6, v7, v8, v9 and IPFIX. {issue}9399[9399]
- Add `socket_summary` metricset to system defaults, removing experimental tag and supporting Windows {pull}[]

*Heartbeat*

Expand Down
1 change: 1 addition & 0 deletions metricbeat/docs/modules/system.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ metricbeat.modules:
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
- socket_summary # Socket summary
#- core # Per CPU core usage
#- diskio # Disk IO
#- filesystem # File system usage for each mountpoint
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/docs/modules/system/socket_summary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ This file is generated! See scripts/docs_collector.py
[[metricbeat-metricset-system-socket_summary]]
=== System socket_summary metricset

experimental[]

include::../../../module/system/socket_summary/_meta/docs.asciidoc[]


Expand Down
2 changes: 1 addition & 1 deletion metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ This file is generated! See scripts/docs_collector.py
|<<metricbeat-metricset-system-process_summary,process_summary>>
|<<metricbeat-metricset-system-raid,raid>>
|<<metricbeat-metricset-system-socket,socket>>
|<<metricbeat-metricset-system-socket_summary,socket_summary>> experimental[]
|<<metricbeat-metricset-system-socket_summary,socket_summary>>
|<<metricbeat-metricset-system-uptime,uptime>>
|<<metricbeat-module-traefik,traefik>> beta[] |image:./images/icon-no.png[No prebuilt dashboards] |
.1+| .1+| |<<metricbeat-metricset-traefik-health,health>> experimental[]
Expand Down
1 change: 1 addition & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ metricbeat.modules:
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
- socket_summary # Socket summary
#- core # Per CPU core usage
#- diskio # Disk IO
#- filesystem # File system usage for each mountpoint
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/system/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
- socket_summary # Socket summary
#- core # Per CPU core usage
#- diskio # Disk IO
#- filesystem # File system usage for each mountpoint
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/system/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- network
- process
- process_summary
- socket_summary
#- core
#- diskio
#- socket
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/system/fields.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This metricset is available on:
- FreeBSD
- Linux
- macOS
- Windows
[float]
=== Configuration
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/system/socket_summary/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
type: group
description: >
Summary metrics of open sockets in the host system
release: ga
fields:
- name: all
type: group
Expand Down
13 changes: 2 additions & 11 deletions metricbeat/module/system/socket_summary/socket_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@
package socket_summary

import (
"runtime"
"syscall"

"github.com/pkg/errors"
"github.com/shirou/gopsutil/net"

"github.com/elastic/beats/libbeat/common"

"github.com/elastic/beats/libbeat/common/cfgwarn"
"github.com/elastic/beats/metricbeat/mb"

"github.com/shirou/gopsutil/net"
)

// init registers the MetricSet with the central registry as soon as the program
Expand All @@ -38,6 +33,7 @@ import (
func init() {
mb.Registry.MustAddMetricSet("system", "socket_summary", New,
mb.WithNamespace("system.socket.summary"),
mb.DefaultMetricSet(),
)
}

Expand All @@ -52,11 +48,6 @@ type MetricSet struct {
// New creates a new instance of the MetricSet. New is responsible for unpacking
// any MetricSet specific configuration options if there are any.
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
cfgwarn.Experimental("The socket_summary metricset is experimental.")
if runtime.GOOS == "windows" {
return nil, errors.New("socket_summary metricset is not supported in Windows")
}

return &MetricSet{
BaseMetricSet: base,
}, nil
Expand Down
1 change: 1 addition & 0 deletions metricbeat/modules.d/system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- network
- process
- process_summary
- socket_summary
#- core
#- diskio
#- socket
Expand Down
1 change: 1 addition & 0 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ metricbeat.modules:
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
- socket_summary # Socket summary
#- core # Per CPU core usage
#- diskio # Disk IO
#- filesystem # File system usage for each mountpoint
Expand Down

0 comments on commit 97ba003

Please sign in to comment.