Skip to content

docs: update rocketmq-logger.md, add max req/resp body size attributes description(3.10-) #12173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

yuanrui01
Copy link

This PR updates the documentation to include descriptions for two new configuration attributes introduced in version 3.10: max_req_body_bytes and max_resp_body_bytes. These attributes allow users to limit the recorded size of request and response bodies when include_req_body or include_resp_body is enabled, respectively, with a default value of 524288 bytes. Bodies exceeding these limits are truncated, enhancing memory efficiency and system stability.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. doc Documentation things labels Apr 22, 2025
@yuanrui01 yuanrui01 changed the title Update rocketmq-logger.md, add max req/resp body size attributes description(3.10-) docs: update rocketmq-logger.md, add max req/resp body size attributes description(3.10-) Apr 23, 2025
@Baoyuantop
Copy link
Contributor

I didn't find these two attributes in the code. 🤔

@yuanrui01
Copy link
Author

I didn't find these two attributes in the code. 🤔

I found it in log-util.lua
conf.max_req_body_bytes
conf.max_resp_body_bytes
Maybe this is implemented as a public property of all logging plugins?

@Baoyuantop
Copy link
Contributor

The schema of the plugin also needs to be changed so that users can configure these two parameters in the plugin.

@yuanrui01
Copy link
Author

The schema of the plugin also needs to be changed so that users can configure these two parameters in the plugin.

I can add these two properties directly under the plugin to take effect as well.
ex:
"plugins": { "rocketmq-logger": { ... "max_resp_body_bytes" : 1048576, "max_req_body_bytes ": 1048576 } }
So you say modifying the schema, is it for integrity purposes? I read lua for the first time and i'm not familiar with the rules.

@Baoyuantop
Copy link
Contributor

I can add these two properties directly under the plugin to take effect as well.

Did you verify that the function is normal?

In order for the plugin to support this capability, we need to provide some code and tests for the plugin, you can refer to #11133

@yuanrui01
Copy link
Author

I can add these two properties directly under the plugin to take effect as well.

Did you verify that the function is normal?

In order for the plugin to support this capability, we need to provide some code and tests for the plugin, you can refer to #11133

Yes, it works. In fact, that was my original need, at first I was trying to control the size logging via include_req_body_expr and include_resp_body_expr, then realized I couldn't do it, so I went through the code for a while and found these two lovely attributes. I upgraded the version from 3.3 to 3.12 then turned on show specified size and the size could be truncated.

Basically,
config: "plugins": { "rocketmq-logger": { ... "max_resp_body_bytes" : 30, "max_req_body_bytes ": 30} }
and i got the message's resposne body like this
truncate

@Baoyuantop
Copy link
Contributor

Hi @yuanrui01, it's not enough to just change the documentation, please add code and tests.

@Baoyuantop Baoyuantop added the wait for update wait for the author's response in this issue/PR label Apr 29, 2025
@bzp2010
Copy link
Contributor

bzp2010 commented May 12, 2025

@Baoyuantop It's an internal limitation, it's already there, this is just documenting it. Not only this plugin, but other logging plugins also have built-in limitations.

@yuanrui01 yuanrui01 closed this May 12, 2025
@yuanrui01 yuanrui01 deleted the patch-2 branch May 12, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Documentation things size:XS This PR changes 0-9 lines, ignoring generated files. wait for update wait for the author's response in this issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants