Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Enable OTel metrics by default (#2859)" #2882

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading