Skip to content

Add Proxy to Self Instrumentation #1204

Open
@rubenruizdegauna

Description

When the Infra-Agent is configured to use a Proxy, this should be added to self-instrumentation if enabled.

This can be done passing a custom Transport the APM agent (or using environment variables)

	// collectorDefaultTransport is the http.Transport to be used with
	// communication to the collector backend if a Transport is not set on the
	// Config.
	collectorDefaultTransport = &http.Transport{
		Proxy: http.ProxyFromEnvironment,
		DialContext: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
			DualStack: true,
		}).DialContext,
		ForceAttemptHTTP2:     true, // added in go 1.13
		MaxIdleConns:          100,
		MaxIdleConnsPerHost:   100, // note: different from default global transport
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
	}

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