Skip to content

Commit

Permalink
APIGOV-27057 - update default and max sampling percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
sbolosan committed Jan 16, 2024
1 parent afc54e2 commit eb96797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions pkg/traceability/sampling/definitions.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package sampling

//SampleKey - the key used in the metadata when a transaction qualifies for sampling and should be sent to Observer
// SampleKey - the key used in the metadata when a transaction qualifies for sampling and should be sent to Observer
// defaultSamplingRate - the default sampling rate in percentage
const (
SampleKey = "sample"
countMax = 100
defaultSamplingRate = 10
defaultSamplingRate = 1
globalCounter = "global"
)

//TransactionDetails - details about the transaction that are used for sampling
// TransactionDetails - details about the transaction that are used for sampling
type TransactionDetails struct {
Status string
APIID string
Expand Down
4 changes: 2 additions & 2 deletions pkg/traceability/sampling/globalsampling.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ var agentSamples *sample

// Sampling - configures the sampling of events the agent sends to Amplify
type Sampling struct {
Percentage int `config:"percentage" validate:"min=0, max=100"`
Percentage int `config:"percentage" validate:"min=0, max=10"`
PerAPI bool `config:"per_api"`
PerSub bool `config:"per_subscription"`
ReportAllErrors bool `config:"reportAllErrors" yaml:"reportAllErrors"`
}

//DefaultConfig - returns a default sampling config where all transactions are sent
// DefaultConfig - returns a default sampling config where all transactions are sent
func DefaultConfig() Sampling {
return Sampling{
Percentage: defaultSamplingRate,
Expand Down

0 comments on commit eb96797

Please sign in to comment.