promhttp2

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package promhttp2 is a local copy of github.com/prometheus/common/config, maintained so that the pyroscope write component can customise HTTP client construction in ways that are not possible through the upstream API, for example enabling h2c (HTTP/2 cleartext).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientFromConfig

func NewClientFromConfig(cfg commonconfig.HTTPClientConfig, name string, optFuncs ...HTTPClientOption) (*http.Client, error)

func NewClientFromConfigMirror added in v1.16.0

func NewClientFromConfigMirror(cfg HTTPClientConfigMirror, name string, optFuncs ...HTTPClientOption) (*http.Client, error)

func NewRoundTripperFromConfig

func NewRoundTripperFromConfig(cfg commonconfig.HTTPClientConfig, name string, optFuncs ...HTTPClientOption) (http.RoundTripper, error)

NewRoundTripperFromConfig returns a new HTTP RoundTripper configured for the given config.HTTPClientConfig and config.HTTPClientOption. The name is used as go-conntrack metric label.

Types

type HTTPClientConfigMirror added in v1.16.0

type HTTPClientConfigMirror struct {
	commonconfig.HTTPClientConfig
	H2C bool // use HTTP/2 cleartext (h2c) instead of standard transport
}

HTTPClientConfigMirror wraps commonconfig.HTTPClientConfig with extra fields that cannot be expressed via the upstream type.

type HTTPClientOption

type HTTPClientOption struct {
	// contains filtered or unexported fields
}

HTTPClientOption applies a setting to both the local httpClientOptions and carries the equivalent upstream commonconfig.HTTPClientOption so it can be forwarded to upstream calls (e.g. NewOAuth2RoundTripper) without conversion.

func WithHTTP2Disabled

func WithHTTP2Disabled() HTTPClientOption

func WithHost

func WithHost(host string) HTTPClientOption

func WithIdleConnTimeout

func WithIdleConnTimeout(timeout time.Duration) HTTPClientOption

func WithKeepAlivesDisabled

func WithKeepAlivesDisabled() HTTPClientOption

func WithNewTLSConfigFunc

func WithNewTLSConfigFunc(newTLSConfigFunc commonconfig.NewTLSConfigFunc) HTTPClientOption

func WithUserAgent

func WithUserAgent(ua string) HTTPClientOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL