Skip to content

Commit

Permalink
Merge branch 'main' into updatecli_main_updatecli-update-beats-main
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Feb 3, 2025
2 parents 052ed1d + 90fccd9 commit b558428
Show file tree
Hide file tree
Showing 11 changed files with 15,011 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ jobs:
echo "BENCHMARK_RUN=${{ inputs.benchmarkRun }}" >> "$GITHUB_ENV"
fi
# exclude BenchmarkTraces* from scheduled benchmarks
- if: github.event_name == 'schedule'
run: |
echo "BENCHMARK_RUN=Benchmark[^T]" >> "$GITHUB_ENV"
- name: Log in to the Elastic Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,11 @@ SOFTWARE

--------------------------------------------------------------------------------
Dependency : github.com/elastic/elastic-agent-libs
Version: v0.18.3
Version: v0.18.4
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected].3/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected].4/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/elastic/apm-data v1.16.0
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250202231532-0e76511316f5
github.com/elastic/elastic-agent-client/v7 v7.17.0
github.com/elastic/elastic-agent-libs v0.18.3
github.com/elastic/elastic-agent-libs v0.18.4
github.com/elastic/elastic-agent-system-metrics v0.11.7
github.com/elastic/gmux v0.3.2
github.com/elastic/go-docappender/v2 v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ github.com/elastic/elastic-agent-autodiscover v0.9.0 h1:+iWIKh0u3e8I+CJa3FfWe9h0
github.com/elastic/elastic-agent-autodiscover v0.9.0/go.mod h1:5iUxLHhVdaGSWYTveSwfJEY4RqPXTG13LPiFoxcpFd4=
github.com/elastic/elastic-agent-client/v7 v7.17.0 h1:TPLrEHF4kJ3RkmQzZPffrniY4WeW4vriHZbOAzM1hFo=
github.com/elastic/elastic-agent-client/v7 v7.17.0/go.mod h1:6h+f9QdIr3GO2ODC0Y8+aEXRwzbA5W4eV4dd/67z7nI=
github.com/elastic/elastic-agent-libs v0.18.3 h1:bZ0e4Mrw7t6GnquTxzvZclGxZsUEIlsZNJPCPy2qO24=
github.com/elastic/elastic-agent-libs v0.18.3/go.mod h1:rWdyrrAFzZwgNNi41Tsqhlt2c2GdXWhCEwcsnqISJ2U=
github.com/elastic/elastic-agent-libs v0.18.4 h1:k1DeAzrrfRZ79Vjqo0ThvGR9JcDZUsdnfpmF9FgJ6Dk=
github.com/elastic/elastic-agent-libs v0.18.4/go.mod h1:rWdyrrAFzZwgNNi41Tsqhlt2c2GdXWhCEwcsnqISJ2U=
github.com/elastic/elastic-agent-system-metrics v0.11.7 h1:1xm2okCM0eQZ4jivZgUFSlt6HAn/nPgKB/Fj8eLG6mY=
github.com/elastic/elastic-agent-system-metrics v0.11.7/go.mod h1:nzkrGajQA29YNcfP62gfzhxX9an3/xdQ3RmfQNw9YTI=
github.com/elastic/elastic-transport-go/v8 v8.6.0 h1:Y2S/FBjx1LlCv5m6pWAF2kDJAHoSjSRSJCApolgfthA=
Expand Down
47 changes: 47 additions & 0 deletions systemtest/benchtest/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ package benchtest
import (
"context"
"crypto/tls"
"io/fs"
"net/url"
"path/filepath"
"testing"

"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
Expand Down Expand Up @@ -98,6 +100,8 @@ func NewOTLPExporter(tb testing.TB) *otlptrace.Exporter {

// NewEventHandler creates a eventhandler which loads the files matching the
// passed regex.
//
// It has to use loadgen.NewEventHandler as it has access to the private `events` FS Storage.
func NewEventHandler(tb testing.TB, p string, l *rate.Limiter) *eventhandler.Handler {
serverCfg := loadgencfg.Config
h, err := loadgen.NewEventHandler(loadgen.EventHandlerParams{
Expand All @@ -114,3 +118,46 @@ func NewEventHandler(tb testing.TB, p string, l *rate.Limiter) *eventhandler.Han
}
return h
}

// NewFSEventHandler creates an eventhandler which loads the files matching the
// passed regex in fs.
func NewFSEventHandler(tb testing.TB, p string, l *rate.Limiter, fs fs.FS) *eventhandler.Handler {
serverCfg := loadgencfg.Config
h, err := newFSEventHandler(loadgen.EventHandlerParams{
Path: p,
URL: serverCfg.ServerURL.String(),
Token: serverCfg.SecretToken,
Limiter: l,
RewriteIDs: serverCfg.RewriteIDs,
RewriteTimestamps: serverCfg.RewriteTimestamps,
Headers: serverCfg.Headers,
}, fs)
if err != nil {
tb.Fatal(err)
}
return h
}

func newFSEventHandler(p loadgen.EventHandlerParams, fs fs.FS) (*eventhandler.Handler, error) {
t, err := transport.NewHTTPTransport(transport.HTTPTransportOptions{})
if err != nil {
return nil, err
}
transp := eventhandler.NewTransport(t.Client, p.URL, p.Token, p.APIKey, p.Headers)
cfg := eventhandler.Config{
Path: filepath.Join("events", p.Path),
Transport: transp,
Storage: fs,
Limiter: p.Limiter,
Rand: p.Rand,
RewriteIDs: p.RewriteIDs,
RewriteServiceNames: p.RewriteServiceNames,
RewriteServiceNodeNames: p.RewriteServiceNodeNames,
RewriteServiceTargetNames: p.RewriteServiceTargetNames,
RewriteSpanNames: p.RewriteSpanNames,
RewriteTransactionNames: p.RewriteTransactionNames,
RewriteTransactionTypes: p.RewriteTransactionTypes,
RewriteTimestamps: p.RewriteTimestamps,
}
return eventhandler.New(cfg)
}
1 change: 1 addition & 0 deletions systemtest/cmd/apmbench/events/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These event files are the trace only versions of their counterparts in apm-perf, obtained by e.g. `grep -E '^{"span|^{"transaction|^{"meta' apm-python-6.7.2.ndjson > apm-python-traces-6.7.2.ndjson`. These sampled traces files are useful to benchmark tail-based sampling.
Loading

0 comments on commit b558428

Please sign in to comment.