mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
removed backwards-compatible/untagged metrics deprecated in 0.7
This commit is contained in:
@@ -387,9 +387,7 @@ func convertServerConfig(agentConfig *Config) (*nomad.Config, error) {
|
||||
|
||||
// Setup telemetry related config
|
||||
conf.StatsCollectionInterval = agentConfig.Telemetry.collectionInterval
|
||||
conf.DisableTaggedMetrics = agentConfig.Telemetry.DisableTaggedMetrics
|
||||
conf.DisableDispatchedJobSummaryMetrics = agentConfig.Telemetry.DisableDispatchedJobSummaryMetrics
|
||||
conf.BackwardsCompatibleMetrics = agentConfig.Telemetry.BackwardsCompatibleMetrics
|
||||
|
||||
// Parse Limits timeout from a string into durations
|
||||
if d, err := time.ParseDuration(agentConfig.Limits.RPCHandshakeTimeout); err != nil {
|
||||
@@ -616,8 +614,6 @@ func convertClientConfig(agentConfig *Config) (*clientconfig.Config, error) {
|
||||
conf.StatsCollectionInterval = agentConfig.Telemetry.collectionInterval
|
||||
conf.PublishNodeMetrics = agentConfig.Telemetry.PublishNodeMetrics
|
||||
conf.PublishAllocationMetrics = agentConfig.Telemetry.PublishAllocationMetrics
|
||||
conf.DisableTaggedMetrics = agentConfig.Telemetry.DisableTaggedMetrics
|
||||
conf.BackwardsCompatibleMetrics = agentConfig.Telemetry.BackwardsCompatibleMetrics
|
||||
|
||||
// Set the TLS related configs
|
||||
conf.TLSConfig = agentConfig.TLSConfig
|
||||
|
||||
@@ -521,8 +521,6 @@ func TestAgent_Client_TelemetryConfiguration(t *testing.T) {
|
||||
|
||||
conf := DefaultConfig()
|
||||
conf.DevMode = true
|
||||
conf.Telemetry.DisableTaggedMetrics = true
|
||||
conf.Telemetry.BackwardsCompatibleMetrics = true
|
||||
|
||||
a := &Agent{config: conf}
|
||||
|
||||
@@ -534,8 +532,6 @@ func TestAgent_Client_TelemetryConfiguration(t *testing.T) {
|
||||
assert.Equal(c.StatsCollectionInterval, telemetry.collectionInterval)
|
||||
assert.Equal(c.PublishNodeMetrics, telemetry.PublishNodeMetrics)
|
||||
assert.Equal(c.PublishAllocationMetrics, telemetry.PublishAllocationMetrics)
|
||||
assert.Equal(c.DisableTaggedMetrics, telemetry.DisableTaggedMetrics)
|
||||
assert.Equal(c.BackwardsCompatibleMetrics, telemetry.BackwardsCompatibleMetrics)
|
||||
}
|
||||
|
||||
// TestAgent_HTTPCheck asserts Agent.agentHTTPCheck properly alters the HTTP
|
||||
|
||||
@@ -980,8 +980,7 @@ func (c *Command) setupTelemetry(config *Config) (*metrics.InmemSink, error) {
|
||||
metricsConf.EnableHostname = !telConfig.DisableHostname
|
||||
|
||||
// Prefer the hostname as a label.
|
||||
metricsConf.EnableHostnameLabel = !telConfig.DisableHostname &&
|
||||
!telConfig.DisableTaggedMetrics && !telConfig.BackwardsCompatibleMetrics
|
||||
metricsConf.EnableHostnameLabel = !telConfig.DisableHostname
|
||||
|
||||
if telConfig.UseNodeName {
|
||||
metricsConf.HostName = config.NodeName
|
||||
|
||||
@@ -561,14 +561,6 @@ type Telemetry struct {
|
||||
PublishAllocationMetrics bool `hcl:"publish_allocation_metrics"`
|
||||
PublishNodeMetrics bool `hcl:"publish_node_metrics"`
|
||||
|
||||
// DisableTaggedMetrics disables a new version of generating metrics which
|
||||
// uses tags
|
||||
DisableTaggedMetrics bool `hcl:"disable_tagged_metrics"`
|
||||
|
||||
// BackwardsCompatibleMetrics allows for generating metrics in a simple
|
||||
// key/value structure as done in older versions of Nomad
|
||||
BackwardsCompatibleMetrics bool `hcl:"backwards_compatible_metrics"`
|
||||
|
||||
// PrefixFilter allows for filtering out metrics from being collected
|
||||
PrefixFilter []string `hcl:"prefix_filter"`
|
||||
|
||||
@@ -1642,14 +1634,6 @@ func (a *Telemetry) Merge(b *Telemetry) *Telemetry {
|
||||
result.CirconusBrokerSelectTag = b.CirconusBrokerSelectTag
|
||||
}
|
||||
|
||||
if b.DisableTaggedMetrics {
|
||||
result.DisableTaggedMetrics = b.DisableTaggedMetrics
|
||||
}
|
||||
|
||||
if b.BackwardsCompatibleMetrics {
|
||||
result.BackwardsCompatibleMetrics = b.BackwardsCompatibleMetrics
|
||||
}
|
||||
|
||||
if b.PrefixFilter != nil {
|
||||
result.PrefixFilter = b.PrefixFilter
|
||||
}
|
||||
|
||||
@@ -180,8 +180,6 @@ var basicConfig = &Config{
|
||||
collectionInterval: 3 * time.Second,
|
||||
PublishAllocationMetrics: true,
|
||||
PublishNodeMetrics: true,
|
||||
DisableTaggedMetrics: true,
|
||||
BackwardsCompatibleMetrics: true,
|
||||
},
|
||||
LeaveOnInt: true,
|
||||
LeaveOnTerm: true,
|
||||
|
||||
@@ -67,8 +67,6 @@ func TestConfig_Merge(t *testing.T) {
|
||||
DataDogTags: []string{"cat1:tag1", "cat2:tag2"},
|
||||
PrometheusMetrics: true,
|
||||
DisableHostname: false,
|
||||
DisableTaggedMetrics: true,
|
||||
BackwardsCompatibleMetrics: true,
|
||||
CirconusAPIToken: "0",
|
||||
CirconusAPIApp: "nomadic",
|
||||
CirconusAPIURL: "http://api.circonus.com/v2",
|
||||
@@ -256,8 +254,6 @@ func TestConfig_Merge(t *testing.T) {
|
||||
DisableHostname: true,
|
||||
PublishNodeMetrics: true,
|
||||
PublishAllocationMetrics: true,
|
||||
DisableTaggedMetrics: true,
|
||||
BackwardsCompatibleMetrics: true,
|
||||
CirconusAPIToken: "1",
|
||||
CirconusAPIApp: "nomad",
|
||||
CirconusAPIURL: "https://api.circonus.com/v2",
|
||||
|
||||
@@ -73,8 +73,6 @@ func TestHTTP_FreshClientAllocMetrics(t *testing.T) {
|
||||
httpTest(t, func(c *Config) {
|
||||
c.Telemetry.PublishAllocationMetrics = true
|
||||
c.Telemetry.PublishNodeMetrics = true
|
||||
c.Telemetry.BackwardsCompatibleMetrics = false
|
||||
c.Telemetry.DisableTaggedMetrics = false
|
||||
}, func(s *TestAgent) {
|
||||
// Create the job, wait for it to finish
|
||||
job := mock.BatchJob()
|
||||
|
||||
16
command/agent/testdata/basic.hcl
vendored
16
command/agent/testdata/basic.hcl
vendored
@@ -177,15 +177,13 @@ audit {
|
||||
}
|
||||
|
||||
telemetry {
|
||||
statsite_address = "127.0.0.1:1234"
|
||||
statsd_address = "127.0.0.1:2345"
|
||||
prometheus_metrics = true
|
||||
disable_hostname = true
|
||||
collection_interval = "3s"
|
||||
publish_allocation_metrics = true
|
||||
publish_node_metrics = true
|
||||
disable_tagged_metrics = true
|
||||
backwards_compatible_metrics = true
|
||||
statsite_address = "127.0.0.1:1234"
|
||||
statsd_address = "127.0.0.1:2345"
|
||||
prometheus_metrics = true
|
||||
disable_hostname = true
|
||||
collection_interval = "3s"
|
||||
publish_allocation_metrics = true
|
||||
publish_node_metrics = true
|
||||
}
|
||||
|
||||
leave_on_interrupt = true
|
||||
|
||||
2
command/agent/testdata/basic.json
vendored
2
command/agent/testdata/basic.json
vendored
@@ -313,10 +313,8 @@
|
||||
"syslog_facility": "LOCAL1",
|
||||
"telemetry": [
|
||||
{
|
||||
"backwards_compatible_metrics": true,
|
||||
"collection_interval": "3s",
|
||||
"disable_hostname": true,
|
||||
"disable_tagged_metrics": true,
|
||||
"prometheus_metrics": true,
|
||||
"publish_allocation_metrics": true,
|
||||
"publish_node_metrics": true,
|
||||
|
||||
Reference in New Issue
Block a user