Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
404 changes: 229 additions & 175 deletions go.mod

Large diffs are not rendered by default.

1,043 changes: 573 additions & 470 deletions go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ func BenchmarkGzipProcessor_Concurrent(b *testing.B) {
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
_ = p.ConsumeLogs(context.Background(), logs)
logsCopy := plog.NewLogs()
logs.CopyTo(logsCopy)
_ = p.ConsumeLogs(context.Background(), logsCopy)
}
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ const Percentage = 100

type (
NginxLogScraper struct {
outChan <-chan []*entry.Entry
cfg *config.Config
settings receiver.Settings
logger *zap.Logger
mb *metadata.MetricsBuilder
rb *metadata.ResourceBuilder
pipes []*pipeline.DirectedPipeline
logger *zap.Logger
cfg *config.Config
wg *sync.WaitGroup
outChan <-chan []*entry.Entry
cancel context.CancelFunc
pipes []*pipeline.DirectedPipeline
entries []*entry.Entry
operators []operator.Config
settings receiver.Settings
mut sync.Mutex
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func (i *Input) Stop() error {
return i.fileConsumer.Stop()
}

func (i *Input) emit(ctx context.Context, tokens [][]byte, attributes map[string]any, lastRecordNumber int64) error {
func (i *Input) emit(
ctx context.Context, tokens [][]byte, attributes map[string]any, lastRecordNumber int64, offsets []int64,
) error {
for _, token := range tokens {
ent, err := i.NewEntry(i.toBody(token))
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package file

import (
"context"
"testing"

"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer"
Expand Down Expand Up @@ -37,10 +36,10 @@ func TestInput_emit(t *testing.T) {

token := []byte(accessLogLine)

err := input.emit(context.Background(), [][]byte{token}, map[string]any{"attribute1": "test"}, 1)
err := input.emit(t.Context(), [][]byte{token}, map[string]any{"attribute1": "test"}, 1, []int64{})
require.NoError(t, err)

// nil token check
err = input.emit(context.Background(), nil, map[string]any{"attribute1": "test"}, 1)
err = input.emit(t.Context(), nil, map[string]any{"attribute1": "test"}, 1, []int64{})
require.NoError(t, err)
}
8 changes: 4 additions & 4 deletions test/helpers/test_containers_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os"
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/build"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/testcontainers/testcontainers-go"
Expand Down Expand Up @@ -76,7 +76,7 @@ func StartContainer(
"IMAGE_PATH": ToPtr(imagePath),
"TAG": ToPtr(tag),
},
BuildOptionsModifier: func(buildOptions *types.ImageBuildOptions) {
BuildOptionsModifier: func(buildOptions *build.ImageBuildOptions) {
buildOptions.Target = buildTarget
},
},
Expand Down Expand Up @@ -154,7 +154,7 @@ func StartAgentlessContainer(
"IMAGE_PATH": ToPtr(imagePath),
"TAG": ToPtr(tag),
},
BuildOptionsModifier: func(buildOptions *types.ImageBuildOptions) {
BuildOptionsModifier: func(buildOptions *build.ImageBuildOptions) {
buildOptions.Target = "install-nginx"
},
},
Expand Down Expand Up @@ -215,7 +215,7 @@ func StartNginxLessContainer(
"IMAGE_PATH": ToPtr(imagePath),
"TAG": ToPtr(tag),
},
BuildOptionsModifier: func(buildOptions *types.ImageBuildOptions) {
BuildOptionsModifier: func(buildOptions *build.ImageBuildOptions) {
buildOptions.Target = buildTarget
},
},
Expand Down
Loading