Documentation ¶
Index ¶
- Constants
- func NewFactory() receiver.Factory
- type Config
- type HttpClient
- type HttpClientHelper
- func (h *HttpClientHelper) ExecuteJsonRequest(req *http.Request) (map[string]interface{}, error)
- func (h *HttpClientHelper) NewGetRequest(url string) (*http.Request, error)
- func (h *HttpClientHelper) NewJsonRequest(method, url, body string) (*http.Request, error)
- func (h *HttpClientHelper) NewPostJsonRequest(url, body string) (*http.Request, error)
- func (h *HttpClientHelper) NewPutJsonRequest(url, body string) (*http.Request, error)
- func (h *HttpClientHelper) NewRequest(method, url string, body io.Reader) (*http.Request, error)
- func (h *HttpClientHelper) SetAuthToken(token string)
- func (h *HttpClientHelper) SetBasicAuth(username, password string)
- type MetricsBuilder
- type ResourceBuilder
Constants ¶
View Source
const ( HEADER_KEY_AUTHORIZATION = "Authorization" HEADER_KEY_CONTENT_TYPE = "Content-Type" CONTENT_TYPE_JSON = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a new receiver factory for SNMP
Types ¶
type Config ¶
type Config struct { scraperhelper.ControllerConfig `mapstructure:",squash"` Endpoint string `mapstructure:"endpoint"` AuthToken string `mapstructure:"auth_token"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` }
type HttpClientHelper ¶
type HttpClientHelper struct { Client HttpClient CommonHeaders map[string]string }
func NewHttpClientHelper ¶
func NewHttpClientHelper() *HttpClientHelper
func (*HttpClientHelper) ExecuteJsonRequest ¶
func (h *HttpClientHelper) ExecuteJsonRequest(req *http.Request) (map[string]interface{}, error)
func (*HttpClientHelper) NewGetRequest ¶
func (h *HttpClientHelper) NewGetRequest(url string) (*http.Request, error)
func (*HttpClientHelper) NewJsonRequest ¶
func (h *HttpClientHelper) NewJsonRequest(method, url, body string) (*http.Request, error)
func (*HttpClientHelper) NewPostJsonRequest ¶
func (h *HttpClientHelper) NewPostJsonRequest(url, body string) (*http.Request, error)
func (*HttpClientHelper) NewPutJsonRequest ¶
func (h *HttpClientHelper) NewPutJsonRequest(url, body string) (*http.Request, error)
func (*HttpClientHelper) NewRequest ¶
func (*HttpClientHelper) SetAuthToken ¶
func (h *HttpClientHelper) SetAuthToken(token string)
func (*HttpClientHelper) SetBasicAuth ¶
func (h *HttpClientHelper) SetBasicAuth(username, password string)
type MetricsBuilder ¶
type MetricsBuilder struct {
// contains filtered or unexported fields
}
func NewMetricsBuilder ¶
func NewMetricsBuilder() *MetricsBuilder
func (MetricsBuilder) GetMetrics ¶
func (builder MetricsBuilder) GetMetrics() pmetric.Metrics
func (*MetricsBuilder) GetOrCreateResource ¶
func (builder *MetricsBuilder) GetOrCreateResource(resourceAttributes map[string]any, scope_name, scope_version string) (*ResourceBuilder, error)
type ResourceBuilder ¶
type ResourceBuilder struct {
pmetric.ResourceMetrics
}
func (*ResourceBuilder) AddGaugeMetricDouble ¶
func (rb *ResourceBuilder) AddGaugeMetricDouble(metricName, unit string, value float64, timestamp time.Time)
func (*ResourceBuilder) AddGaugeMetricInt ¶
func (rb *ResourceBuilder) AddGaugeMetricInt(metricName, unit string, value int64, timestamp time.Time)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.