Skip to content

Commit

Permalink
Merge branch 'master' into add-timeout-env-for-esrollover
Browse files Browse the repository at this point in the history
  • Loading branch information
albertteoh authored May 16, 2021
2 parents 7e88f41 + ae47c0e commit 866befb
Show file tree
Hide file tree
Showing 70 changed files with 10,103 additions and 1,898 deletions.
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ updates:
schedule:
interval: daily

- package-ecosystem: gomod
directory: "/v2"
schedule:
interval: daily

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
60 changes: 0 additions & 60 deletions .github/mergify.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci-all-in-one-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
all-in-one:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
task: build-binaries-ppc64le
name: build binaries for ${{ matrix.platform.name }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
cassandra:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4

- uses: actions/setup-go@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-crossdock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
cmd: bash scripts/build-crossdock.sh
name: ${{ matrix.steps.name }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
docker-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
image: 7.3.0
name: elasticsearch ${{ matrix.version.major }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-hotrod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
hotrod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
kafka:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4

- uses: actions/setup-go@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-memory-badger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
memory-badger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4

- uses: actions/setup-go@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-protogen-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
protogen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
submodules: true

Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
if: steps.build-binaries.outcome == 'success'

- name: Upload binaries
uses: svenstaro/upload-release-action@v2
uses: svenstaro/upload-release-action@2.2.1
with:
file: deploy/*.tar.gz
file_glob: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4

- uses: actions/setup-go@v2
with:
Expand All @@ -23,7 +23,7 @@ jobs:
run: make test-ci

- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v1.5.0
with:
file: cover.out
fail_ci_if_error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4

- uses: actions/setup-go@v2
with:
Expand All @@ -23,7 +23,7 @@ jobs:
echo "$GOPATH/bin" >>"$GITHUB_PATH"
- name: Run FOSSA scan and upload report
uses: fossa-contrib/fossa-action@v1
uses: fossa-contrib/fossa-action@v1.1.4
with:
# FOSSA Push-Only API Token
fossa-api-key: 304657e2357ba57b416b94e6b119131b
Expand Down
25 changes: 24 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@ jaeger-ui/packages/jaeger-ui/build/index.html:
cd jaeger-ui && yarn install --frozen-lockfile && cd packages/jaeger-ui && yarn build

cmd/query/app/ui/actual/gen_assets.go: jaeger-ui/packages/jaeger-ui/build/index.html
esc -pkg assets -o cmd/query/app/ui/actual/gen_assets.go -prefix jaeger-ui/packages/jaeger-ui/build jaeger-ui/packages/jaeger-ui/build
@if ! command -v esc > /dev/null 2>&1 ; then \
echo "esc: Command not found" ; \
echo "Check:" ; \
echo "- esc is installed: 'make install-tools'" ; \
echo "- add \$$GOPATH into \$$PATH: 'export PATH=\$$PATH:\$$(go env GOPATH)/bin'" ; \
false ; \
fi
esc -pkg assets -o cmd/query/app/ui/actual/gen_assets.go -prefix jaeger-ui/packages/jaeger-ui/build jaeger-ui/packages/jaeger-ui/build ; \

.PHONY: build-all-in-one-linux
build-all-in-one-linux:
Expand Down Expand Up @@ -451,6 +458,7 @@ echo-version:
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${JAEGER_DOCKER_PROTOBUF} --proto_path=${PWD}
PROTO_INCLUDES := \
-Iidl/proto/api_v2 \
-Imodel/proto/metrics \
-I/usr/include/github.com/gogo/protobuf
# Remapping of std types to gogo types (must not contain spaces)
PROTO_GOGO_MAPPINGS := $(shell echo \
Expand Down Expand Up @@ -495,6 +503,21 @@ proto:
idl/proto/api_v2/query.proto
### --swagger_out=allow_merge=true:$(PWD)/proto-gen/openapi/ \
$(PROTOC) \
$(PROTO_INCLUDES) \
--gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/api_v2/metrics \
model/proto/metrics/otelspankind.proto

$(PROTOC) \
$(PROTO_INCLUDES) \
--gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/api_v2/metrics \
model/proto/metrics/otelmetric.proto

$(PROTOC) \
$(PROTO_INCLUDES) \
--gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/api_v2/metrics \
model/proto/metrics/metricsquery.proto

$(PROTOC) \
$(PROTO_INCLUDES) \
--gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/api_v2 \
Expand Down
4 changes: 2 additions & 2 deletions cmd/collector/app/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ func (options) QueueSize(queueSize int) Option {
}
}

// DynQueueSize creates an Option that initializes the queue size
// DynQueueSizeWarmup creates an Option that initializes the dynamic queue size
func (options) DynQueueSizeWarmup(dynQueueSizeWarmup uint) Option {
return func(b *options) {
b.dynQueueSizeWarmup = dynQueueSizeWarmup
}
}

// DynQueueSize creates an Option that initializes the queue size
// DynQueueSizeMemory creates an Option that initializes the dynamic queue memory
func (options) DynQueueSizeMemory(dynQueueSizeMemory uint) Option {
return func(b *options) {
b.dynQueueSizeMemory = dynQueueSizeMemory
Expand Down
31 changes: 19 additions & 12 deletions cmd/esmapping-generator/app/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ import (

// Options represent configurable parameters for jaeger-esmapping-generator
type Options struct {
Mapping string
EsVersion uint
Shards int64
Replicas int64
IndexPrefix string
UseILM string // using string as util is being used in python and using bool leads to type issues.
Mapping string
EsVersion uint
Shards int64
Replicas int64
IndexPrefix string
UseILM string // using string as util is being used in python and using bool leads to type issues.
ILMPolicyName string
}

const (
mappingFlag = "mapping"
esVersionFlag = "es-version"
shardsFlag = "shards"
replicasFlag = "replicas"
indexPrefixFlag = "index-prefix"
useILMFlag = "use-ilm"
mappingFlag = "mapping"
esVersionFlag = "es-version"
shardsFlag = "shards"
replicasFlag = "replicas"
indexPrefixFlag = "index-prefix"
useILMFlag = "use-ilm"
ilmPolicyNameFlag = "ilm-policy-name"
)

// AddFlags adds flags for esmapping-generator main program
Expand Down Expand Up @@ -69,6 +71,11 @@ func (o *Options) AddFlags(command *cobra.Command) {
useILMFlag,
"false",
"Set to true to use ILM for managing lifecycle of jaeger indices")
command.Flags().StringVar(
&o.ILMPolicyName,
ilmPolicyNameFlag,
"jaeger-ilm-policy",
"The name of the ILM policy to use if ILM is active")

// mark mapping flag as mandatory
command.MarkFlagRequired(mappingFlag)
Expand Down
3 changes: 3 additions & 0 deletions cmd/esmapping-generator/app/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestOptionsWithDefaultFlags(t *testing.T) {
assert.Equal(t, int64(1), o.Replicas)
assert.Equal(t, "", o.IndexPrefix)
assert.Equal(t, "false", o.UseILM)
assert.Equal(t, "jaeger-ilm-policy", o.ILMPolicyName)
}

func TestOptionsWithFlags(t *testing.T) {
Expand All @@ -47,6 +48,7 @@ func TestOptionsWithFlags(t *testing.T) {
"--replicas=1",
"--index-prefix=test",
"--use-ilm=true",
"--ilm-policy-name=jaeger-test-policy",
})
require.NoError(t, err)
assert.Equal(t, "jaeger-span", o.Mapping)
Expand All @@ -55,4 +57,5 @@ func TestOptionsWithFlags(t *testing.T) {
assert.Equal(t, int64(1), o.Replicas)
assert.Equal(t, "test", o.IndexPrefix)
assert.Equal(t, "true", o.UseILM)
assert.Equal(t, "jaeger-test-policy", o.ILMPolicyName)
}
1 change: 1 addition & 0 deletions cmd/esmapping-generator/app/renderer/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func GetMappingAsString(builder es.TemplateBuilder, opt *app.Options) (string, e
EsVersion: opt.EsVersion,
IndexPrefix: opt.IndexPrefix,
UseILM: enableILM,
ILMPolicyName: opt.ILMPolicyName,
}
return mappingBuilder.GetMapping(opt.Mapping)
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/esmapping-generator/app/renderer/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ func Test_getMappingAsString(t *testing.T) {
wantErr error
}{
{
name: "ES version 7", args: app.Options{Mapping: "jaeger-span", EsVersion: 7, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "true"},
name: "ES version 7", args: app.Options{Mapping: "jaeger-span", EsVersion: 7, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "true", ILMPolicyName: "jaeger-test-policy"},
want: "ES version 7",
},
{
name: "ES version 6", args: app.Options{Mapping: "jaeger-span", EsVersion: 6, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "false"},
name: "ES version 6", args: app.Options{Mapping: "jaeger-span", EsVersion: 6, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "false", ILMPolicyName: "jaeger-test-policy"},
want: "ES version 6",
},
{
name: "Parse Error version 6", args: app.Options{Mapping: "jaeger-span", EsVersion: 6, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "false"},
name: "Parse Error version 6", args: app.Options{Mapping: "jaeger-span", EsVersion: 6, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "false", ILMPolicyName: "jaeger-test-policy"},
wantErr: errors.New("parse error"),
},
{
name: "Parse Error version 7", args: app.Options{Mapping: "jaeger-span", EsVersion: 7, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "true"},
name: "Parse Error version 7", args: app.Options{Mapping: "jaeger-span", EsVersion: 7, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "true", ILMPolicyName: "jaeger-test-policy"},
wantErr: errors.New("parse error"),
},
{
name: "Parse bool error", args: app.Options{Mapping: "jaeger-span", EsVersion: 7, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "foo"},
name: "Parse bool error", args: app.Options{Mapping: "jaeger-span", EsVersion: 7, Shards: 5, Replicas: 1, IndexPrefix: "test", UseILM: "foo", ILMPolicyName: "jaeger-test-policy"},
wantErr: errors.New("strconv.ParseBool: parsing \"foo\": invalid syntax"),
},
}
Expand Down
Loading

0 comments on commit 866befb

Please sign in to comment.