Documentation
¶
Index ¶
Constants ¶
const ScopeProbeIDHeader = "X-Scope-Probe-ID"
ScopeProbeIDHeader is the header we use to carry the probe's unique ID. The ID is currently set to the probe's hostname. It's designed to deduplicate reports from the same probe to the same receiver, in case the probe is configured to publish to multiple receivers that resolve to the same app.
Variables ¶
var ( // AppPort is the default port that the app will use for its HTTP server. // The app publishes the API and user interface, and receives reports from // probes, on this port. AppPort = 4040 )
Functions ¶
Types ¶
type Adder ¶ added in v0.7.0
Adder is something that can accept reports. It's a convenient interface for parts of the app, and several experimental components.
type BackgroundPublisher ¶ added in v0.7.0
type BackgroundPublisher struct {
// contains filtered or unexported fields
}
BackgroundPublisher is a publisher which does the publish asynchronously. It will only do one publish at once; if there is an ongoing publish, concurrent publishes are dropped.
func NewBackgroundPublisher ¶ added in v0.7.0
func NewBackgroundPublisher(p Publisher) *BackgroundPublisher
NewBackgroundPublisher creates a new BackgroundPublisher with the given publisher
func (*BackgroundPublisher) Publish ¶ added in v0.7.0
func (b *BackgroundPublisher) Publish(buf *bytes.Buffer) error
Publish implements Publisher
func (*BackgroundPublisher) Stop ¶ added in v0.7.0
func (b *BackgroundPublisher) Stop()
Stop implements Publisher
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector receives published reports from multiple producers. It yields a single merged report, representing all collected reports.
func NewCollector ¶
NewCollector returns a collector ready for use.
func (*Collector) Add ¶ added in v0.3.0
Add adds a report to the collector's internal state. It implements Adder.
type HTTPPublisher ¶ added in v0.7.0
type HTTPPublisher struct {
// contains filtered or unexported fields
}
HTTPPublisher publishes reports by POST to a fixed endpoint.
func NewHTTPPublisher ¶ added in v0.7.0
func NewHTTPPublisher(target, token, id string) (*HTTPPublisher, error)
NewHTTPPublisher returns an HTTPPublisher ready for use.
func (HTTPPublisher) Publish ¶ added in v0.7.0
func (p HTTPPublisher) Publish(buf *bytes.Buffer) error
Publish publishes the report to the URL.
func (HTTPPublisher) String ¶ added in v0.7.0
func (p HTTPPublisher) String() string
type MultiPublisher ¶ added in v0.7.0
type MultiPublisher struct {
// contains filtered or unexported fields
}
MultiPublisher implements Publisher over a set of publishers.
func NewMultiPublisher ¶ added in v0.7.0
func NewMultiPublisher(factory func(string) (Publisher, error)) *MultiPublisher
NewMultiPublisher returns a new MultiPublisher ready for use. The factory should be e.g. NewHTTPPublisher, except you need to curry it over the probe token.
func (*MultiPublisher) Add ¶ added in v0.7.0
func (p *MultiPublisher) Add(target string)
Add allows additional targets to be added dynamically. It will dedupe identical targets. TODO we have no good mechanism to remove.
func (*MultiPublisher) Publish ¶ added in v0.7.0
func (p *MultiPublisher) Publish(buf *bytes.Buffer) error
Publish implements Publisher by emitting the report to all publishers.
func (*MultiPublisher) Stop ¶ added in v0.7.0
func (p *MultiPublisher) Stop()
Stop implements Publisher
type Publisher ¶
Publisher is something which can send a buffered set of data somewhere, probably to a collector.
type ReportPublisher ¶ added in v0.7.0
type ReportPublisher struct {
// contains filtered or unexported fields
}
A ReportPublisher uses a buffer pool to serialise reports, which it then passes to a publisher
func NewReportPublisher ¶ added in v0.7.0
func NewReportPublisher(publisher Publisher) *ReportPublisher
NewReportPublisher creates a new report publisher
func (*ReportPublisher) Publish ¶ added in v0.7.0
func (p *ReportPublisher) Publish(r report.Report) error
Publish serialises and compresses a report, then passes it to a publisher
Source Files
¶
- collector.go
- ports.go
- publisher.go
- report_publisher.go