Documentation ¶
Index ¶
- Constants
- Variables
- func BuildMetadataProvider(logger logging.Logger, c *config.Config) cloud.MetadataProvider
- func HashMetricValue(s string) string
- func IsSuccessStatusCode(statusCode int) bool
- type BufferedCollector
- func (s *BufferedCollector) Close()
- func (s *BufferedCollector) CollectCommPrefs(commPrefsEventData CommPrefs)
- func (s *BufferedCollector) CollectEvent(ev Event)
- func (s *BufferedCollector) CollectEvents(ev Event, count uint64)
- func (s *BufferedCollector) CollectMetadata(accountMetadata *Metadata)
- func (s *BufferedCollector) SetInstallationID(installationID string)
- func (s *BufferedCollector) SetRuntimeCollector(runtimeCollector func() map[string]string)
- func (s *BufferedCollector) Start(ctx context.Context)
- func (s *BufferedCollector) Stop()
- type BufferedCollectorOpts
- type Collector
- type CommPrefs
- type CommPrefsData
- type Config
- type Event
- type FlushTicker
- type HTTPSender
- type InputEvent
- type LoggerAdapter
- type Metadata
- type MetadataEntry
- type MetadataProvider
- type Metric
- type NullCollector
- type Sender
- type TimeFn
- type TimeTicker
Constants ¶
View Source
const BlockstoreTypeKey = "blockstore_type"
Variables ¶
View Source
var ( ErrSendError = errors.New("stats: send error") ErrNoInstallationID = fmt.Errorf("installation ID is missing: %w", ErrSendError) )
Functions ¶
func BuildMetadataProvider ¶
func HashMetricValue ¶ added in v0.83.0
func IsSuccessStatusCode ¶ added in v0.90.1
IsSuccessStatusCode returns true for status code 2xx
Types ¶
type BufferedCollector ¶
type BufferedCollector struct {
// contains filtered or unexported fields
}
func NewBufferedCollector ¶
func NewBufferedCollector(installationID string, cfg Config, opts ...BufferedCollectorOpts) *BufferedCollector
func (*BufferedCollector) Close ¶ added in v0.62.0
func (s *BufferedCollector) Close()
func (*BufferedCollector) CollectCommPrefs ¶ added in v0.87.0
func (s *BufferedCollector) CollectCommPrefs(commPrefsEventData CommPrefs)
func (*BufferedCollector) CollectEvent ¶
func (s *BufferedCollector) CollectEvent(ev Event)
func (*BufferedCollector) CollectEvents ¶ added in v0.89.0
func (s *BufferedCollector) CollectEvents(ev Event, count uint64)
func (*BufferedCollector) CollectMetadata ¶
func (s *BufferedCollector) CollectMetadata(accountMetadata *Metadata)
func (*BufferedCollector) SetInstallationID ¶
func (s *BufferedCollector) SetInstallationID(installationID string)
func (*BufferedCollector) SetRuntimeCollector ¶ added in v0.48.0
func (s *BufferedCollector) SetRuntimeCollector(runtimeCollector func() map[string]string)
func (*BufferedCollector) Start ¶ added in v0.90.1
func (s *BufferedCollector) Start(ctx context.Context)
func (*BufferedCollector) Stop ¶ added in v0.90.1
func (s *BufferedCollector) Stop()
type BufferedCollectorOpts ¶
type BufferedCollectorOpts func(s *BufferedCollector)
func WithExtended ¶ added in v0.83.0
func WithExtended(b bool) BufferedCollectorOpts
func WithLogger ¶ added in v0.83.0
func WithLogger(l logging.Logger) BufferedCollectorOpts
func WithSender ¶
func WithSender(sender Sender) BufferedCollectorOpts
func WithTicker ¶
func WithTicker(t FlushTicker) BufferedCollectorOpts
func WithWriteBufferSize ¶
func WithWriteBufferSize(bufferSize int) BufferedCollectorOpts
type CommPrefsData ¶ added in v0.87.0
type Event ¶ added in v0.83.0
type Event struct { Class string `json:"class"` Name string `json:"name"` Repository string `json:"repository,omitempty"` Ref string `json:"ref,omitempty"` SourceRef string `json:"source_ref,omitempty"` UserID string `json:"user_id,omitempty"` Client string `json:"client,omitempty"` }
func (Event) ClearExtended ¶ added in v0.83.0
ClearExtended clear values of *all* extended fields
func (Event) HashExtended ¶ added in v0.83.0
HashExtended hash the values of extended fields with sensitive information
type FlushTicker ¶
type HTTPSender ¶
type HTTPSender struct {
// contains filtered or unexported fields
}
func NewHTTPSender ¶
func NewHTTPSender(addr string, log logging.Logger) *HTTPSender
func (*HTTPSender) SendEvent ¶
func (s *HTTPSender) SendEvent(ctx context.Context, event *InputEvent) error
func (*HTTPSender) UpdateCommPrefs ¶ added in v0.87.0
func (s *HTTPSender) UpdateCommPrefs(ctx context.Context, commPrefs *CommPrefsData) error
func (*HTTPSender) UpdateMetadata ¶
func (s *HTTPSender) UpdateMetadata(ctx context.Context, m Metadata) error
type InputEvent ¶
type LoggerAdapter ¶ added in v0.90.1
func (*LoggerAdapter) Printf ¶ added in v0.90.1
func (l *LoggerAdapter) Printf(msg string, args ...interface{})
type Metadata ¶
type Metadata struct { InstallationID string `json:"installation_id"` Entries []MetadataEntry `json:"entries"` }
func NewMetadata ¶
func NewMetadata(ctx context.Context, logger logging.Logger, blockstoreType string, metadataProvider MetadataProvider, cloudMetadataProvider cloud.MetadataProvider) *Metadata
type MetadataEntry ¶
type MetadataProvider ¶ added in v0.102.0
type NullCollector ¶ added in v0.70.1
type NullCollector struct{}
func (*NullCollector) Close ¶ added in v0.70.1
func (m *NullCollector) Close()
func (*NullCollector) CollectCommPrefs ¶ added in v0.87.0
func (m *NullCollector) CollectCommPrefs(_ CommPrefs)
func (*NullCollector) CollectEvent ¶ added in v0.70.1
func (m *NullCollector) CollectEvent(_ Event)
func (*NullCollector) CollectEvents ¶ added in v0.89.0
func (m *NullCollector) CollectEvents(_ Event, _ uint64)
func (*NullCollector) CollectMetadata ¶ added in v0.70.1
func (m *NullCollector) CollectMetadata(_ *Metadata)
func (*NullCollector) SetInstallationID ¶ added in v0.70.1
func (m *NullCollector) SetInstallationID(_ string)
type TimeTicker ¶
type TimeTicker struct {
// contains filtered or unexported fields
}
func (*TimeTicker) Stop ¶
func (t *TimeTicker) Stop()
func (*TimeTicker) Tick ¶
func (t *TimeTicker) Tick() <-chan time.Time
Click to show internal directories.
Click to hide internal directories.