Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add socket_summary to default system metricsets #9709

Merged
merged 5 commits into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
*Metricbeat*

- Add `key` metricset to the Redis module. {issue}9582[9582] {pull}9657[9657] {pull}9746[9746]
- Add `socket_summary` metricset to system defaults, removing experimental tag and supporting Windows {pull}9709[9709]

*Packetbeat*

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 @@ -135,7 +135,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>> beta[]
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
2 changes: 1 addition & 1 deletion metricbeat/tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def test_process_metricbeat(self):
assert isinstance(output["system.process.cpu.start_time"], six.string_types)
self.check_username(output["system.process.username"])

@unittest.skipUnless(re.match("(?i)linux|darwin|freebsd", sys.platform), "os")
@unittest.skipUnless(re.match("(?i)win|linux|darwin|freebsd", sys.platform), "os")
def test_socket_summary(self):
"""
Test system/socket_summary output.
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