Skip to content

Commit

Permalink
Merge branch 'main' into spm
Browse files Browse the repository at this point in the history
Signed-off-by: Raghuram Kannan <[email protected]>
  • Loading branch information
FlamingSaint authored Jul 20, 2024
2 parents 7d4ee8e + b2aded6 commit bae9e39
Show file tree
Hide file tree
Showing 61 changed files with 1,698 additions and 558 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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,25 @@ jobs:
- name: Export BRANCH variable
uses: ./.github/actions/setup-branch

- name: Install tools
run: make install-ci

- uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0

- name: Define BUILD_FLAGS var if running on a Pull Request
run: |
case ${GITHUB_EVENT_NAME} in
pull_request)
echo "BUILD_FLAGS=-l -p linux/amd64" >> ${GITHUB_ENV}
;;
*)
echo "BUILD_FLAGS=" >> ${GITHUB_ENV}
;;
esac
- name: Build, test, and publish hotrod image
run: bash scripts/hotrod-integration-test.sh
run: bash scripts/hotrod-integration-test.sh ${{ env.BUILD_FLAGS }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Print logs from hotrod
run: docker logs example-hotrod
run: docker compose -f ./examples/hotrod/docker-compose.yml logs
if: failure()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/ci-e2e-memory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CIT Memory

on:
push:
branches: [main]

pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
cancel-in-progress: true

# See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
memory-v2:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x

- name: Run Memory storage integration tests
run: |
STORAGE=memory_v2 make jaeger-v2-storage-integration-test
- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
with:
files: cover.out
flags: memory_v2
File renamed without changes.
File renamed without changes.
95 changes: 0 additions & 95 deletions .github/workflows/ci-release-testing.yml

This file was deleted.

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
File renamed without changes.
35 changes: 25 additions & 10 deletions cmd/jaeger/config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
service:
extensions: [jaeger_storage, jaeger_query]
extensions: [jaeger_storage, jaeger_query, remote_sampling]
pipelines:
traces:
receivers: [otlp, jaeger, zipkin]
processors: [batch]
processors: [batch, adaptive_sampling]
exporters: [jaeger_storage_exporter]

extensions:
Expand All @@ -14,16 +14,28 @@ 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: some_store
initial_sampling_probability: 0.1
http:
grpc:

receivers:
otlp:
Expand All @@ -42,7 +54,10 @@ receivers:

processors:
batch:
# Adaptive Sampling Processor is required to support adaptive sampling.
# It expects remote_sampling extension with `adaptive:` config to be enabled.
adaptive_sampling:

exporters:
jaeger_storage_exporter:
trace_storage: memstore
trace_storage: some_store
6 changes: 4 additions & 2 deletions cmd/jaeger/internal/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import (
"github.com/jaegertracing/jaeger/cmd/jaeger/internal/exporters/storageexporter"
"github.com/jaegertracing/jaeger/cmd/jaeger/internal/extension/jaegerquery"
"github.com/jaegertracing/jaeger/cmd/jaeger/internal/extension/jaegerstorage"
"github.com/jaegertracing/jaeger/cmd/jaeger/internal/extension/remotesampling"
"github.com/jaegertracing/jaeger/cmd/jaeger/internal/integration/storagecleaner"
"github.com/jaegertracing/jaeger/cmd/jaeger/internal/processors/adaptivesampling"
)

type builders struct {
Expand Down Expand Up @@ -63,7 +65,7 @@ func (b builders) build() (otelcol.Factories, error) {
jaegerquery.NewFactory(),
jaegerstorage.NewFactory(),
storagecleaner.NewFactory(),
// TODO add adaptive sampling
remotesampling.NewFactory(),
)
if err != nil {
return otelcol.Factories{}, err
Expand Down Expand Up @@ -101,7 +103,7 @@ func (b builders) build() (otelcol.Factories, error) {
batchprocessor.NewFactory(),
memorylimiterprocessor.NewFactory(),
// add-ons
// TODO add adaptive sampling
adaptivesampling.NewFactory(),
)
if err != nil {
return otelcol.Factories{}, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,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 @@ -108,27 +109,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 @@ -142,9 +122,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 @@ -279,7 +257,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
2 changes: 1 addition & 1 deletion cmd/jaeger/internal/extension/jaegerstorage/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func GetStorageFactory(name string, host component.Host) (storage.Factory, error
f, ok := comp.(Extension).Factory(name)
if !ok {
return nil, fmt.Errorf(
"cannot find storage '%s' declared by '%s' extension",
"cannot find definition of storage '%s' in the configuration for extension '%s'",
name, componentType,
)
}
Expand Down
Loading

0 comments on commit bae9e39

Please sign in to comment.