Skip to content

Commit

Permalink
Merge branch 'main' into hotrod
Browse files Browse the repository at this point in the history
  • Loading branch information
hellspawn679 authored Jul 15, 2024
2 parents 9996f30 + 8d2aab6 commit c214dcb
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 92 deletions.
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ updates:
interval: daily
labels: [ "changelog:dependencies" ]

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels: [ "changelog:dependencies" ]

- package-ecosystem: docker
directories:
- /cmd/agent
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-release-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Generate SBOM
uses: anchore/sbom-action@95b086ac308035dc0850b3853be5b7ab108236a8 # v0.16.1
uses: anchore/sbom-action@d94f46e13c6c62f59525ac9a1e147a99dc0b9bf5 # v0.17.0
with:
output-file: jaeger-SBOM.spdx.json
upload-release-assets: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Generate SBOM
uses: anchore/sbom-action@95b086ac308035dc0850b3853be5b7ab108236a8 # v0.16.1
uses: anchore/sbom-action@d94f46e13c6c62f59525ac9a1e147a99dc0b9bf5 # v0.17.0
with:
output-file: jaeger-SBOM.spdx.json
upload-release-assets: false
Expand Down
20 changes: 11 additions & 9 deletions cmd/jaeger/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@ extensions:
# endpoint: 0.0.0.0:55679

jaeger_query:
trace_storage: memstore
trace_storage_archive: memstore_archive
trace_storage: some_store
trace_storage_archive: another_store
ui_config: ./cmd/jaeger/config-ui.json

jaeger_storage:
memory:
memstore:
max_traces: 100000
memstore_archive:
max_traces: 100000
backends:
some_store:
memory:
max_traces: 100000
another_store:
memory:
max_traces: 100000

remote_sampling:
# You can either use file or adaptive sampling strategy in remote_sampling
# file:
# path: ./cmd/jaeger/sampling-strategies.json
adaptive:
sampling_store: memstore
sampling_store: some_store
initial_sampling_probability: 0.1
http:
grpc:
Expand Down Expand Up @@ -58,4 +60,4 @@ processors:

exporters:
jaeger_storage_exporter:
trace_storage: memstore
trace_storage: some_store
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ func TestExporter(t *testing.T) {

host := makeStorageExtension(t, memstoreName)

err = tracesExporter.Start(ctx, host)
require.NoError(t, err)
require.NoError(t, tracesExporter.Start(ctx, host))
defer func() {
require.NoError(t, tracesExporter.Shutdown(ctx))
}()
Expand Down
28 changes: 3 additions & 25 deletions cmd/jaeger/internal/extension/jaegerquery/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"
"time"

"github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/storagetest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
Expand Down Expand Up @@ -80,27 +81,6 @@ func (fakeStorageExt) Shutdown(context.Context) error {
return nil
}

type storageHost struct {
extension component.Component
}

func (storageHost) ReportFatalError(error) {
}

func (host storageHost) GetExtensions() map[component.ID]component.Component {
return map[component.ID]component.Component{
jaegerstorage.ID: host.extension,
}
}

func (storageHost) GetFactory(_ component.Kind, _ component.Type) component.Factory {
return nil
}

func (storageHost) GetExporters() map[component.DataType]map[component.ID]component.Component {
return nil
}

func TestServerDependencies(t *testing.T) {
expectedDependencies := []component.ID{jaegerstorage.ID}
telemetrySettings := component.TelemetrySettings{
Expand All @@ -114,9 +94,7 @@ func TestServerDependencies(t *testing.T) {
}

func TestServerStart(t *testing.T) {
host := storageHost{
extension: fakeStorageExt{},
}
host := storagetest.NewStorageHost().WithExtension(jaegerstorage.ID, fakeStorageExt{})
tests := []struct {
name string
config *Config
Expand Down Expand Up @@ -251,7 +229,7 @@ func TestServerAddArchiveStorage(t *testing.T) {
}
server := newServer(tt.config, telemetrySettings)
if tt.extension != nil {
host = storageHost{extension: tt.extension}
host = storagetest.NewStorageHost().WithExtension(jaegerstorage.ID, tt.extension)
}
err := server.addArchiveStorage(tt.qSvcOpts, host)
if tt.expectedErr == "" {
Expand Down
25 changes: 3 additions & 22 deletions cmd/jaeger/internal/extension/jaegerstorage/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net/http/httptest"
"testing"

"github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/storagetest"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
Expand All @@ -31,26 +32,6 @@ import (
"github.com/jaegertracing/jaeger/storage/spanstore"
)

type storageHost struct {
t *testing.T
ext component.Component
}

func (host storageHost) GetExtensions() map[component.ID]component.Component {
return map[component.ID]component.Component{
ID: host.ext,
}
}

func (host storageHost) ReportFatalError(err error) {
host.t.Fatal(err)
}

func (storageHost) GetFactory(_ component.Kind, _ component.Type) component.Factory { return nil }
func (storageHost) GetExporters() map[component.DataType]map[component.ID]component.Component {
return nil
}

type errorFactory struct {
closeErr error
}
Expand Down Expand Up @@ -81,7 +62,7 @@ func TestStorageFactoryBadHostError(t *testing.T) {
}

func TestStorageFactoryBadNameError(t *testing.T) {
host := storageHost{t: t, ext: startStorageExtension(t, "foo")}
host := storagetest.NewStorageHost().WithExtension(ID, startStorageExtension(t, "foo"))
_, err := GetStorageFactory("bar", host)
require.ErrorContains(t, err, "cannot find definition of storage 'bar'")
}
Expand All @@ -105,7 +86,7 @@ func TestGetFactoryV2Error(t *testing.T) {

func TestGetFactory(t *testing.T) {
const name = "foo"
host := storageHost{t: t, ext: startStorageExtension(t, name)}
host := storagetest.NewStorageHost().WithExtension(ID, startStorageExtension(t, name))
f, err := GetStorageFactory(name, host)
require.NoError(t, err)
require.NotNil(t, f)
Expand Down
27 changes: 3 additions & 24 deletions cmd/jaeger/internal/processors/adaptivesampling/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,6 @@ import (
"github.com/jaegertracing/jaeger/plugin/storage/memory"
)

type samplingHost struct {
t *testing.T
samplingExtension component.Component
}

func (host samplingHost) GetExtensions() map[component.ID]component.Component {
return map[component.ID]component.Component{
remotesampling.ID: host.samplingExtension,
}
}

func (host samplingHost) ReportFatalError(err error) {
host.t.Fatal(err)
}

func (samplingHost) GetFactory(_ component.Kind, _ component.Type) component.Factory { return nil }
func (samplingHost) GetExporters() map[component.DataType]map[component.ID]component.Component {
return nil
}

func makeStorageExtension(t *testing.T, memstoreName string) component.Host {
telemetrySettings := component.TelemetrySettings{
Logger: zaptest.NewLogger(t),
Expand Down Expand Up @@ -74,7 +54,7 @@ func makeStorageExtension(t *testing.T, memstoreName string) component.Host {

var _ component.Config = (*Config)(nil)

func makeRemoteSamplingExtension(t *testing.T, cfg component.Config) samplingHost {
func makeRemoteSamplingExtension(t *testing.T, cfg component.Config) component.Host {
extensionFactory := remotesampling.NewFactory()
samplingExtension, err := extensionFactory.CreateExtension(
context.Background(),
Expand All @@ -87,7 +67,7 @@ func makeRemoteSamplingExtension(t *testing.T, cfg component.Config) samplingHos
cfg,
)
require.NoError(t, err)
host := samplingHost{t: t, samplingExtension: samplingExtension}
host := storagetest.NewStorageHost().WithExtension(remotesampling.ID, samplingExtension)
storageHost := makeStorageExtension(t, "foobar")

err = samplingExtension.Start(context.Background(), storageHost)
Expand Down Expand Up @@ -148,9 +128,8 @@ func makeTracesOneSpan() ptrace.Traces {
}

func TestGetAdaptiveSamplingComponentsError(t *testing.T) {
host := &samplingHost{}
processor := &traceProcessor{}
err := processor.start(context.Background(), host)
err := processor.start(context.Background(), storagetest.NewStorageHost())
require.ErrorContains(t, err, "cannot load adaptive sampling components")
}

Expand Down
5 changes: 3 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
},
{
"matchManagers": ["github-actions"],
"groupName": "github-actions deps"
"groupName": "github-actions deps",
"schedule": ["on the first day of the month"]
},
{
"matchManagers": ["github-actions"],
"matchUpdateTypes": ["major", "patch", "digest"],
"matchUpdateTypes": ["patch", "digest"],
"enabled": false
},
{
Expand Down

0 comments on commit c214dcb

Please sign in to comment.