Documentation
¶
Overview ¶
Package analytics records individual usage events per layer, coordinate and user, unlike telemetry's aggregate counters
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAnalytics ¶
func RegisterAnalytics(reg AnalyticsRegistration)
func RegisteredAnalyticsNames ¶
func RegisteredAnalyticsNames() []string
Types ¶
type Analytics ¶
Record runs on the request goroutine after the response, so must not block. Errors are only reported, never surfaced
type AnalyticsDeps ¶ added in v0.11.0
type AnalyticsDeps struct {
Datastores datastore.DatastoreRegistry
ErrorMessages config.ErrorMessages
}
New dependencies are added as fields so the Initialize signature stays stable
type AnalyticsRegistration ¶
type AnalyticsRegistration interface {
Name() string
Initialize(config any, deps AnalyticsDeps) (Analytics, error)
InitializeConfig() any
}
func RegisteredAnalytics ¶
func RegisteredAnalytics(name string) (AnalyticsRegistration, bool)
type Event ¶
type Event struct {
Time time.Time
// The configured ID, not the URL name. Matches per-layer telemetry metrics so the two can be correlated
LayerID string
// Exactly as requested, which differs from LayerID for pattern layers
LayerName string
Z int
X int
Y int
// Empty when anonymous. Only the jwt and custom auth modules populate this
UserID string
// Resolved from the module's configuration. Nil when none are configured
Fields map[string]any
}
A single successful tile delivery. Everything but Fields is always populated
Click to show internal directories.
Click to hide internal directories.