Skip to content

Commit e96000c

Browse files
authored
Merge pull request #1533 from ondrej-fabry/release/2.4.x
Release 2.4.0
2 parents f54b2db + 851b396 commit e96000c

File tree

4 files changed

+41
-26
lines changed

4 files changed

+41
-26
lines changed

Diff for: CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
## Release Notes
66

7+
- [v2.4.0](#v2.4.0)
78
- [v2.3.0](#v2.3.0)
8-
- [v2.3.1](#v2.3.1)
99
- [v2.2.0](#v2.2.0)
1010
- [v2.2.0-beta](#v2.2.0-beta)
1111
- [v2.1.0](#v2.1.0)
@@ -47,16 +47,16 @@ RELEASE CHANGELOG TEMPLATE:
4747
### Documentation
4848
-->
4949

50-
<a name="v2.3.1"></a>
51-
# [2.3.1](https://github.com/ligato/vpp-agent/compare/v2.3.0...v2.3.1) (2019-10-18)
50+
<a name="v2.4.0"></a>
51+
# [2.3.1](https://github.com/ligato/vpp-agent/compare/v2.3.0...v2.4.0) (2019-10-21)
5252
- **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`)
5353
- **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`)
5454
- **VPP 19.08.1** (default)
5555
- **VPP 19.04** (backward compatible)
5656
- cn-infra v2.2
5757

5858
### New Features
59-
This minor release introduces compatibility with two different commits of the VPP 20.01. Previously compatible version was updated to commit `324-g66a332cf1`, and support for `379-ga6b93eac5` was added. Other previous versions remained.
59+
This release introduces compatibility with two different commits of the VPP 20.01. Previously compatible version was updated to commit `324-g66a332cf1`, and support for `379-ga6b93eac5` was added. Other previous versions remained.
6060
* [Telemetry][vpp-telemetry]
6161
- Added `StatsPoller` service periodically retrieving VPP stats.
6262

Diff for: plugins/telemetry/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ type Config struct {
2929
PollingInterval time.Duration `json:"polling-interval"`
3030
// Allows to disable plugin
3131
Disabled bool `json:"disabled"`
32+
// Allows to export prometheus in telemetry plugin
33+
PrometheusDisabled bool `json:"prometheus-disabled"`
3234
// Skip collecting some of the metrics:
3335
// runtime, memory, buffers, nodes, interfaces
3436
Skipped []string `json:"skipped"`

Diff for: plugins/telemetry/telemetry.conf

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ polling-interval: 30000000000
44
# If set to true, telemetry plugin is disabled.
55
disabled: false
66

7+
# If set to true, prometheus in telemetry plugin is disabled.
8+
prometheus-disabled: false
9+
710
# Skip collecting some of the metrics.
811
# runtime, memory, buffers, nodes, interfaces
912
#skipped: [nodes]

Diff for: plugins/telemetry/telemetry.go

+32-22
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ type Plugin struct {
4949
prometheusMetrics
5050

5151
// From config file
52-
updatePeriod time.Duration
53-
disabled bool
54-
skipped map[string]bool
52+
updatePeriod time.Duration
53+
disabled bool
54+
prometheusDisabled bool
55+
skipped map[string]bool
5556

5657
wg sync.WaitGroup
5758
quit chan struct{}
@@ -83,29 +84,38 @@ func (p *Plugin) Init() error {
8384
p.disabled = true
8485
return nil
8586
}
86-
// This prevents setting the update period to less than 5 seconds,
87-
// which can have significant performance hit.
88-
if config.PollingInterval > minimumUpdatePeriod {
89-
p.updatePeriod = config.PollingInterval
90-
p.Log.Infof("polling period changed to %v", p.updatePeriod)
91-
} else if config.PollingInterval > 0 {
92-
p.Log.Warnf("polling period has to be at least %s, using default: %v",
93-
minimumUpdatePeriod, defaultUpdatePeriod)
87+
// Disable prometheus metrics if set by config
88+
if config.PrometheusDisabled {
89+
p.Log.Info("Prometheus metrics disabled via config file")
90+
p.prometheusDisabled = true
91+
} else {
92+
// This prevents setting the update period to less than 5 seconds,
93+
// which can have significant performance hit.
94+
if config.PollingInterval > minimumUpdatePeriod {
95+
p.updatePeriod = config.PollingInterval
96+
p.Log.Infof("polling period changed to %v", p.updatePeriod)
97+
} else if config.PollingInterval > 0 {
98+
p.Log.Warnf("polling period has to be at least %s, using default: %v",
99+
minimumUpdatePeriod, defaultUpdatePeriod)
100+
}
101+
// Store map of skipped metrics
102+
for _, skip := range config.Skipped {
103+
p.skipped[skip] = true
104+
}
94105
}
95-
// Store map of skipped metrics
96-
for _, skip := range config.Skipped {
97-
p.skipped[skip] = true
98-
}
99-
}
100-
// This serves as fallback if the config was not found or if the value is not set in config.
101-
if p.updatePeriod == 0 {
102-
p.updatePeriod = defaultUpdatePeriod
103106
}
104107

105-
if err := p.registerPrometheus(); err != nil {
106-
return err
108+
// Register prometheus
109+
if !p.prometheusDisabled {
110+
if p.updatePeriod == 0 {
111+
p.updatePeriod = defaultUpdatePeriod
112+
}
113+
if err := p.registerPrometheus(); err != nil {
114+
return err
115+
}
107116
}
108117

118+
// Setup stats poller
109119
p.statsPollerServer.log = p.Log.NewLogger("stats-poller")
110120
if err := p.setupStatsPoller(); err != nil {
111121
return err
@@ -117,7 +127,7 @@ func (p *Plugin) Init() error {
117127
// AfterInit executes after initializion of Telemetry Plugin
118128
func (p *Plugin) AfterInit() error {
119129
// Do not start polling if telemetry is disabled
120-
if p.disabled {
130+
if p.disabled || p.prometheusDisabled {
121131
return nil
122132
}
123133

0 commit comments

Comments
 (0)