Skip to content

Commit 17d7827

Browse files
committed
issue #3497 : Removed deprecated enabled flag from InMem telemetry config
1 parent 08335f0 commit 17d7827

File tree

5 files changed

+1
-39
lines changed

5 files changed

+1
-39
lines changed

conf/server/server_full.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,6 @@ plugins {
831831
# ]
832832

833833
# InMem {
834-
# # enabled: Enable this collector. This field is deprecated and will be removed in a future release. Default: false.
835-
# # enabled = true
836834
# }
837835
# }
838836

doc/telemetry_config.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ You may use all, some, or none of the collectors. The following collectors suppo
5454
| `address` | `string` | M3 address |
5555
| `env` | `string` | M3 environment, e.g. `production`, `staging` |
5656

57-
### `In-Mem`
58-
59-
| Configuration | Type | Description | Default |
60-
|---------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
61-
| `enabled` | `bool` | Enable this collector. This flag is deprecated and will be removed in a future release. To disable in-memory telemetry collection omit the InMem configuration block entirely. | `false` |
6257

6358
Here is a sample configuration:
6459

pkg/common/telemetry/config.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,5 @@ type M3Config struct {
4949
}
5050

5151
type InMem struct {
52-
// TODO: remove in SPIRE 1.6.0
53-
DeprecatedEnabled *bool `hcl:"enabled"`
54-
UnusedKeys []string `hcl:",unusedKeys"`
52+
UnusedKeys []string `hcl:",unusedKeys"`
5553
}

pkg/common/telemetry/inmem.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ func newInmemRunner(c *MetricsConfig) (sinkRunner, error) {
3232
switch {
3333
case inMem == nil:
3434
return runner, nil
35-
case inMem.DeprecatedEnabled != nil:
36-
c.Logger.Warn("The enabled flag is deprecated in the InMem configuration and will be removed in a future release; omit the InMem block to disable in-memory telemetry")
37-
if !*inMem.DeprecatedEnabled {
38-
return runner, nil
39-
}
4035
}
4136

4237
if logger, ok := c.Logger.(interface{ Writer() *io.PipeWriter }); ok {

pkg/common/telemetry/inmem_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
)
1212

1313
func TestInMem(t *testing.T) {
14-
enabled := true
15-
disabled := false
1614

1715
for _, tt := range []struct {
1816
test string
@@ -32,28 +30,6 @@ func TestInMem(t *testing.T) {
3230
inMemConfig: &InMem{},
3331
expectEnabled: true,
3432
},
35-
{
36-
test: "enabled when InMem block declared and deprecated enabled flag set to true",
37-
inMemConfig: &InMem{DeprecatedEnabled: &enabled},
38-
expectEnabled: true,
39-
expectLogs: []spiretest.LogEntry{
40-
{
41-
Level: logrus.WarnLevel,
42-
Message: "The enabled flag is deprecated in the InMem configuration and will be removed in a future release; omit the InMem block to disable in-memory telemetry",
43-
},
44-
},
45-
},
46-
{
47-
test: "disabled when InMem block declared and deprecated enabled flag set to false",
48-
inMemConfig: &InMem{DeprecatedEnabled: &disabled},
49-
expectEnabled: false,
50-
expectLogs: []spiretest.LogEntry{
51-
{
52-
Level: logrus.WarnLevel,
53-
Message: "The enabled flag is deprecated in the InMem configuration and will be removed in a future release; omit the InMem block to disable in-memory telemetry",
54-
},
55-
},
56-
},
5733
{
5834
test: "disabled when unexpected logger passed",
5935
inMemConfig: &InMem{},

0 commit comments

Comments
 (0)