Skip to content

Commit

Permalink
Removed comments from config, clearifed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenmllr committed Dec 5, 2023
1 parent e5e2287 commit 476bfdb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
6 changes: 3 additions & 3 deletions analytics/http/Readme.md → analytics/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ analytics:
endpoint:
# Required: url where the endpoint post data to
url: "https://my-rest-endpoint.com"
# Required: timeout for the request
# Required: timeout for the request (parsed as golang duration)
timeout: "2s"
# Optional: enables gzip compression for the payload
gzip: false
Expand All @@ -23,9 +23,9 @@ analytics:
X-My-header: "some-thing"
buffer: # Flush events when (first condition reached)
# Size of the buffer in bytes
size: "2MB" # greater than 2MB
size: "2MB" # greater than 2MB (size using SI standard eg. "44kB", "17MB")
count : 100 # greater than 100 events
timeout: "15m" # greater than 15 minutes
timeout: "15m" # greater than 15 minutes (parsed as golang duration)
auction:
enabled: false # enable auction tracking
sample_rate: 1 # sample rate 0-1.0 to sample the event
Expand Down
21 changes: 6 additions & 15 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,30 +473,21 @@ type AnalyticsHttp struct {
}

type AnalyticsBuffer struct {
// Size of the buffer in bytes
BufferSize string `mapstructure:"size"`
// Number of events to buffer before sending
EventCount int `mapstructure:"count"`
// Buffer Timeout in milliseconds
Timeout string `mapstructure:"timeout"`
EventCount int `mapstructure:"count"`
Timeout string `mapstructure:"timeout"`
}

type AnalyticsHttpEndpoint struct {
// URL of the endpoint
Url string `mapstructure:"url"`
// HTTP Timeout in milliseconds
Timeout string `mapstructure:"timeout"`
// Use GZIP compression for buffering and sending, this does make the body non valid json
Gzip bool `mapstructure:"gzip"`
// Additional headers to send with the request
Url string `mapstructure:"url"`
Timeout string `mapstructure:"timeout"`
Gzip bool `mapstructure:"gzip"`
AdditionalHeaders map[string]string `mapstructure:"additional_headers"`
}

type AnalyticsFeature struct {
// Sampling rate 0-1 for the feature
SampleRate float64 `mapstructure:"sample_rate"`
// Filter to apply to the feature
Filter string `mapstructure:"filter"`
Filter string `mapstructure:"filter"`
}

// FileLogs Corresponding config for FileLogger as a PBS Analytics Module
Expand Down

0 comments on commit 476bfdb

Please sign in to comment.