Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable SPM in Jaeger v2 #5681

Merged
merged 71 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6ed4f23
Create setup for enabling SPM in v2
FlamingSaint Jun 26, 2024
dc85461
Add connector to the config and add suggested changes to the Makefile
FlamingSaint Jun 27, 2024
e5d9850
Add integration test for SPM v2
FlamingSaint Jun 27, 2024
1bf0ece
fix
FlamingSaint Jun 27, 2024
8ba9818
Add suggested changes
FlamingSaint Jun 28, 2024
6f61680
Add suggested changes
FlamingSaint Jun 28, 2024
ff42224
fix CI
FlamingSaint Jun 28, 2024
0dbda14
Add changes
FlamingSaint Jun 28, 2024
591fda9
fix
FlamingSaint Jun 28, 2024
31ffea5
Add quotes
FlamingSaint Jun 28, 2024
ea0d5ec
Fix CI
FlamingSaint Jun 28, 2024
fb4b0ce
Add prometheusexporter to components.go
FlamingSaint Jun 28, 2024
231e397
Merge branch 'main' into spm
FlamingSaint Jul 3, 2024
6f42591
fix conflicts
FlamingSaint Jul 3, 2024
0cb5f7a
Use microsim v0.4.1 in docker-compose-v2.yml
FlamingSaint Jul 3, 2024
91987df
Added suggested changes and ran go mod tidy
FlamingSaint Jul 3, 2024
c49e322
Merge branch 'main' into spm
FlamingSaint Jul 3, 2024
43b2e72
Add back the endpoint
FlamingSaint Jul 3, 2024
5e9d0e4
Merge branch 'main' into spm
FlamingSaint Jul 3, 2024
977c9d1
Merge branch 'main' into spm
FlamingSaint Jul 3, 2024
e926e8a
Merge branch 'jaegertracing:main' into spm
FlamingSaint Jul 6, 2024
4ba0ad0
Add config for metrics_storage
FlamingSaint Jul 6, 2024
5675055
Separate TracesBackend and MetricsBackend
FlamingSaint Jul 6, 2024
6479836
Add suggested change
FlamingSaint Jul 6, 2024
14b94fe
Initialize the metrics storage in extensions.go
FlamingSaint Jul 7, 2024
c986181
Use singular naming
FlamingSaint Jul 8, 2024
5c5d701
fix naming
FlamingSaint Jul 8, 2024
21ea847
Add config options for prometheus
FlamingSaint Jul 8, 2024
1b6c9ca
Merge branch 'main' into spm
FlamingSaint Jul 8, 2024
118c8fb
Merge branch 'main' into spm
FlamingSaint Jul 8, 2024
44f2627
Resolve conflicts
FlamingSaint Jul 8, 2024
be42117
initialize metrics storage in extension.go
FlamingSaint Jul 8, 2024
c872291
Add changes
FlamingSaint Jul 8, 2024
85442e8
fix
FlamingSaint Jul 8, 2024
865d2ee
Add changes
FlamingSaint Jul 9, 2024
c6abf8b
WIP: Passed metric storage to the query service
FlamingSaint Jul 14, 2024
21f66f9
Merge branch 'main' into spm
FlamingSaint Jul 14, 2024
fa04c99
Use telset.logger instead of logger
FlamingSaint Jul 14, 2024
636191b
fix: generate mocks
FlamingSaint Jul 14, 2024
c39f8ec
Use Initialize instead of InitializeMetricsFactory
FlamingSaint Jul 14, 2024
f871540
Remove comments
FlamingSaint Jul 14, 2024
78ca11f
fix
FlamingSaint Jul 14, 2024
ed90e30
add changes
FlamingSaint Jul 14, 2024
7d4ee8e
resolve conflicts
FlamingSaint Jul 20, 2024
bae9e39
Merge branch 'main' into spm
FlamingSaint Jul 20, 2024
90176e2
Simplify
yurishkuro Jul 20, 2024
3a937b3
Simplify
yurishkuro Jul 20, 2024
f9bf6ba
Clean-up
yurishkuro Jul 20, 2024
176c332
fix
yurishkuro Jul 20, 2024
50e312c
Clean-up
yurishkuro Jul 20, 2024
f105bc9
fix
yurishkuro Jul 20, 2024
0cdb5ca
Fixes
yurishkuro Jul 20, 2024
db32afe
missed the file
yurishkuro Jul 20, 2024
2034502
Catch-all via wildcard
yurishkuro Jul 20, 2024
9d2f9b2
DRY code, rename public methods to be more consistent
yurishkuro Jul 20, 2024
4f87e23
Add changes
FlamingSaint Jul 21, 2024
7da08f3
Merge branch 'main' into spm
FlamingSaint Jul 22, 2024
0aefd7b
Increase code coverage
FlamingSaint Jul 22, 2024
81bc142
fix lint
FlamingSaint Jul 22, 2024
2e36abe
fix
FlamingSaint Jul 22, 2024
060740b
Increase coverage
FlamingSaint Jul 22, 2024
8f0ee2b
Increase coverage
FlamingSaint Jul 22, 2024
b17125a
Add changes
FlamingSaint Jul 23, 2024
f7a749e
fix
FlamingSaint Jul 23, 2024
64afe89
Merge branch 'main' into spm
FlamingSaint Jul 23, 2024
0301e64
fix
FlamingSaint Jul 24, 2024
4c51ab2
Remove extra spaces
FlamingSaint Jul 24, 2024
96649c9
Increase code coverage
FlamingSaint Jul 24, 2024
032a860
Increase code cov
FlamingSaint Jul 24, 2024
3ec5360
Increase code cov
FlamingSaint Jul 24, 2024
d641e36
Add changes
FlamingSaint Jul 24, 2024
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
16 changes: 11 additions & 5 deletions .github/workflows/ci-build-spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ permissions:
jobs:
spm:
runs-on: ubuntu-latest
strategy:
matrix:
mode:
- name: v1
binary: all-in-one
- name: v2
binary: jaeger

steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
Expand All @@ -40,9 +48,7 @@ jobs:
uses: ./.github/actions/setup-node.js

- name: Temporary - only run the build
run:
cd docker-compose/monitor && make build

run: cd docker-compose/monitor && make build BINARY=${{ matrix.mode.binary }}
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved

- name: Run SPM Test
run: ./scripts/spm-integration-test.sh

run: bash scripts/spm-integration-test.sh -b ${{ matrix.mode.binary }}
16 changes: 12 additions & 4 deletions docker-compose/monitor/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
BINARY ?= all-in-one # Default value uses v1 binary

.PHONY: build
build: clean-jaeger
cd ../../ && make build-all-in-one-linux
cd ../../ && make build-$(BINARY) GOOS=linux
cd ../../ && make create-baseimg PLATFORMS=linux/$(shell go env GOARCH)
cd ../../ && docker buildx build --target release \
--tag jaegertracing/all-in-one:dev \
--tag jaegertracing/$(BINARY):dev \
--build-arg base_image=localhost:5000/baseimg_alpine:latest \
--build-arg debug_image=not-used \
--build-arg TARGETARCH=$(shell go env GOARCH) \
--load \
cmd/all-in-one
cmd/$(BINARY)

# starts up the system required for SPM using the latest otel image and a development jaeger image.
# Note: the jaeger "dev" image can be built with "make build".
.PHONY: dev
dev: export JAEGER_IMAGE_TAG = dev
dev:
dev:
docker compose -f docker-compose.yml up $(DOCKER_COMPOSE_ARGS)

.PHONY: dev-v2
dev-v2: export JAEGER_IMAGE_TAG = dev
dev-v2: export BINARY = jaeger
dev-v2: build
docker compose -f docker-compose-v2.yml up $(DOCKER_COMPOSE_ARGS)

.PHONY: clean-jaeger
clean-jaeger:
# Also cleans up intermediate cached containers.
Expand Down
53 changes: 53 additions & 0 deletions docker-compose/monitor/docker-compose-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: "3.5"
services:
jaeger:
networks:
- backend
image: jaegertracing/jaeger:${JAEGER_IMAGE_TAG:-latest}
volumes:
- "./jaeger-ui.json:/etc/jaeger/jaeger-ui.json" # Do we need this for v2 ? Seems to be running without this.
- "./jaeger-v2-config.yml:/etc/jaeger/jaeger-v2-config.yml"
command: ["--config", "/etc/jaeger/jaeger-v2-config.yml"]
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
environment:
- METRICS_STORAGE_TYPE=prometheus
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
- PROMETHEUS_SERVER_URL=http://prometheus:9090
# - PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR=${PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR:-true}
- PROMETHEUS_QUERY_NAMESPACE=${PROMETHEUS_QUERY_NAMESPACE:-}
- PROMETHEUS_QUERY_DURATION_UNIT=${PROMETHEUS_QUERY_DURATION_UNIT:-}
- PROMETHEUS_QUERY_NORMALIZE_CALLS=true
- PROMETHEUS_QUERY_NORMALIZE_DURATION=true
ports:
- "16686:16686"
- "14278:14278"
microsim:
networks:
- backend
image: yurishkuro/microsim:0.3.0
# TODO: Fix error - dial tcp [::1]:14278: connect: connection refused
command: "-j http://localhost:14278/api/traces -d 24h -s 500ms"
depends_on:
- jaeger
prometheus:
networks:
- backend
image: prom/prometheus:latest
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
grafana:
networks:
- backend
image: grafana/grafana:latest
volumes:
- ./grafana.ini:/etc/grafana/grafana.ini
- ./datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- 3000:3000

networks:
backend:
42 changes: 42 additions & 0 deletions docker-compose/monitor/jaeger-v2-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
service:
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
extensions: [jaeger_storage, jaeger_query]
pipelines:
traces:
receivers: [otlp, jaeger]
processors: [batch]
exporters: [jaeger_storage_exporter, spanmetrics]
metrics/spanmetrics:
receivers: [spanmetrics]
exporters: [prometheus]


extensions:
jaeger_query:
trace_storage: memstore

jaeger_storage:
memory:
memstore:
max_traces: 100000

connectors:
spanmetrics:

receivers:
otlp:
protocols:
grpc:
http:

jaeger:
FlamingSaint marked this conversation as resolved.
Show resolved Hide resolved
protocols:
grpc:

processors:
batch:

exporters:
jaeger_storage_exporter:
trace_storage: memstore
prometheus:
endpoint: "0.0.0.0:8889"
30 changes: 29 additions & 1 deletion scripts/spm-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@

set -euf -o pipefail

print_help() {
echo "Usage: $0 [-b binary]"
echo "-b: Which binary to build: 'all-in-one' (default) or 'jaeger' (v2)"
echo "-h: Print help"
exit 1
}

BINARY='all-in-one'
compose_file=docker-compose/monitor/docker-compose.yml

while getopts "b:h" opt; do
case "${opt}" in
b)
BINARY=${OPTARG}
;;
?)
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
print_help
;;
esac
done

if [ "$BINARY" == "jaeger" ]; then
compose_file=docker-compose/monitor/docker-compose-v2.yml
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
fi

timeout=300
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
end_time=$((SECONDS + timeout))
success="false"
Expand Down Expand Up @@ -115,7 +139,11 @@ teardown_services() {
}

main() {
(cd docker-compose/monitor && make build && make dev DOCKER_COMPOSE_ARGS="-d")
if [ "$BINARY" == "jaeger" ]; then
(cd docker-compose/monitor && make build BINARY="$BINARY" && make dev-v2 DOCKER_COMPOSE_ARGS="-d")
else
(cd docker-compose/monitor && make build BINARY="$BINARY" && make dev DOCKER_COMPOSE_ARGS="-d")
fi
wait_for_services
check_spm
success="true"
Expand Down
Loading