Skip to content

Commit

Permalink
Merge pull request #1533 from ondrej-fabry/release/2.4.x
Browse files Browse the repository at this point in the history
Release 2.4.0
  • Loading branch information
VladoLavor authored Oct 22, 2019
2 parents f54b2db + 851b396 commit e96000c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 26 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

## Release Notes

- [v2.4.0](#v2.4.0)
- [v2.3.0](#v2.3.0)
- [v2.3.1](#v2.3.1)
- [v2.2.0](#v2.2.0)
- [v2.2.0-beta](#v2.2.0-beta)
- [v2.1.0](#v2.1.0)
Expand Down Expand Up @@ -47,16 +47,16 @@ RELEASE CHANGELOG TEMPLATE:
### Documentation
-->

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

### New Features
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.
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.
* [Telemetry][vpp-telemetry]
- Added `StatsPoller` service periodically retrieving VPP stats.

Expand Down
2 changes: 2 additions & 0 deletions plugins/telemetry/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type Config struct {
PollingInterval time.Duration `json:"polling-interval"`
// Allows to disable plugin
Disabled bool `json:"disabled"`
// Allows to export prometheus in telemetry plugin
PrometheusDisabled bool `json:"prometheus-disabled"`
// Skip collecting some of the metrics:
// runtime, memory, buffers, nodes, interfaces
Skipped []string `json:"skipped"`
Expand Down
3 changes: 3 additions & 0 deletions plugins/telemetry/telemetry.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ polling-interval: 30000000000
# If set to true, telemetry plugin is disabled.
disabled: false

# If set to true, prometheus in telemetry plugin is disabled.
prometheus-disabled: false

# Skip collecting some of the metrics.
# runtime, memory, buffers, nodes, interfaces
#skipped: [nodes]
54 changes: 32 additions & 22 deletions plugins/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ type Plugin struct {
prometheusMetrics

// From config file
updatePeriod time.Duration
disabled bool
skipped map[string]bool
updatePeriod time.Duration
disabled bool
prometheusDisabled bool
skipped map[string]bool

wg sync.WaitGroup
quit chan struct{}
Expand Down Expand Up @@ -83,29 +84,38 @@ func (p *Plugin) Init() error {
p.disabled = true
return nil
}
// This prevents setting the update period to less than 5 seconds,
// which can have significant performance hit.
if config.PollingInterval > minimumUpdatePeriod {
p.updatePeriod = config.PollingInterval
p.Log.Infof("polling period changed to %v", p.updatePeriod)
} else if config.PollingInterval > 0 {
p.Log.Warnf("polling period has to be at least %s, using default: %v",
minimumUpdatePeriod, defaultUpdatePeriod)
// Disable prometheus metrics if set by config
if config.PrometheusDisabled {
p.Log.Info("Prometheus metrics disabled via config file")
p.prometheusDisabled = true
} else {
// This prevents setting the update period to less than 5 seconds,
// which can have significant performance hit.
if config.PollingInterval > minimumUpdatePeriod {
p.updatePeriod = config.PollingInterval
p.Log.Infof("polling period changed to %v", p.updatePeriod)
} else if config.PollingInterval > 0 {
p.Log.Warnf("polling period has to be at least %s, using default: %v",
minimumUpdatePeriod, defaultUpdatePeriod)
}
// Store map of skipped metrics
for _, skip := range config.Skipped {
p.skipped[skip] = true
}
}
// Store map of skipped metrics
for _, skip := range config.Skipped {
p.skipped[skip] = true
}
}
// This serves as fallback if the config was not found or if the value is not set in config.
if p.updatePeriod == 0 {
p.updatePeriod = defaultUpdatePeriod
}

if err := p.registerPrometheus(); err != nil {
return err
// Register prometheus
if !p.prometheusDisabled {
if p.updatePeriod == 0 {
p.updatePeriod = defaultUpdatePeriod
}
if err := p.registerPrometheus(); err != nil {
return err
}
}

// Setup stats poller
p.statsPollerServer.log = p.Log.NewLogger("stats-poller")
if err := p.setupStatsPoller(); err != nil {
return err
Expand All @@ -117,7 +127,7 @@ func (p *Plugin) Init() error {
// AfterInit executes after initializion of Telemetry Plugin
func (p *Plugin) AfterInit() error {
// Do not start polling if telemetry is disabled
if p.disabled {
if p.disabled || p.prometheusDisabled {
return nil
}

Expand Down

0 comments on commit e96000c

Please sign in to comment.