Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: inge4pres <[email protected]>
Signed-off-by: Marc Lopez Rubio <[email protected]>
  • Loading branch information
inge4pres authored and marclop committed Jul 5, 2024
1 parent fda9b1c commit 09852ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 95 deletions.
32 changes: 0 additions & 32 deletions changelogs/head.asciidoc

This file was deleted.

63 changes: 3 additions & 60 deletions internal/beater/beater.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ import (
"runtime"
"time"

"github.com/dustin/go-humanize"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"go.elastic.co/apm/module/apmgrpc/v2"
"go.elastic.co/apm/module/apmotel/v2"
"go.elastic.co/apm/v2"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/sdk/metric"
"go.uber.org/zap"
Expand All @@ -41,6 +36,8 @@ import (
"google.golang.org/grpc"
_ "google.golang.org/grpc/encoding/gzip"

"github.com/elastic/apm-data/model/modelpb"
"github.com/elastic/apm-data/model/modelprocessor"
"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/esleg/eslegclient"
"github.com/elastic/beats/v7/libbeat/instrumentation"
Expand All @@ -52,11 +49,8 @@ import (
agentconfig "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/monitoring"
"github.com/elastic/go-docappender"
"github.com/elastic/go-ucfg"
docappender "github.com/elastic/go-docappender"

"github.com/elastic/apm-data/model/modelpb"
"github.com/elastic/apm-data/model/modelprocessor"
"github.com/elastic/apm-server/internal/agentcfg"
"github.com/elastic/apm-server/internal/beater/auth"
"github.com/elastic/apm-server/internal/beater/config"
Expand Down Expand Up @@ -667,67 +661,16 @@ func (s *Runner) newFinalBatchProcessor(
}
monitoring.NewString(outputRegistry, "name").Set("elasticsearch")

<<<<<<< HEAD
var esConfig struct {
*elasticsearch.Config `config:",inline"`
FlushBytes string `config:"flush_bytes"`
FlushInterval time.Duration `config:"flush_interval"`
MaxRequests int `config:"max_requests"`
Scaling struct {
Enabled *bool `config:"enabled"`
} `config:"autoscaling"`
}
esConfig.FlushInterval = time.Second
esConfig.Config = elasticsearch.DefaultConfig()
esConfig.MaxIdleConnsPerHost = 10
if err := s.elasticsearchOutputConfig.Unpack(&esConfig); err != nil {
return nil, nil, err
}

if esConfig.MaxRequests != 0 {
esConfig.MaxIdleConnsPerHost = esConfig.MaxRequests
}

var flushBytes int
if esConfig.FlushBytes != "" {
b, err := humanize.ParseBytes(esConfig.FlushBytes)
if err != nil {
return nil, nil, errors.Wrap(err, "failed to parse flush_bytes")
}
flushBytes = int(b)
}
minFlush := 24 * 1024
if esConfig.CompressionLevel != 0 && flushBytes < minFlush {
s.logger.Warnf("flush_bytes config value is too small (%d) and might be ignored by the indexer, increasing value to %d", flushBytes, minFlush)
flushBytes = minFlush
}
client, err := newElasticsearchClient(esConfig.Config)
=======
// Create the docappender and Elasticsearch config
appenderCfg, esCfg, err := s.newDocappenderConfig(tracer, memLimit)
>>>>>>> a453a8850 (fix: Update `FlushBytes` parsing/defaults (#13576))
if err != nil {
return nil, nil, err
}
client, err := newElasticsearchClient(esCfg)
if err != nil {
return nil, nil, err
}
<<<<<<< HEAD
opts := docappender.Config{
CompressionLevel: esConfig.CompressionLevel,
FlushBytes: flushBytes,
FlushInterval: esConfig.FlushInterval,
Tracer: tracer,
MaxRequests: esConfig.MaxRequests,
Scaling: scalingCfg,
Logger: zap.New(s.logger.Core(), zap.WithCaller(true)),
}
opts = docappenderConfig(opts, memLimit, s.logger)
appender, err := docappender.New(client, opts)
=======
appender, err := docappender.New(client, appenderCfg)
>>>>>>> a453a8850 (fix: Update `FlushBytes` parsing/defaults (#13576))
if err != nil {
return nil, nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/beater/beater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import (
"go.elastic.co/apm/v2/apmtest"
"go.uber.org/zap"

"github.com/elastic/apm-server/internal/beater/config"
"github.com/elastic/apm-server/internal/elasticsearch"
agentconfig "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/monitoring"
"github.com/elastic/go-docappender/v2"

"github.com/elastic/apm-server/internal/beater/config"
"github.com/elastic/apm-server/internal/elasticsearch"
)

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

0 comments on commit 09852ea

Please sign in to comment.