Documentation ¶
Overview ¶
Package hcp handles the low level initialization and execution of the HCP client
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a TelemetryClient that lazily retrieves configuration from HCP. TelemtryConfiguration can be loaded on-demand using the ReloadConfig() function.
func (*Client) MetricAttributes ¶
MetricAttributes returns the labels we were told to include from the TelemetryConfig.
func (*Client) MetricFilters ¶
MetricFilters returns the metric inclusion filters from the TelemetryConfig.
func (*Client) MetricsEndpoint ¶
MetricsEndpoint returns the metrics endpoint from the TelemetryConfig.
func (*Client) ReloadConfig ¶
ReloadConfig will retrieve the telemetry configuration from HCP using the initially configured runtime.
type ClientService ¶
type ClientService interface { AgentTelemetryConfig(params *consul_telemetry_service.AgentTelemetryConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...consul_telemetry_service.ClientOption) (*consul_telemetry_service.AgentTelemetryConfigOK, error) }
ClientService is a paired down interface for the global-network-manager-service that retrieves the AgentTelemetryConfig. Allows mocking.
type MockClient ¶
type MockClient struct { MockMetricsEndpoint string MockMetricFilters []string MockMetricAttributes map[string]string Err error }
MockClient fulfills the TelemetryClient interface and returns static values. Used for testing.
func (*MockClient) MetricAttributes ¶
func (m *MockClient) MetricAttributes() (map[string]string, error)
MetricAttributes returns the provided metric inclusion filters. Will never error.
func (*MockClient) MetricFilters ¶
func (m *MockClient) MetricFilters() ([]string, error)
MetricFilters returns the provided metric inclusion filters. Will never error.
func (*MockClient) MetricsEndpoint ¶
func (m *MockClient) MetricsEndpoint() (string, error)
MetricsEndpoint returns the provided metrics endpoint. Will never error.
type MockClientService ¶
type MockClientService struct { MockResponse *consul_telemetry_service.AgentTelemetryConfigOK Err error // contains filtered or unexported fields }
MockClientService fulfills the TelemetryClient interface and returns static values. Used for testing.
func (*MockClientService) AgentTelemetryConfig ¶
func (m *MockClientService) AgentTelemetryConfig(params *consul_telemetry_service.AgentTelemetryConfigParams, _ runtime.ClientAuthInfoWriter, opts ...consul_telemetry_service.ClientOption) (*consul_telemetry_service.AgentTelemetryConfigOK, error)
AgentTelemetryConfig returns mocked responses.
type Params ¶
type Params struct {
ClientID, ClientSecret, ResourceURL string
}
Params is structure used to hold parameters to generate a new client.
type TelemetryClient ¶
type TelemetryClient interface { MetricsEndpoint() (string, error) MetricFilters() ([]string, error) MetricAttributes() (map[string]string, error) }
TelemetryClient is a high level client for the AgentTelemetryConfig. It abstracts the interaction with HCP to retrieve the AgentTelemetryConfig.