Skip to content

Commit

Permalink
One more test
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Nov 29, 2022
1 parent 2feafeb commit e9ab180
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions dynamic_sampling_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestDynamicSamplingContextFromTransaction(t *testing.T) {
input *Span
want DynamicSamplingContext
}{
// Normal flow
{
input: func() *Span {
ctx := NewTestContext(ClientOptions{
Expand Down Expand Up @@ -83,6 +84,29 @@ func TestDynamicSamplingContextFromTransaction(t *testing.T) {
},
},
},
// Transaction with source url, do not include in Dynamic Sampling context
{
input: func() *Span {
ctx := NewTestContext(ClientOptions{
EnableTracing: true,
TracesSampleRate: 1.0,
Dsn: "http://public@example.com/sentry/1",
Release: "1.0.0",
})
txn := StartTransaction(ctx, "name")
txn.TraceID = TraceIDFromHex("d49d9bf66f13450b81f65bc51cf49c03")
return txn
}(),
want: DynamicSamplingContext{
Frozen: true,
Entries: map[string]string{
"sample_rate": "1.0",
"trace_id": "d49d9bf66f13450b81f65bc51cf49c03",
"public_key": "public",
"release": "1.0.0",
},
},
},
}

for _, tc := range tests {
Expand Down

0 comments on commit e9ab180

Please sign in to comment.