Skip to content

Commit

Permalink
Merge branch 'main' into adding-instrgen-implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelewski committed Mar 22, 2023
2 parents 4a77b50 + 440185c commit be359f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -15,7 +15,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Fixed

- - AWS SDK span name to be of the format `Service.Operation` in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws`. (#3582, #3521)
- AWS SDK span name to be of the format `Service.Operation` in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws`. (#3582, #3521)
- Prevent sampler configuration reset from erroneously sampling first span in `go.opentelemetry.io/contrib/samplers/jaegerremote`. (#3603, #3604)

## [1.16.0-rc.1/0.41.0-rc.1/0.9.0-rc.1] - 2023-03-02

Expand Down
7 changes: 6 additions & 1 deletion samplers/jaegerremote/internal/utils/rate_limiter.go
Expand Up @@ -49,9 +49,14 @@ type RateLimiter struct {

// NewRateLimiter creates a new RateLimiter.
func NewRateLimiter(creditsPerSecond, maxBalance float64) *RateLimiter {
balance := maxBalance
if creditsPerSecond == 0 {
balance = 0
}

return &RateLimiter{
creditsPerSecond: creditsPerSecond,
balance: maxBalance,
balance: balance,
maxBalance: maxBalance,
lastTick: time.Now(),
timeNow: time.Now,
Expand Down
4 changes: 4 additions & 0 deletions samplers/jaegerremote/sampler_test.go
Expand Up @@ -71,6 +71,10 @@ func TestRateLimitingSampler(t *testing.T) {
assert.Equal(t, trace.RecordAndSample, result.Decision)
result = sampler.ShouldSample(trace.SamplingParameters{Name: testOperationName})
assert.Equal(t, trace.Drop, result.Decision)

sampler = newRateLimitingSampler(0)
result = sampler.ShouldSample(trace.SamplingParameters{Name: testOperationName})
assert.Equal(t, trace.Drop, result.Decision)
}

func TestGuaranteedThroughputProbabilisticSamplerUpdate(t *testing.T) {
Expand Down

0 comments on commit be359f2

Please sign in to comment.