Skip to content

Commit

Permalink
Add comment to explain entity drops without account ID
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihonl committed Oct 30, 2024
1 parent b59d1f3 commit 6677bd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/out_cloudwatch_logs/cloudwatch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ static int init_put_payload(struct flb_cloudwatch *ctx, struct cw_flush *buf,
goto error;
}
// If we are missing the service name, the entity will get rejected by the frontend anyway
// so do not emit entity unless service name is filled
// so do not emit entity unless service name is filled. If we are missing account ID
// it is considered not having sufficient information for entity therefore we should drop the entity.
if(ctx->add_entity && stream->entity != NULL && stream->entity->key_attributes != NULL && stream->entity->key_attributes->name != NULL && stream->entity->key_attributes->account_id != NULL) {
if (!try_to_write(buf->out_buf, offset, buf->out_buf_size,
"\"entity\":{", 10)) {
Expand Down

0 comments on commit 6677bd7

Please sign in to comment.