mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-02 11:56:02 +02:00
* update tracing config definitions * new tracing system * performance improvements * only configure tracing in envoy if it is enabled in pomerium * [tracing] refactor to use custom extension for trace id editing (#5420) refactor to use custom extension for trace id editing * set default tracing sample rate to 1.0 * fix proxy service http middleware * improve some existing auth related traces * test fixes * bump envoyproxy/go-control-plane * code cleanup * test fixes * Fix missing spans for well-known endpoints * import extension apis from pomerium/envoy-custom
30 lines
672 B
Go
30 lines
672 B
Go
package trace_test
|
|
|
|
import (
|
|
"net/url"
|
|
"testing"
|
|
|
|
"github.com/pomerium/pomerium/internal/telemetry/trace"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPomeriumURLQueryCarrier(t *testing.T) {
|
|
t.Parallel()
|
|
values := url.Values{}
|
|
carrier := trace.PomeriumURLQueryCarrier(values)
|
|
assert.Empty(t, carrier.Get("foo"))
|
|
carrier.Set("foo", "bar")
|
|
assert.Equal(t, url.Values{
|
|
"pomerium_foo": []string{"bar"},
|
|
}, values)
|
|
assert.Equal(t, "bar", carrier.Get("foo"))
|
|
carrier.Set("foo", "bar2")
|
|
assert.Equal(t, url.Values{
|
|
"pomerium_foo": []string{"bar2"},
|
|
}, values)
|
|
assert.Equal(t, "bar2", carrier.Get("foo"))
|
|
|
|
assert.Panics(t, func() {
|
|
carrier.Keys()
|
|
})
|
|
}
|