@@ -183,13 +183,13 @@ static int http_post(struct prometheus_remote_write_context *ctx,
183
183
* - 200: OK
184
184
* - 201: Created
185
185
* - 202: Accepted
186
- * - 203: no authorative resp
186
+ * - 203: no authoritative resp
187
187
* - 204: No Content
188
188
* - 205: Reset content
189
189
*
190
190
*/
191
191
if ((c -> resp .status < 200 || c -> resp .status > 205 ) &&
192
- c -> resp .status != 400 ) {
192
+ c -> resp .status != 400 && c -> resp . status != 403 ) {
193
193
if (ctx -> log_response_payload &&
194
194
c -> resp .payload && c -> resp .payload_size > 0 ) {
195
195
flb_plg_error (ctx -> ins , "%s:%i, HTTP status=%i\n%s" ,
@@ -203,7 +203,7 @@ static int http_post(struct prometheus_remote_write_context *ctx,
203
203
out_ret = FLB_RETRY ;
204
204
}
205
205
else if (c -> resp .status == 400 ) {
206
- /* Returned 400 status means unrecoverable. Immidiately
206
+ /* Returned 400 status means unrecoverable. Immediately
207
207
* returning as a error. */
208
208
if (ctx -> log_response_payload &&
209
209
c -> resp .payload && c -> resp .payload_size > 0 ) {
@@ -217,6 +217,13 @@ static int http_post(struct prometheus_remote_write_context *ctx,
217
217
}
218
218
out_ret = FLB_ERROR ;
219
219
}
220
+ else if (c -> resp .status == 403 ) {
221
+ if (ctx -> has_aws_auth == FLB_TRUE ) {
222
+ flb_plg_info (ctx -> ins , "auth error, refreshing creds" );
223
+ ctx -> aws_provider -> provider_vtable -> refresh (ctx -> aws_provider );
224
+ }
225
+ out_ret = FLB_RETRY ;
226
+ }
220
227
else {
221
228
if (ctx -> log_response_payload &&
222
229
c -> resp .payload && c -> resp .payload_size > 0 ) {
0 commit comments