Skip to content

Commit a34110c

Browse files
authored
[OTel] Add E2E to ensure data consistency in Logstash Exporter (#46721)
Add E2E TestDataShapeOTelVSClassicE2E for Logstash Exporter to compare the data shape of filebeat vs otel mode
1 parent 2d5086e commit a34110c

File tree

3 files changed

+456
-0
lines changed

3 files changed

+456
-0
lines changed

x-pack/filebeat/docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,33 @@ services:
5757
- http-server
5858
- --addr=:8090
5959
- --config=/files/config.yaml
60+
61+
init-logstash:
62+
image: busybox:latest
63+
user: "0:0"
64+
command: ["sh", "-c", "chown -R 1000:1000 /data"]
65+
volumes:
66+
- logstash_testdata:/data
67+
restart: "no"
68+
logstash:
69+
depends_on:
70+
- init-logstash
71+
extends:
72+
file: ${ES_BEATS}/testing/environments/${STACK_ENVIRONMENT}.yml
73+
service: logstash
74+
volumes:
75+
- ./tests/integration/logstash/config/pipelines.yml:/usr/share/logstash/config/pipelines.yml
76+
- logstash_testdata:/usr/share/logstash/testdata
77+
ports:
78+
- 9600:9600
79+
nginx:
80+
image: nginx:alpine
81+
depends_on:
82+
- init-logstash
83+
volumes:
84+
- logstash_testdata:/usr/share/nginx/html:ro
85+
ports:
86+
- 8082:80
87+
88+
volumes:
89+
logstash_testdata:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# `@metadata` is an internal field in Logstash, so we need to rename it to `metadata`
2+
# in order for it to be visible for comparison
3+
- pipeline.id: fb_classic
4+
pipeline.workers: 1
5+
pipeline.ordered: true
6+
config.string: |
7+
input {
8+
beats {
9+
port => "5044"
10+
enrich => "none"
11+
}
12+
}
13+
filter {
14+
mutate {
15+
rename => ["@metadata", "metadata"]
16+
}
17+
}
18+
output {
19+
file {
20+
path => "/usr/share/logstash/testdata/%{testcase}_fb.json"
21+
}
22+
}
23+
- pipeline.id: fb_otel
24+
pipeline.workers: 1
25+
pipeline.ordered: true
26+
config.string: |
27+
input {
28+
beats {
29+
port => "5055"
30+
enrich => "none"
31+
}
32+
}
33+
filter {
34+
mutate {
35+
rename => ["@metadata", "metadata"]
36+
}
37+
}
38+
output {
39+
file {
40+
path => "/usr/share/logstash/testdata/%{testcase}_otel.json"
41+
}
42+
}

0 commit comments

Comments
 (0)