Documentation
¶
Index ¶
- Constants
- func BuildReferer(appID, viewPath string) string
- func GenerateSessionID() string
- func ParseWeight(rate string) int
- func ResolveDebug(environment map[string]string) bool
- func ResolveRate(explicit string, environment map[string]string) string
- func Sanitize(msg string) string
- type Checkpoint
- type Client
- type Event
- type HTTPTransport
- type Options
- type RandomSource
- type SamplingConfig
- type Session
- type Transport
Constants ¶
View Source
const ( EnvRateKey = "OPTEL_RATE" EnvDebugKey = "OPTEL_DEBUG" )
View Source
const DefaultCollectBaseURL = "https://rum.hlx.page/"
View Source
const DefaultTimeout = 10 * time.Second
View Source
const DefaultWeight = 100
View Source
const MaxMessageLength = 200
Variables ¶
This section is empty.
Functions ¶
func BuildReferer ¶
func GenerateSessionID ¶
func GenerateSessionID() string
func ParseWeight ¶
func ResolveDebug ¶
Types ¶
type Checkpoint ¶
type Checkpoint string
const ( Top Checkpoint = "top" Enter Checkpoint = "enter" Reload Checkpoint = "reload" CWV Checkpoint = "cwv" PagesViewed Checkpoint = "pagesviewed" Click Checkpoint = "click" ViewBlock Checkpoint = "viewblock" ViewMedia Checkpoint = "viewmedia" FormSubmit Checkpoint = "formsubmit" Error Checkpoint = "error" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ReportError ¶
func (*Client) Sample ¶
func (c *Client) Sample(checkpoint Checkpoint, source, target string)
type HTTPTransport ¶
type HTTPTransport struct {
Client *http.Client
Timeout time.Duration
Debug func(format string, args ...any)
}
func NewHTTPTransport ¶
func NewHTTPTransport(debug bool) *HTTPTransport
type RandomSource ¶
type RandomSource interface {
Float64() float64
}
var DefaultRandomSource RandomSource = systemRandomSource{}
type SamplingConfig ¶
type SamplingConfig struct {
Weight int
}
func NewSamplingConfig ¶
func NewSamplingConfig(rate string) SamplingConfig
type Session ¶
func NewSession ¶
func NewSession(id string, config SamplingConfig, random RandomSource) Session
Click to show internal directories.
Click to hide internal directories.