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

Code before:
	globLabelValueLengthLimit = 200
	globalGoGC                = 42
	globScrapeFailureLogFile  = "testdata/fail.log"
)

var expectedConf = &Config{
	loaded: true,
	GlobalConfig: GlobalConfig{
		ScrapeInterval:       model.Duration(15 * time.Second),
		ScrapeTimeout:        DefaultGlobalConfig.ScrapeTimeout,
		EvaluationInterval:   model.Duration(30 * time.Second),
		QueryLogFile:         "testdata/query.log",
		ScrapeFailureLogFile: globScrapeFailureLogFile,

		ExternalLabels: labels.FromStrings("foo", "bar", "monitor", "codelab"),

		BodySizeLimit:                  globBodySizeLimit,
		SampleLimit:                    globSampleLimit,
		TargetLimit:                    globTargetLimit,
		LabelLimit:                     globLabelLimit,
		LabelNameLengthLimit:           globLabelNameLengthLimit,
		LabelValueLengthLimit:          globLabelValueLengthLimit,
		ScrapeNativeHistograms:         boolPtr(false),
		AlwaysScrapeClassicHistograms:  false,
		ConvertClassicHistogramsToNHCB: false,
		ExtraScrapeMetrics:             &f,
		MetricNameValidationScheme:     model.UTF8Validation,
	},

	Runtime: RuntimeConfig{
		GoGC: globalGoGC,
	},

	RuleFiles: []string{
		filepath.FromSlash("testdata/first.rules"),
		filepath.FromSlash("testdata/my/*.rules"),
	},

	RemoteWriteConfigs: []*RemoteWriteConfig{
		{
			URL:             mustParseURL("http://remote1/push"),
			ProtobufMessage: remoteapi.WriteV1MessageType,
			RemoteTimeout:   model.Duration(30 * time.Second),
			Name:            "drop_expensive",
			WriteRelabelConfigs: []*relabel.Config{
				{
					SourceLabels:         model.LabelNames{"__name__"},
					Separator:            ";",
					Regex:                relabel.MustNewRegexp("expensive.*"),
					Replacement:          "$1",
					Action:               relabel.Drop,

Review comment (suggestion):
```suggestion
		ExtraScrapeMetrics:             boolPtr(false),
```

Code after:

var expectedConf = &Config{
	loaded: true,
	GlobalConfig: GlobalConfig{
		ScrapeInterval:       model.Duration(15 * time.Second),
		ScrapeTimeout:        DefaultGlobalConfig.ScrapeTimeout,
		EvaluationInterval:   model.Duration(30 * time.Second),
		QueryLogFile:         "testdata/query.log",
		ScrapeFailureLogFile: globScrapeFailureLogFile,

		ExternalLabels: labels.FromStrings("foo", "bar", "monitor", "codelab"),

		BodySizeLimit:                  globBodySizeLimit,
		SampleLimit:                    globSampleLimit,
		TargetLimit:                    globTargetLimit,
		LabelLimit:                     globLabelLimit,
		LabelNameLengthLimit:           globLabelNameLengthLimit,
		LabelValueLengthLimit:          globLabelValueLengthLimit,
		ScrapeNativeHistograms:         boolPtr(false),
		AlwaysScrapeClassicHistograms:  false,
		ConvertClassicHistogramsToNHCB: false,
		ExtraScrapeMetrics:             boolPtr(false),
		MetricNameValidationScheme:     model.UTF8Validation,
	},

	Runtime: RuntimeConfig{
		GoGC: globalGoGC,
	},

	RuleFiles: []string{
		filepath.FromSlash("testdata/first.rules"),
		filepath.FromSlash("testdata/my/*.rules"),
	},

	RemoteWriteConfigs: []*RemoteWriteConfig{
		{
			URL:             mustParseURL("http://remote1/push"),
			ProtobufMessage: remoteapi.WriteV1MessageType,
			RemoteTimeout:   model.Duration(30 * time.Second),
			Name:            "drop_expensive",
			WriteRelabelConfigs: []*relabel.Config{
				{
					SourceLabels:         model.LabelNames{"__name__"},
					Separator:            ";",
					Regex:                relabel.MustNewRegexp("expensive.*"),
					Replacement:          "$1",
					Action:               relabel.Drop,
					NameValidationScheme: model.UTF8Validation,
				},
			},
			QueueConfig:    DefaultQueueConfig,