report

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package report contains reporters for collecting specific information about the collector-

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentClient

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

AgentClient is a basic client that injects agent specific information in request headers

func NewAgentClient

func NewAgentClient(agentID string, secretKey *string, tlsConfig *tls.Config) *AgentClient

NewAgentClient creates a new AgentClient

func (*AgentClient) Do

func (a *AgentClient) Do(req *http.Request) (*http.Response, error)

Do injects agent specific information into headers then sends the request

type Client

type Client interface {
	// Do makes the specified request and return the body contents.
	Do(req *http.Request) (*http.Response, error)
}

Client represents a client that can report information to a platform

type Manager

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

Manager represents a structure that manages all of the different reporters

func GetManager

func GetManager() *Manager

GetManager returns the global Manager

func (*Manager) ResetConfig

func (m *Manager) ResetConfig(configData []byte) error

ResetConfig resets the current config

func (*Manager) SetClient

func (m *Manager) SetClient(client Client) error

SetClient sets the client of the manager to the passed in client

type Reporter

type Reporter interface {
	// Kind returns the kind of this reporter
	Kind() string

	// Report starts reporting with the passed in configuration.
	Report(config any) error
}

Reporter represents a a structure to collector and report specific structures

type SnapshotReporter

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

SnapshotReporter tracks and reports snapshots

func GetSnapshotReporter

func GetSnapshotReporter() *SnapshotReporter

GetSnapshotReporter returns the global SnapshotReporter

func NewSnapshotReporter

func NewSnapshotReporter(client Client) *SnapshotReporter

NewSnapshotReporter creates a new SnapshotReporter with the associated client

func (*SnapshotReporter) Kind

func (s *SnapshotReporter) Kind() string

Kind returns kind of the reporter

func (*SnapshotReporter) Report

func (s *SnapshotReporter) Report(cfg any) error

Report applies the new configuration and reports snapshots specified in it

func (*SnapshotReporter) Reset

func (s *SnapshotReporter) Reset()

Reset clears all buffers

func (*SnapshotReporter) SaveLogs

func (s *SnapshotReporter) SaveLogs(componentID string, ld plog.Logs)

SaveLogs saves off logs in a snapshot to be reported later

func (*SnapshotReporter) SaveMetrics

func (s *SnapshotReporter) SaveMetrics(componentID string, md pmetric.Metrics)

SaveMetrics saves off metrics in a snapshot to be reported later

func (*SnapshotReporter) SaveTraces

func (s *SnapshotReporter) SaveTraces(componentID string, td ptrace.Traces)

SaveTraces saves off traces in a snapshot to be reported later

Directories

Path Synopsis
Package snapshot defines contract for collecting snapshots as well as helper structures
Package snapshot defines contract for collecting snapshots as well as helper structures
mocks
Package mocks contains mocks for snapshot interfaces
Package mocks contains mocks for snapshot interfaces

Jump to

Keyboard shortcuts

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