Skip to content

Commit

Permalink
Revert "Enable OTel metrics by default (#2859)" (#2882)
Browse files Browse the repository at this point in the history
This reverts commit 94c5ebd.
  • Loading branch information
kislaykishore authored Jan 8, 2025
1 parent 8f785d9 commit 44d436d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func BuildFlagSet(flagSet *pflag.FlagSet) error {

flagSet.BoolP("enable-nonexistent-type-cache", "", false, "Once set, if an inode is not found in GCS, a type cache entry with type NonexistentType will be created. This also means new file/dir created might not be seen. For example, if this flag is set, and metadata-cache-ttl-secs is set, then if we create the same file/node in the meantime using the same mount, since we are not refreshing the cache, it will still return nil.")

flagSet.BoolP("enable-otel", "", true, "Specifies whether to use OpenTelemetry for capturing and exporting metrics. If false, use OpenCensus.")
flagSet.BoolP("enable-otel", "", false, "Specifies whether to use OpenTelemetry for capturing and exporting metrics. If false, use OpenCensus.")

if err := flagSet.MarkHidden("enable-otel"); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cfg/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@
flag-name: "enable-otel"
type: "bool"
usage: "Specifies whether to use OpenTelemetry for capturing and exporting metrics. If false, use OpenCensus."
default: true
default: false
hide-flag: true

- config-path: "metrics.prometheus-port"
Expand Down
2 changes: 0 additions & 2 deletions cmd/config_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,15 +805,13 @@ func TestValidateConfigFile_MetricsConfigSuccessful(t *testing.T) {
StackdriverExportInterval: 0,
CloudMetricsExportIntervalSecs: 0,
PrometheusPort: 0,
EnableOtel: true,
},
},
{
name: "valid_config_file",
configFile: "testdata/valid_config.yaml",
expectedConfig: &cfg.MetricsConfig{
CloudMetricsExportIntervalSecs: 10,
EnableOtel: true,
},
},
}
Expand Down
35 changes: 12 additions & 23 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ func TestArgsParsing_MetricsFlags(t *testing.T) {
name: "default",
args: []string{"gcsfuse", "abc", "pqr"},
expected: &cfg.MetricsConfig{
EnableOtel: true,
EnableOtel: false,
},
},
{
Expand All @@ -907,21 +907,14 @@ func TestArgsParsing_MetricsFlags(t *testing.T) {
},
},
{
name: "cloud-metrics-export-interval-secs-positive",
args: []string{"gcsfuse", "--cloud-metrics-export-interval-secs=10", "abc", "pqr"},
expected: &cfg.MetricsConfig{
CloudMetricsExportIntervalSecs: 10,
EnableOtel: true,
},
name: "cloud-metrics-export-interval-secs-positive",
args: []string{"gcsfuse", "--cloud-metrics-export-interval-secs=10", "abc", "pqr"},
expected: &cfg.MetricsConfig{CloudMetricsExportIntervalSecs: 10},
},
{
name: "stackdriver-export-interval-positive",
args: []string{"gcsfuse", "--stackdriver-export-interval=10h", "abc", "pqr"},
expected: &cfg.MetricsConfig{
CloudMetricsExportIntervalSecs: 10 * 3600,
StackdriverExportInterval: time.Duration(10) * time.Hour,
EnableOtel: true,
},
name: "stackdriver-export-interval-positive",
args: []string{"gcsfuse", "--stackdriver-export-interval=10h", "abc", "pqr"},
expected: &cfg.MetricsConfig{CloudMetricsExportIntervalSecs: 10 * 3600, StackdriverExportInterval: time.Duration(10) * time.Hour},
},
}
for _, tc := range tests {
Expand Down Expand Up @@ -953,7 +946,7 @@ func TestArgsParsing_MetricsViewConfig(t *testing.T) {
name: "default",
cfgFile: "empty.yml",
expected: &cfg.MetricsConfig{
EnableOtel: true,
EnableOtel: false,
},
},
{
Expand All @@ -973,16 +966,12 @@ func TestArgsParsing_MetricsViewConfig(t *testing.T) {
{
name: "cloud-metrics-export-interval-secs-positive",
cfgFile: "metrics_export_interval_positive.yml",
expected: &cfg.MetricsConfig{CloudMetricsExportIntervalSecs: 100, EnableOtel: true},
expected: &cfg.MetricsConfig{CloudMetricsExportIntervalSecs: 100},
},
{
name: "stackdriver-export-interval-positive",
cfgFile: "stackdriver_export_interval_positive.yml",
expected: &cfg.MetricsConfig{
CloudMetricsExportIntervalSecs: 12 * 3600,
StackdriverExportInterval: 12 * time.Hour,
EnableOtel: true,
},
name: "stackdriver-export-interval-positive",
cfgFile: "stackdriver_export_interval_positive.yml",
expected: &cfg.MetricsConfig{CloudMetricsExportIntervalSecs: 12 * 3600, StackdriverExportInterval: 12 * time.Hour},
},
}
for _, tc := range tests {
Expand Down

0 comments on commit 44d436d

Please sign in to comment.