Skip to content

Commit 03b2ccd

Browse files
matthewfalaPettitWesley
authored andcommittedMay 3, 2022
Add retry_limit to firelens logConfiguration options
Signed-off-by: Matthew Fala <[email protected]>
1 parent 72f016d commit 03b2ccd

File tree

36 files changed

+135
-97
lines changed

36 files changed

+135
-97
lines changed
 

‎examples/fluent-bit/add-keys/task-definition.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,18 @@
3030
}
3131
],
3232
"memoryReservation": 50
33-
},
34-
{
33+
},
34+
{
3535
"essential": true,
3636
"image": "httpd",
3737
"name": "app",
3838
"logConfiguration": {
3939
"logDriver":"awsfirelens",
4040
"options": {
41-
"Name": "firehose",
41+
"Name": "kinesis_firehose",
4242
"region": "us-west-2",
43-
"delivery_stream": "my-stream"
43+
"delivery_stream": "my-stream",
44+
"retry_limit": "2"
4445
}
4546
},
4647
"memoryReservation": 100

‎examples/fluent-bit/amazon-opensearch/task-definition.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
}
2121
},
2222
"memoryReservation": 50
23-
},
24-
{
23+
},
24+
{
2525
"essential": true,
2626
"image": "nginx",
2727
"name": "app",
@@ -35,7 +35,8 @@
3535
"Type": "my_type",
3636
"Aws_Auth": "On",
3737
"Aws_Region": "us-west-2",
38-
"tls": "On"
38+
"tls": "On",
39+
"retry_limit": "2"
3940
}
4041
},
4142
"memoryReservation": 100

‎examples/fluent-bit/cloudwatchlogs/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ By default, FireLens will send a JSON event with the raw log line encapsulated i
1515
"log_key": "log",
1616
"log_group_name": "/aws/ecs/containerinsights/$(ecs_cluster)/application",
1717
"auto_create_group": "true",
18-
"log_stream_name": "$(ecs_task_id)"
18+
"log_stream_name": "$(ecs_task_id)",
19+
"retry_limit": "2"
1920
}
2021
},
2122
```

‎examples/fluent-bit/cloudwatchlogs/task-definition.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@
2020
}
2121
},
2222
"memoryReservation": 50
23-
},
24-
{
23+
},
24+
{
2525
"essential": true,
2626
"image": "nginx",
2727
"name": "app",
2828
"logConfiguration": {
29-
"logDriver":"awsfirelens",
30-
"options": {
29+
"logDriver":"awsfirelens",
30+
"options": {
3131
"Name": "cloudwatch",
3232
"region": "us-west-2",
3333
"log_group_name": "/aws/ecs/containerinsights/$(ecs_cluster)/application",
3434
"auto_create_group": "true",
35-
"log_stream_name": "$(ecs_task_id)"
35+
"log_stream_name": "$(ecs_task_id)",
36+
"retry_limit": "2"
3637
}
3738
},
3839
"memoryReservation": 100

‎examples/fluent-bit/config-file-type-file/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"options": {
4141
"Name": "firehose",
4242
"region": "us-west-2",
43-
"delivery_stream": "my-stream"
43+
"delivery_stream": "my-stream",
44+
"retry_limit": "2"
4445
}
4546
},
4647
"memoryReservation": 100

‎examples/fluent-bit/datadog/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ AWS recommends that you store sensitive information, like your Datadog API Key u
1717
"dd_service": "my-httpd-service",
1818
"dd_source": "httpd",
1919
"dd_tags": "project:example",
20-
"provider": "ecs"
20+
"provider": "ecs",
21+
"retry_limit": "2"
2122
}
2223
},
2324
```

‎examples/fluent-bit/datadog/task-definition.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
"image": "httpd",
2121
"name": "app",
2222
"logConfiguration": {
23-
"logDriver":"awsfirelens",
24-
"options": {
23+
"logDriver":"awsfirelens",
24+
"options": {
2525
"Name": "datadog",
2626
"Host": "http-intake.logs.datadoghq.com",
2727
"TLS": "on",
2828
"dd_service": "my-httpd-service",
2929
"dd_source": "httpd",
3030
"dd_tags": "project:example",
31-
"provider": "ecs"
31+
"provider": "ecs",
32+
"retry_limit": "2"
3233
},
3334
"secretOptions": [{
3435
"name": "apikey",

‎examples/fluent-bit/ecs-log-collection/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ First, we create our Fluent Bit configuration file:
4747
log_group_name firelens-tutorial-$(ecs_cluster)
4848
log_stream_name /logs/app/$(ec2_instance_id)-$(ecs_task_id)
4949
auto_create_group true
50+
retry_limit 2
5051
5152
# Output for the file logs
5253
[OUTPUT]
@@ -56,6 +57,7 @@ First, we create our Fluent Bit configuration file:
5657
log_group_name firelens-tutorial-$(ecs_cluster)
5758
log_stream_name /logs/service/$(ec2_instance_id)-$(ecs_task_id)
5859
auto_create_group true
60+
retry_limit 2
5961
```
6062

6163
With this output, you will get all of your logs in a single log group with log stream names that tell you whether they came from stdout or the service log file. All log streams will have the EC2 instance ID and ECS Task ID. You can of course modify these patterns to suit your own needs.
@@ -100,6 +102,7 @@ If you wish to run on Fargate, then use the Fluent Bit configuration below which
100102
log_group_name firelens-tutorial-$(ecs_cluster)
101103
log_stream_name /logs/app/$(ecs_task_id)
102104
auto_create_group true
105+
retry_limit 2
103106
104107
# Output for the file logs
105108
[OUTPUT]
@@ -109,6 +112,7 @@ If you wish to run on Fargate, then use the Fluent Bit configuration below which
109112
log_group_name firelens-tutorial-$(ecs_cluster)
110113
log_stream_name /logs/service/$(ecs_task_id)
111114
auto_create_group true
115+
retry_limit 2
112116
```
113117

114118
Finally, with Fargate you can not store your configuration file in S3. You must bake it into a custom Fluent Bit image. Instructions can be found in the [tutorial in this repo](https://github.com/aws-samples/amazon-ecs-firelens-examples/tree/mainline/examples/fluent-bit/config-file-type-file).
@@ -148,6 +152,7 @@ Your Fluent Bit configuration file should look like the following:
148152
log_group_name firelens-tutorial-$(ecs_cluster)
149153
log_stream_name /logs/$(ec2_instance_id)-$(ecs_task_id)
150154
auto_create_group true
155+
retry_limit 2
151156
```
152157

153158
Upload this file to S3 and reference it in your FireLens configuration:

‎examples/fluent-bit/ecs-log-collection/task-definition-tail.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
"memoryReservation": 50
3333
},
3434
{
35-
"essential": true,
36-
"image": "my-app:latest",
37-
"name": "app",
38-
"mountPoints" : [
35+
"essential": true,
36+
"image": "my-app:latest",
37+
"name": "app",
38+
"mountPoints": [
3939
{
40-
"containerPath" : "/var/log/",
41-
"sourceVolume" : "var-log"
40+
"containerPath": "/var/log/",
41+
"sourceVolume": "var-log"
4242
}
4343
],
44-
"logConfiguration": {
45-
"logDriver":"awsfirelens",
44+
"logConfiguration": {
45+
"logDriver":"awsfirelens"
4646
},
4747
"memoryReservation": 100
4848
}

‎examples/fluent-bit/ecs-log-collection/task-definition-tcp.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
}
2525
},
2626
"memoryReservation": 50
27-
},
28-
{
29-
"essential": true,
30-
"image": "my-app:latest",
31-
"name": "app",
32-
"logConfiguration": {
33-
"logDriver":"awsfirelens",
27+
},
28+
{
29+
"essential": true,
30+
"image": "my-app:latest",
31+
"name": "app",
32+
"logConfiguration": {
33+
"logDriver":"awsfirelens"
3434
},
3535
"memoryReservation": 100
3636
}

‎examples/fluent-bit/efs/extra.conf

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
Name kinesis_firehose
33
Match *
44
region us-east-1
5-
delivery_stream my-stream
5+
delivery_stream my-stream
6+
retry_limit 2

‎examples/fluent-bit/elastic-cloud/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ This is optional; it is also valid to simply specify the Cloud_Auth in options m
1616
"Cloud_Auth": "<elasticsearch_username>:<elasticsearch_password>",
1717
"Index": "elastic_firelens",
1818
"tls": "On",
19-
"tls.verify": "Off"
19+
"tls.verify": "Off",
20+
"retry_limit": "2"
2021
}
2122
},
2223
```
@@ -34,7 +35,8 @@ This is optional; you can also use regular Elasticsearch credentials to connect
3435
"HTTP_Passwd": "<elasticsearch_password>",
3536
"Index": "elastic_firelens",
3637
"tls": "On",
37-
"tls.verify": "Off"
38+
"tls.verify": "Off",
39+
"retry_limit": "2"
3840
}
3941
},
4042
```

‎examples/fluent-bit/elastic-cloud/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"Cloud_ID": "<elastic_cloud_id>",
5151
"Index": "elastic_firelens",
5252
"tls": "On",
53-
"tls.verify": "Off"
53+
"tls.verify": "Off",
54+
"retry_limit": "2"
5455
}
5556
},
5657
"memoryReservation": 100

‎examples/fluent-bit/enable-debug-logging/task-definition.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@
2727
}
2828
},
2929
"memoryReservation": 50
30-
},
31-
{
32-
"essential": true,
33-
"image": "nginx",
34-
"name": "app",
35-
"logConfiguration": {
36-
"logDriver":"awsfirelens",
37-
"options": {
30+
},
31+
{
32+
"essential": true,
33+
"image": "nginx",
34+
"name": "app",
35+
"logConfiguration": {
36+
"logDriver":"awsfirelens",
37+
"options": {
3838
"Name": "cloudwatch",
3939
"region": "us-west-2",
4040
"log_group_name": "firelens-fluent-bit",
4141
"auto_create_group": "true",
42-
"log_stream_prefix": "from-fluent-bit"
42+
"log_stream_prefix": "from-fluent-bit",
43+
"retry_limit": "2"
4344
}
4445
},
4546
"memoryReservation": 100

‎examples/fluent-bit/filter-multiline/task-definition.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@
2626
"memoryReservation": 50
2727
},
2828
{
29-
"essential": true,
30-
"image": "111111111111.dkr.ecr.us-west-2.amazonaws.com/multiline-example-app:latest",
31-
"name": "app",
32-
"logConfiguration": {
33-
"logDriver":"awsfirelens",
34-
"options": {
29+
"essential": true,
30+
"image": "111111111111.dkr.ecr.us-west-2.amazonaws.com/multiline-example-app:latest",
31+
"name": "app",
32+
"logConfiguration": {
33+
"logDriver":"awsfirelens",
34+
"options": {
3535
"Name": "cloudwatch_logs",
3636
"region": "us-west-2",
3737
"log_group_name": "multiline-test/application",
3838
"auto_create_group": "true",
39-
"log_stream_prefix": "multiline-"
39+
"log_stream_prefix": "multiline-",
40+
"retry_limit": "2"
4041
}
4142
},
4243
"memoryReservation": 100

‎examples/fluent-bit/forward-to-aggregator/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"options": {
3030
"Name": "forward",
3131
"Host": "fluentdhost",
32-
"Port": "24224"
32+
"Port": "24224",
33+
"Retry_Limit": "2"
3334
}
3435
},
3536
"memoryReservation": 100

‎examples/fluent-bit/kinesis-firehose/task-definition.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
}
2121
},
2222
"memoryReservation": 50
23-
},
24-
{
23+
},
24+
{
2525
"essential": true,
2626
"image": "httpd",
2727
"name": "app",
@@ -30,7 +30,8 @@
3030
"options": {
3131
"Name": "firehose",
3232
"region": "us-west-2",
33-
"delivery_stream": "my-stream"
33+
"delivery_stream": "my-stream",
34+
"retry_limit": "2"
3435
}
3536
},
3637
"memoryReservation": 100

‎examples/fluent-bit/kinesis-stream/task-definition.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
}
2121
},
2222
"memoryReservation": 50
23-
},
24-
{
23+
},
24+
{
2525
"essential": true,
2626
"image": "httpd",
2727
"name": "app",
@@ -30,7 +30,8 @@
3030
"options": {
3131
"Name": "kinesis_streams",
3232
"region": "us-west-2",
33-
"stream": "my-data-stream"
33+
"stream": "my-data-stream",
34+
"retry_limit": "2"
3435
}
3536
},
3637
"memoryReservation": 100

‎examples/fluent-bit/log-driver-buffer-limit/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ By default, the buffer limit will be set to `1MiB`. In order to increase or decr
2222
"log_group_name": "/aws/ecs/containerinsights/$(ecs_cluster)/application",
2323
"auto_create_group": "true",
2424
"log_stream_name": "$(ecs_task_id)",
25-
"log-driver-buffer-limit": "2097152"
25+
"log-driver-buffer-limit": "2097152",
26+
"retry_limit": "2"
2627
}
2728
},
2829
```

‎examples/fluent-bit/log-driver-buffer-limit/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"log_group_name": "/aws/ecs/containerinsights/$(ecs_cluster)/application",
3434
"auto_create_group": "true",
3535
"log_stream_name": "$(ecs_task_id)",
36-
"log-driver-buffer-limit": "2097152"
36+
"log-driver-buffer-limit": "2097152",
37+
"retry_limit": "2"
3738
}
3839
},
3940
"memoryReservation": 100

‎examples/fluent-bit/logstash/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ AWS recommands that you store sensitive information (like the URI containing som
3838
"URI": "/some/<token>/tag/<tag>/",
3939
"Port": "8090",
4040
"Format": "json",
41+
"Retry_Limit": "2"
4142
}
4243
}
4344
```

‎examples/fluent-bit/logstash/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"Name":"http",
2929
"Host":"api.logstash.fake.domain",
3030
"Port":"8090",
31-
"Format":"json"
31+
"Format":"json",
32+
"Retry_Limit": "2"
3233
},
3334
"secretOptions":[
3435
{

‎examples/fluent-bit/newrelic/example-task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"logConfiguration": {
3131
"logDriver": "awsfirelens",
3232
"options": {
33-
"Name": "newrelic"
33+
"Name": "newrelic",
34+
"Retry_Limit": "2"
3435
},
3536
"secretOptions": [
3637
{

‎examples/fluent-bit/parse-common-log-formats/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"options": {
3535
"Name": "firehose",
3636
"region": "us-west-2",
37-
"delivery_stream": "my-stream"
37+
"delivery_stream": "my-stream",
38+
"retry_limit": "2"
3839
}
3940
},
4041
"memoryReservation": 100

‎examples/fluent-bit/parse-envoy-app-mesh/appmesh-firelens-colorteller-black-ecs-task-def.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@
113113
"region": "us-east-1",
114114
"log_group_name": "appmesh-firelens",
115115
"auto_create_group": "true",
116-
"log_stream_prefix": "envoy-black-"
116+
"log_stream_prefix": "envoy-black-",
117+
"retry_limit": "2"
117118
}
118119
},
119120
"healthCheck": {

‎examples/fluent-bit/parse-json/task-definition.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@
2424
}
2525
},
2626
"memoryReservation": 50
27-
},
28-
{
29-
"essential": true,
30-
"image": "httpd",
31-
"name": "app",
32-
"logConfiguration": {
33-
"logDriver":"awsfirelens",
34-
"options": {
27+
},
28+
{
29+
"essential": true,
30+
"image": "httpd",
31+
"name": "app",
32+
"logConfiguration": {
33+
"logDriver":"awsfirelens",
34+
"options": {
3535
"Name": "firehose",
3636
"region": "us-west-2",
37-
"delivery_stream": "my-stream"
37+
"delivery_stream": "my-stream",
38+
"retry_limit": "2"
3839
}
3940
},
4041
"memoryReservation": 100

‎examples/fluent-bit/s3/task-definition.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@
2020
}
2121
},
2222
"memoryReservation": 50
23-
},
24-
{
25-
"essential": true,
26-
"image": "httpd",
27-
"name": "app",
28-
"logConfiguration": {
29-
"logDriver":"awsfirelens",
30-
"options": {
23+
},
24+
{
25+
"essential": true,
26+
"image": "httpd",
27+
"name": "app",
28+
"logConfiguration": {
29+
"logDriver":"awsfirelens",
30+
"options": {
3131
"Name": "s3",
3232
"region": "us-west-2",
3333
"bucket": "your-bucket",
3434
"total_file_size": "1M",
3535
"upload_timeout": "1m",
36-
"use_put_object": "On"
36+
"use_put_object": "On",
37+
"retry_limit": "2"
3738
}
3839
},
3940
"memoryReservation": 100

‎examples/fluent-bit/sematext/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ AWS recommends that you store sensitive information, like your Sematext `LOGS_TO
1616
"Port": "443",
1717
"TLS": "on",
1818
"Format": "json",
19-
"compress": "gzip"
19+
"Compress": "gzip",
20+
"Retry_Limit": "2"
2021
}
2122
},
2223
```

‎examples/fluent-bit/sematext/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"Port": "443",
3030
"TLS": "on",
3131
"Format": "json",
32-
"compress": "gzip"
32+
"compress": "gzip",
33+
"retry_limit": "2"
3334
},
3435
"secretOptions": [{
3536
"name": "URI",

‎examples/fluent-bit/send-fb-internal-metrics-to-cw/extra.conf

+1
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@
5454
log_group_name ${FLUENT_BIT_METRICS_LOG_GROUP}
5555
log_stream_name ${HOSTNAME}-fb-metrics-prom-format
5656
auto_create_group On
57+
retry_limit 2

‎examples/fluent-bit/send-to-multiple-destinations/extra.conf

+2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
Match *
44
region us-west-2
55
delivery_stream stream-one
6+
retry_limit 2
67

78
[OUTPUT]
89
Name firehose
910
Match *
1011
region us-west-2
1112
delivery_stream stream-two
13+
retry_limit 2

‎examples/fluent-bit/send-to-multiple-destinations/task-definition.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
}
2525
},
2626
"memoryReservation": 50
27-
},
28-
{
29-
"essential": true,
30-
"image": "httpd",
31-
"name": "app",
32-
"logConfiguration": {
33-
"logDriver":"awsfirelens"
27+
},
28+
{
29+
"essential": true,
30+
"image": "httpd",
31+
"name": "app",
32+
"logConfiguration": {
33+
"logDriver":"awsfirelens"
3434
},
3535
"memoryReservation": 100
3636
}

‎examples/fluent-bit/signalfx/task-definition.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"Name": "SignalFx",
2626
"MetricName": "com.firelens.example",
2727
"MetricType": "counter",
28-
"Dimensions": "ecs_cluster, container_name"
28+
"Dimensions": "ecs_cluster, container_name",
29+
"Retry_Limit": "2"
2930
},
3031
"secretOptions": {
3132
"name": "Token",

‎examples/fluent-bit/sumologic/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ AWS recommends that you store sensitive information (like your Sumologic URI) us
1414
"Port": "443",
1515
"tls": "on",
1616
"tls.verify": "off",
17-
"Format": "json_lines"
17+
"Format": "json_lines",
18+
"Retry_Limit": "2"
1819
}
1920
}
2021
```

‎examples/splitting-log-streams/fluent-bit/custom-fluent-bit-image/fluent-bit.conf

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
log_group_name streams-example
1717
log_stream_prefix log-level-
1818
auto_create_group true
19+
retry_limit 2

‎examples/splitting-log-streams/fluent-bit/task_definition.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
}
3232
},
3333
"memoryReservation": 100
34-
},
35-
{
34+
},
35+
{
3636
"essential": true,
3737
"image": "012345678910.dkr.ecr.ap-south-1.amazonaws.com/multi-streams-logger:latest",
3838
"name": "app",

0 commit comments

Comments
 (0)
Please sign in to comment.