Skip to content

Commit 69d7021

Browse files
committed
feat: AWSX-1566 Restoring fetch in the integration test to see metrics
Signed-off-by: Vincent Boutour <vincent.boutour@datadoghq.com>
1 parent c9ec9ae commit 69d7021

12 files changed

+307
-2
lines changed

aws/logs_monitoring/settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,16 @@ def __init__(self, name, pattern, placeholder, enabled=True):
256256
"DD_ENRICH_CLOUDWATCH_TAGS", default="true", boolean=True
257257
)
258258

259+
if DD_FETCH_S3_TAGS and DD_ENRICH_S3_TAGS:
260+
logger.warn(
261+
"Enabling both DD_FETCH_S3_TAGS and DD_ENRICH_S3_TAGS might be unwanted"
262+
)
263+
264+
if DD_FETCH_LOG_GROUP_TAGS and DD_ENRICH_CLOUDWATCH_TAGS:
265+
logger.warn(
266+
"Enabling both DD_FETCH_LOG_GROUP_TAGS and DD_ENRICH_CLOUDWATCH_TAGS might be unwanted"
267+
)
268+
259269

260270
def get_fetch_s3_tags():
261271
return DD_FETCH_S3_TAGS

aws/logs_monitoring/tools/build_bundle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ docker_build_zip() {
6464
# between different python runtimes.
6565
temp_dir=$(mktemp -d)
6666

67-
docker buildx build --platform linux/arm64 --file "${DIR}/Dockerfile_bundle" -t "datadog-bundle:$1" .. --no-cache --build-arg "runtime=${PYTHON_VERSION}"
67+
docker buildx build --platform linux/arm64 --file "${DIR}/Dockerfile_bundle" -t "datadog-bundle:$1" .. --no-cache --build-arg "runtime=${PYTHON_VERSION}"
6868

6969
# Run the image by runtime tag, tar its generated `python` directory to sdout,
7070
# then extract it to a temp directory.

aws/logs_monitoring/tools/integration_tests/integration_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SNAPS=($SNAPSHOT_DIR)
2121
ADDITIONAL_LAMBDA=false
2222
CACHE_TEST=false
2323
DD_FETCH_LAMBDA_TAGS="true"
24+
DD_FETCH_LOG_GROUP_TAGS="true"
2425
DD_FETCH_STEP_FUNCTIONS_TAGS="true"
2526

2627
script_start_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
@@ -37,7 +38,6 @@ for arg in "$@"; do
3738
shift
3839
;;
3940

40-
4141
# -u or --update
4242
# Update the snapshots to reflect this test run
4343
-u | --update)
@@ -152,6 +152,7 @@ LOG_LEVEL=${LOG_LEVEL} \
152152
AWS_ACCOUNT_ID=${AWS_ACCOUNT_ID} \
153153
SNAPSHOTS_DIR_NAME="./${SNAPSHOTS_DIR_NAME}" \
154154
DD_FETCH_LAMBDA_TAGS=${DD_FETCH_LAMBDA_TAGS} \
155+
DD_FETCH_LOG_GROUP_TAGS=${DD_FETCH_LOG_GROUP_TAGS} \
155156
DD_FETCH_STEP_FUNCTIONS_TAGS=${DD_FETCH_STEP_FUNCTIONS_TAGS} \
156157
docker compose up --build --abort-on-container-exit
157158

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_customized_log_group_lambda_invocation.json~snapshot

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,48 @@
9191
{
9292
"data": {
9393
"series": [
94+
{
95+
"device": null,
96+
"host": null,
97+
"interval": 10,
98+
"metric": "aws.dd_forwarder.loggroup_cache_fetch_failure",
99+
"points": "<redacted from snapshot>",
100+
"tags": [
101+
"forwardername:test_function",
102+
"forwarder_memorysize:3008",
103+
"forwarder_version:<redacted from snapshot>",
104+
"event_type:awslogs"
105+
],
106+
"type": "distribution"
107+
},
108+
{
109+
"device": null,
110+
"host": null,
111+
"interval": 10,
112+
"metric": "aws.dd_forwarder.list_tags_log_group_api_call",
113+
"points": "<redacted from snapshot>",
114+
"tags": [
115+
"forwardername:test_function",
116+
"forwarder_memorysize:3008",
117+
"forwarder_version:<redacted from snapshot>",
118+
"event_type:awslogs"
119+
],
120+
"type": "distribution"
121+
},
122+
{
123+
"device": null,
124+
"host": null,
125+
"interval": 10,
126+
"metric": "aws.dd_forwarder.loggroup_cache_write_failure",
127+
"points": "<redacted from snapshot>",
128+
"tags": [
129+
"forwardername:test_function",
130+
"forwarder_memorysize:3008",
131+
"forwarder_version:<redacted from snapshot>",
132+
"event_type:awslogs"
133+
],
134+
"type": "distribution"
135+
},
94136
{
95137
"device": null,
96138
"host": null,

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_log.json~snapshot

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,48 @@
6464
{
6565
"data": {
6666
"series": [
67+
{
68+
"device": null,
69+
"host": null,
70+
"interval": 10,
71+
"metric": "aws.dd_forwarder.loggroup_cache_fetch_failure",
72+
"points": "<redacted from snapshot>",
73+
"tags": [
74+
"forwardername:test_function",
75+
"forwarder_memorysize:3008",
76+
"forwarder_version:<redacted from snapshot>",
77+
"event_type:awslogs"
78+
],
79+
"type": "distribution"
80+
},
81+
{
82+
"device": null,
83+
"host": null,
84+
"interval": 10,
85+
"metric": "aws.dd_forwarder.list_tags_log_group_api_call",
86+
"points": "<redacted from snapshot>",
87+
"tags": [
88+
"forwardername:test_function",
89+
"forwarder_memorysize:3008",
90+
"forwarder_version:<redacted from snapshot>",
91+
"event_type:awslogs"
92+
],
93+
"type": "distribution"
94+
},
95+
{
96+
"device": null,
97+
"host": null,
98+
"interval": 10,
99+
"metric": "aws.dd_forwarder.loggroup_cache_write_failure",
100+
"points": "<redacted from snapshot>",
101+
"tags": [
102+
"forwardername:test_function",
103+
"forwarder_memorysize:3008",
104+
"forwarder_version:<redacted from snapshot>",
105+
"event_type:awslogs"
106+
],
107+
"type": "distribution"
108+
},
67109
{
68110
"device": null,
69111
"host": null,

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_log_cloudtrail.json~snapshot

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,48 @@
100100
{
101101
"data": {
102102
"series": [
103+
{
104+
"device": null,
105+
"host": null,
106+
"interval": 10,
107+
"metric": "aws.dd_forwarder.loggroup_cache_fetch_failure",
108+
"points": "<redacted from snapshot>",
109+
"tags": [
110+
"forwardername:test_function",
111+
"forwarder_memorysize:3008",
112+
"forwarder_version:<redacted from snapshot>",
113+
"event_type:awslogs"
114+
],
115+
"type": "distribution"
116+
},
117+
{
118+
"device": null,
119+
"host": null,
120+
"interval": 10,
121+
"metric": "aws.dd_forwarder.list_tags_log_group_api_call",
122+
"points": "<redacted from snapshot>",
123+
"tags": [
124+
"forwardername:test_function",
125+
"forwarder_memorysize:3008",
126+
"forwarder_version:<redacted from snapshot>",
127+
"event_type:awslogs"
128+
],
129+
"type": "distribution"
130+
},
131+
{
132+
"device": null,
133+
"host": null,
134+
"interval": 10,
135+
"metric": "aws.dd_forwarder.loggroup_cache_write_failure",
136+
"points": "<redacted from snapshot>",
137+
"tags": [
138+
"forwardername:test_function",
139+
"forwarder_memorysize:3008",
140+
"forwarder_version:<redacted from snapshot>",
141+
"event_type:awslogs"
142+
],
143+
"type": "distribution"
144+
},
103145
{
104146
"device": null,
105147
"host": null,

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_log_coldstart.json~snapshot

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,48 @@
33
{
44
"data": {
55
"series": [
6+
{
7+
"device": null,
8+
"host": null,
9+
"interval": 10,
10+
"metric": "aws.dd_forwarder.loggroup_cache_fetch_failure",
11+
"points": "<redacted from snapshot>",
12+
"tags": [
13+
"forwardername:test_function",
14+
"forwarder_memorysize:3008",
15+
"forwarder_version:<redacted from snapshot>",
16+
"event_type:awslogs"
17+
],
18+
"type": "distribution"
19+
},
20+
{
21+
"device": null,
22+
"host": null,
23+
"interval": 10,
24+
"metric": "aws.dd_forwarder.list_tags_log_group_api_call",
25+
"points": "<redacted from snapshot>",
26+
"tags": [
27+
"forwardername:test_function",
28+
"forwarder_memorysize:3008",
29+
"forwarder_version:<redacted from snapshot>",
30+
"event_type:awslogs"
31+
],
32+
"type": "distribution"
33+
},
34+
{
35+
"device": null,
36+
"host": null,
37+
"interval": 10,
38+
"metric": "aws.dd_forwarder.loggroup_cache_write_failure",
39+
"points": "<redacted from snapshot>",
40+
"tags": [
41+
"forwardername:test_function",
42+
"forwarder_memorysize:3008",
43+
"forwarder_version:<redacted from snapshot>",
44+
"event_type:awslogs"
45+
],
46+
"type": "distribution"
47+
},
648
{
749
"device": null,
850
"host": null,

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_log_custom_tags.json~snapshot

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@
4646
{
4747
"data": {
4848
"series": [
49+
{
50+
"device": null,
51+
"host": null,
52+
"interval": 10,
53+
"metric": "aws.dd_forwarder.loggroup_local_cache_hit",
54+
"points": "<redacted from snapshot>",
55+
"tags": [
56+
"forwardername:test_function",
57+
"forwarder_memorysize:3008",
58+
"forwarder_version:<redacted from snapshot>",
59+
"event_type:awslogs"
60+
],
61+
"type": "distribution"
62+
},
4963
{
5064
"device": null,
5165
"host": null,

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_log_lambda_invocation.json~snapshot

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,48 @@
718718
{
719719
"data": {
720720
"series": [
721+
{
722+
"device": null,
723+
"host": null,
724+
"interval": 10,
725+
"metric": "aws.dd_forwarder.loggroup_cache_fetch_failure",
726+
"points": "<redacted from snapshot>",
727+
"tags": [
728+
"forwardername:test_function",
729+
"forwarder_memorysize:3008",
730+
"forwarder_version:<redacted from snapshot>",
731+
"event_type:awslogs"
732+
],
733+
"type": "distribution"
734+
},
735+
{
736+
"device": null,
737+
"host": null,
738+
"interval": 10,
739+
"metric": "aws.dd_forwarder.list_tags_log_group_api_call",
740+
"points": "<redacted from snapshot>",
741+
"tags": [
742+
"forwardername:test_function",
743+
"forwarder_memorysize:3008",
744+
"forwarder_version:<redacted from snapshot>",
745+
"event_type:awslogs"
746+
],
747+
"type": "distribution"
748+
},
749+
{
750+
"device": null,
751+
"host": null,
752+
"interval": 10,
753+
"metric": "aws.dd_forwarder.loggroup_cache_write_failure",
754+
"points": "<redacted from snapshot>",
755+
"tags": [
756+
"forwardername:test_function",
757+
"forwarder_memorysize:3008",
758+
"forwarder_version:<redacted from snapshot>",
759+
"event_type:awslogs"
760+
],
761+
"type": "distribution"
762+
},
721763
{
722764
"device": null,
723765
"host": null,

aws/logs_monitoring/tools/integration_tests/snapshots/cloudwatch_log_service_tag.json~snapshot

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@
4646
{
4747
"data": {
4848
"series": [
49+
{
50+
"device": null,
51+
"host": null,
52+
"interval": 10,
53+
"metric": "aws.dd_forwarder.loggroup_local_cache_hit",
54+
"points": "<redacted from snapshot>",
55+
"tags": [
56+
"forwardername:test_function",
57+
"forwarder_memorysize:3008",
58+
"forwarder_version:<redacted from snapshot>",
59+
"event_type:awslogs"
60+
],
61+
"type": "distribution"
62+
},
4963
{
5064
"device": null,
5165
"host": null,

0 commit comments

Comments
 (0)