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

[CI][WIP] Scrape metrics at the end of e2e test #6330

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9e51b06
script to scrape metrics
chahatsagarmain Dec 9, 2024
cf2ee87
minor change
chahatsagarmain Dec 9, 2024
3472d1e
fix dir path
chahatsagarmain Dec 9, 2024
1c12682
add metric upload to each test and changes in the scrape script
chahatsagarmain Dec 9, 2024
d5ae8f5
minor changes
chahatsagarmain Dec 11, 2024
5170c8e
changes
chahatsagarmain Dec 13, 2024
a3d3252
shell lint
chahatsagarmain Dec 13, 2024
b0ef4d4
minor changes
chahatsagarmain Dec 14, 2024
2244ea9
reviewed changes
chahatsagarmain Dec 15, 2024
283bc5c
added cache save
chahatsagarmain Dec 28, 2024
0152cb2
Merge branch 'main' into e2e-metrics
chahatsagarmain Dec 28, 2024
6adf944
fixes
chahatsagarmain Dec 28, 2024
c6703b6
add schema in key
chahatsagarmain Dec 28, 2024
adbe80f
test ci
chahatsagarmain Dec 28, 2024
d46316b
test ci
chahatsagarmain Dec 29, 2024
0da4dbb
minor changes
chahatsagarmain Dec 29, 2024
a479e7f
test ci with fixed expression
chahatsagarmain Dec 29, 2024
519104e
shared action and a happy new yar
chahatsagarmain Jan 1, 2025
23ba35f
minor fixes
chahatsagarmain Jan 1, 2025
b620f09
shared action
chahatsagarmain Jan 2, 2025
15c775b
Merge branch 'main' into e2e-metrics
chahatsagarmain Jan 2, 2025
07fdbec
add shell property
chahatsagarmain Jan 2, 2025
7f3fe77
compare metrics
chahatsagarmain Jan 3, 2025
8c81c82
fix path
chahatsagarmain Jan 3, 2025
a76bcde
fix compare
chahatsagarmain Jan 3, 2025
2b27c95
minor changes
chahatsagarmain Jan 3, 2025
77ed741
compare metrics using python libraries
chahatsagarmain Jan 4, 2025
22e97a2
check path
chahatsagarmain Jan 4, 2025
8da8a07
resolved comments
chahatsagarmain Jan 4, 2025
90464e2
use simple unified diff
chahatsagarmain Jan 4, 2025
19835c4
exit cases
chahatsagarmain Jan 4, 2025
63a64f3
simplified action
chahatsagarmain Jan 4, 2025
0a1787f
exit case
chahatsagarmain Jan 4, 2025
b30dad5
fetch tags after checkout
chahatsagarmain Jan 4, 2025
d81694e
changes
chahatsagarmain Jan 6, 2025
6f5355c
exit code
chahatsagarmain Jan 6, 2025
1bdb77f
print diff
chahatsagarmain Jan 6, 2025
157822d
minor changes
chahatsagarmain Jan 6, 2025
2ea739b
added comment
chahatsagarmain Jan 7, 2025
20514ab
test
chahatsagarmain Jan 7, 2025
8d92555
fetch depth 0
chahatsagarmain Jan 7, 2025
a7f2b67
changes
chahatsagarmain Jan 7, 2025
1b16c35
Merge branch 'main' into e2e-metrics
chahatsagarmain Jan 7, 2025
ef56c4e
Merge branch 'main' into e2e-metrics
chahatsagarmain Jan 9, 2025
b93d66d
cummulative diff
chahatsagarmain Jan 9, 2025
e51bb3e
Merge branch 'e2e-metrics' of https://github.com/chahatsagarmain/jaeg…
chahatsagarmain Jan 9, 2025
41693c5
minor changes
chahatsagarmain Jan 11, 2025
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
4 changes: 0 additions & 4 deletions .github/workflows/ci-e2e-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,3 @@ jobs:
opensearch:
uses: ./.github/workflows/ci-e2e-opensearch.yml





yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions .github/workflows/ci-e2e-badger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ jobs:
STORAGE=badger make jaeger-v2-storage-integration-test
;;
esac

- name: Upload Metrics Artifact
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/upload-artifact@v4
if: ${{ matrix.version }} == "v2"
with:
name: badger-metrics-${{ matrix.version }}
path: ./metrics/badger_metrics.txt
retention-days: 7
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-e2e-cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:
run: bash scripts/cassandra-integration-test.sh ${{ matrix.version.major }} ${{ matrix.version.schema }} ${{ matrix.jaeger-version }}
env:
SKIP_APPLY_SCHEMA: ${{ matrix.create-schema == 'auto' && true || false }}

- name: Upload Metrics Artifact
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/upload-artifact@v4
if: ${{ matrix.jaeger-version }} == "v2"
with:
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
name: cassandra_metrics_${{ matrix.version.major }}_${{ matrix.version.schema }}_${{ matrix.jaeger-version }}
path: ./metrics/cassandra_metrics.txt
retention-days: 7

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci-e2e-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ jobs:
- name: Run ${{ matrix.version.distribution }} integration tests
id: test-execution
run: bash scripts/es-integration-test.sh ${{ matrix.version.distribution }} ${{ matrix.version.major }} ${{ matrix.version.jaeger }}


- name: Upload Metrics Artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.version.jaeger }} == "v2"
with:
name: elasticsearch-metrics-${{ matrix.version.major }}_${{ matrix.version.jaeger}}
path: ./metrics/elasticsearch_metrics.txt
retention-days: 7

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-e2e-grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ jobs:
STORAGE=grpc SPAN_STORAGE_TYPE=memory make jaeger-v2-storage-integration-test
;;
esac

- name: Upload Metrics Artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.version }} == "v2"
with:
name: grpc-metrics-${{ matrix.version }}
path: ./metrics/grpc_metrics.txt
retention-days: 7

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-e2e-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ jobs:
- name: Run Kafka integration tests
id: test-execution
run: bash scripts/kafka-integration-test.sh -j ${{ matrix.jaeger-version }}

- name: Upload Metrics Artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.jaeger-version }} == "v2"
with:
name: kafka-metrics-${{ matrix.jaeger-version }}
path: ./metrics/kafka_metrics.txt
retention-days: 7

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci-e2e-memory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ jobs:
- name: Run Memory storage integration tests
run: |
STORAGE=memory_v2 make jaeger-v2-storage-integration-test


- name: Upload Metrics Artifact
uses: actions/upload-artifact@v4
with:
name: memory-metrics
path: ./metrics/memory_metrics.txt
retention-days: 7

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-e2e-opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jobs:
id: test-execution
run: bash scripts/es-integration-test.sh ${{ matrix.version.distribution }} ${{ matrix.version.major }} ${{ matrix.version.jaeger }}

- name: Upload Metrics Artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.version.major }} == "v2"
with:
name: opensearch-metrics-${{ matrix.version.jaeger }}
path: ./metrics/opensearch_metrics.txt
retention-days: 7

- name: Upload coverage to codecov
uses: ./.github/actions/upload-codecov
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ sha256sum.combined.txt
resource.syso
.gocache
test-results.json
metrics/
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 25 additions & 0 deletions cmd/jaeger/internal/integration/e2e_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (s *E2EStorageIntegration) e2eInitialize(t *testing.T, storage string) {
require.NoError(t, err)

t.Cleanup(func() {
scrapeMetrics(t, storage)
// Call e2eCleanUp to close the SpanReader and SpanWriter gRPC connection.
s.e2eCleanUp(t)
})
Expand Down Expand Up @@ -211,6 +212,30 @@ func (s *E2EStorageIntegration) e2eCleanUp(t *testing.T) {
require.NoError(t, s.SpanWriter.(io.Closer).Close())
}

func scrapeMetrics(t *testing.T, storage string) {
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://localhost:8888/metrics", nil)
require.NoError(t, err)

client := &http.Client{}
resp, err := client.Do(req)
require.NoError(t, err)
defer resp.Body.Close()

err = os.MkdirAll("../../../../metrics", os.ModePerm)
if err != nil {
t.Fatalf("Failed to create directory: %v", err)
}
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

metricsFile, err := os.Create(fmt.Sprintf("../../../../metrics/%v_metrics.txt", storage))
if err != nil {
t.Fatalf("Failed to create metrics file: %v", err)
}
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
defer metricsFile.Close()

_, err = io.Copy(metricsFile, resp.Body)
require.NoError(t, err)
}

func createStorageCleanerConfig(t *testing.T, configFile string, storage string) string {
data, err := os.ReadFile(configFile)
require.NoError(t, err)
Expand Down
Loading