Documentation
¶
Index ¶
- func DBMBaseHash(service, containerTagsHash string) string
- func DecodeV1Traces(t *testing.T, buf []byte) map[string]any
- func DiscardLogger() tracer.Logger
- func FlushTelemetry()
- func SetContainerTagsHash(t *testing.T, hash string)
- func SetGlobalAnalyticsRate(t *testing.T, val float64)
- func SetGlobalDogstatsdAddr(t *testing.T, val string)
- func SetGlobalHeaderTags(t *testing.T, headers ...string)
- func SetGlobalServiceName(t *testing.T, val string)
- func SetPropagatingTag(t testing.TB, ctx *tracer.SpanContext, k, v string)
- func SkipIfGoTip(t testing.TB, format string, args ...any)
- func StartAppSec(t *testing.T, opts ...config.StartOption)
- func StartAppSecBench(b *testing.B)
- func StartTelemetryRecorder(t *testing.T) *telemetrytest.RecordClient
- type MockStatsdClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBMBaseHash ¶
DBMBaseHash computes the expected DBM base hash for the given inputs, matching the value injected as ddsh in SQL comments and as _dd.propagated_hash on spans. It mirrors computeBaseHash by returning "" when process tags are unavailable.
func DecodeV1Traces ¶ added in v2.9.0
DecodeV1Traces decodes a msgpack-encoded v1 payload (e.g. bytes read from req.Body of an agent intake request) and returns its top-level fields keyed by their numeric proto field IDs (as strings). Fields absent from the payload (zero value after decode) are omitted from the result.
func DiscardLogger ¶
func FlushTelemetry ¶ added in v2.4.0
func FlushTelemetry()
FlushTelemetry flushes any pending telemetry data.
func SetContainerTagsHash ¶
SetContainerTagsHash sets the container tags hash for the duration of the test.
func SetGlobalAnalyticsRate ¶
func SetGlobalDogstatsdAddr ¶
func SetGlobalHeaderTags ¶
func SetGlobalServiceName ¶
func SetPropagatingTag ¶
func SetPropagatingTag(t testing.TB, ctx *tracer.SpanContext, k, v string)
SetPropagatingTag sets a propagating tag on the given span context.
func SkipIfGoTip ¶
SkipIfGoTip skips t when the test binary is built with an unreleased ("devel") Go toolchain — e.g. the nightly gotip CI job — where unexported standard-library layout can drift ahead of released Go. On a released toolchain it is a no-op and the test proceeds.
runtime.Version() reports "devel go1.NN-<hash> <date>" for such toolchains, versus "go1.NN.P" for a release; the "devel" prefix is the sentinel.
The optional format/args are logged (like t.Logf) before the skip so call sites keep their diagnostics; the skip message always names the toolchain. Use it in place of a hard t.Fatal when an assertion depends on standard library internals that legitimately drift on tip.
func StartAppSec ¶
func StartAppSec(t *testing.T, opts ...config.StartOption)
func StartAppSecBench ¶
func StartTelemetryRecorder ¶ added in v2.7.0
func StartTelemetryRecorder(t *testing.T) *telemetrytest.RecordClient
StartTelemetryRecorder starts a new telemetry mock client and returns it.
Types ¶
type MockStatsdClient ¶
type MockStatsdClient = statsdtest.TestStatsdClient
func NewMockStatsdClient ¶
func NewMockStatsdClient() *MockStatsdClient