Repository: prometheus/prometheus
File: config/config.go (Go)

Code before:
	// DefaultConfig is the default top-level configuration.
	DefaultConfig = Config{
		GlobalConfig: DefaultGlobalConfig,
		Runtime:      DefaultRuntimeConfig,
		OTLPConfig:   DefaultOTLPConfig,
	}

	f bool
	// DefaultGlobalConfig is the default global configuration.
	DefaultGlobalConfig = GlobalConfig{
		ScrapeInterval:     model.Duration(1 * time.Minute),
		ScrapeTimeout:      model.Duration(10 * time.Second),
		EvaluationInterval: model.Duration(1 * time.Minute),
		RuleQueryOffset:    model.Duration(0 * time.Minute),
		// This is nil to be able to distinguish between the case when
		// the normal default should be used and the case when a
		// new default is needed due to an enabled feature flag.
		// E.g. set to `DefaultProtoFirstScrapeProtocols` when
		// the feature flag `created-timestamp-zero-ingestion` is set.
		ScrapeProtocols: nil,
		// When the native histogram feature flag is enabled,
		// ScrapeNativeHistograms default changes to true.
		ScrapeNativeHistograms:         &f,
		ConvertClassicHistogramsToNHCB: false,
		AlwaysScrapeClassicHistograms:  false,
		ExtraScrapeMetrics:             &f,
		MetricNameValidationScheme:     model.UTF8Validation,
		MetricNameEscapingScheme:       model.AllowUTF8,
	}

	DefaultRuntimeConfig = RuntimeConfig{
		// Go runtime tuning.
		GoGC: getGoGC(),
	}

	// DefaultScrapeConfig is the default scrape configuration. Users of this
	// default MUST call Validate() on the config after creation, even if it's
	// used unaltered, to check for parameter correctness and fill out default
	// values that can't be set inline in this declaration.
	DefaultScrapeConfig = ScrapeConfig{
		// ScrapeTimeout, ScrapeInterval, ScrapeProtocols, AlwaysScrapeClassicHistograms, and ConvertClassicHistogramsToNHCB default to the configured globals.
		MetricsPath:       "/metrics",
		Scheme:            "http",
		HonorLabels:       false,
		HonorTimestamps:   true,
		HTTPClientConfig:  config.DefaultHTTPClientConfig,
		EnableCompression: true,
	}

	// DefaultAlertmanagerConfig is the default alertmanager configuration.
	DefaultAlertmanagerConfig = AlertmanagerConfig{

Review comment (suggestion):
reusing the same point sounds like a bad idea, it's probably better to add another variable or make a function that creates a new pointer every time it's called

e.g. from the tests:
```
func boolPtr(b bool) *bool {
	return &b
}
```

Code after:
}

// The defaults applied before parsing the respective config sections.
var (
	// DefaultConfig is the default top-level configuration.
	DefaultConfig = Config{
		GlobalConfig: DefaultGlobalConfig,
		Runtime:      DefaultRuntimeConfig,
		OTLPConfig:   DefaultOTLPConfig,
	}

	// DefaultGlobalConfig is the default global configuration.
	DefaultGlobalConfig = GlobalConfig{
		ScrapeInterval:     model.Duration(1 * time.Minute),
		ScrapeTimeout:      model.Duration(10 * time.Second),
		EvaluationInterval: model.Duration(1 * time.Minute),
		RuleQueryOffset:    model.Duration(0 * time.Minute),
		// This is nil to be able to distinguish between the case when
		// the normal default should be used and the case when a
		// new default is needed due to an enabled feature flag.
		// E.g. set to `DefaultProtoFirstScrapeProtocols` when
		// the feature flag `created-timestamp-zero-ingestion` is set.
		ScrapeProtocols: nil,
		// When the native histogram feature flag is enabled,
		// ScrapeNativeHistograms default changes to true.
		ScrapeNativeHistograms:         boolPtr(false),
		ConvertClassicHistogramsToNHCB: false,
		AlwaysScrapeClassicHistograms:  false,
		ExtraScrapeMetrics:             boolPtr(false),
		MetricNameValidationScheme:     model.UTF8Validation,
		MetricNameEscapingScheme:       model.AllowUTF8,
	}

	DefaultRuntimeConfig = RuntimeConfig{
		// Go runtime tuning.
		GoGC: getGoGC(),
	}

	// DefaultScrapeConfig is the default scrape configuration. Users of this
	// default MUST call Validate() on the config after creation, even if it's
	// used unaltered, to check for parameter correctness and fill out default
	// values that can't be set inline in this declaration.
	DefaultScrapeConfig = ScrapeConfig{
		// ScrapeTimeout, ScrapeInterval, ScrapeProtocols, AlwaysScrapeClassicHistograms, and ConvertClassicHistogramsToNHCB default to the configured globals.
		MetricsPath:       "/metrics",
		Scheme:            "http",
		HonorLabels:       false,
		HonorTimestamps:   true,
		HTTPClientConfig:  config.DefaultHTTPClientConfig,
		EnableCompression: true,
	}