Skip to content

how to disable metrics in order to reduce data usage #1118

@wayneforrest

Description

@wayneforrest

Description

How can I disable "metrics" only, in order to reduce data usage.
1: I want logs enabled
2: I want crash reporting
3: all other metrics disabled (especially all automated metrics)

Please see my current config: With this config, I see non web transaction data reported on the APM dashboard.
(no sure how to inspect how much data a specific host is producing)

Below, I want to have logging and panics being recorded, and metrics disabled.

func initNewRelic() (*newrelic.Application, *telemetry.Harvester, error) {

	app, err := newrelic.NewApplication(
		newrelic.ConfigAppName("AppName"),
		newrelic.ConfigLicense("a-license-key"),
		newrelic.ConfigAppLogEnabled(true), // keep this on
		newrelic.ConfigAppLogMetricsEnabled(false), // disable log metrics to reduce data sent
		func(config *newrelic.Config) {
			config.RuntimeSampler.Enabled = false
			config.ErrorCollector.RecordPanics = true // keep this on
			config.CustomInsightsEvents.Enabled = false
			config.DatastoreTracer.InstanceReporting.Enabled = false
			config.DatastoreTracer.DatabaseNameReporting.Enabled = false
			config.DatastoreTracer.QueryParameters.Enabled = false
			config.ErrorCollector.CaptureEvents = false
			config.BrowserMonitoring.Enabled = false
		},
		newrelic.ConfigAppLogForwardingEnabled(true),
	)
	if err != nil {
		return nil, nil, err
	}

	h, err := telemetry.NewHarvester(telemetry.ConfigAPIKey("license-key"),
		telemetry.ConfigCommonAttributes(map[string]interface{}{
			"app.name": "appName",
		}),
	)
	if err != nil {
		return nil, nil, err
	}

	return app, h, nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions