Skip to content
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

Increase the payload size to SNAPLEN when events can be merged #410

Merged
merged 2 commits into from
Dec 20, 2022

Conversation

dxsup
Copy link
Member

@dxsup dxsup commented Dec 20, 2022

Description

Increase the limited payload size to SNAPLEN when events can be merged. This PR fixes the bug that the payload size is limited to 80 if one request/response is combined by multiple events.

Related Issue

This is the subsequent to #393 to fix #388.

How Has This Been Tested?

=== RUN   TestHttpProtocol
=== RUN   TestHttpProtocol/slowData
=== RUN   TestHttpProtocol/errorData
=== RUN   TestHttpProtocol/split
=== RUN   TestHttpProtocol/normal
=== RUN   TestHttpProtocol/continueData
--- PASS: TestHttpProtocol (0.00s)
    --- PASS: TestHttpProtocol/slowData (0.00s)
    --- PASS: TestHttpProtocol/errorData (0.00s)
    --- PASS: TestHttpProtocol/split (0.00s)
    --- PASS: TestHttpProtocol/normal (0.00s)
    --- PASS: TestHttpProtocol/continueData (0.00s)
=== RUN   TestMySqlProtocol
=== RUN   TestMySqlProtocol/query-split
=== RUN   TestMySqlProtocol/query
--- PASS: TestMySqlProtocol (0.00s)
    --- PASS: TestMySqlProtocol/query-split (0.00s)
    --- PASS: TestMySqlProtocol/query (0.00s)
=== RUN   TestRedisProtocol
=== RUN   TestRedisProtocol/get
--- PASS: TestRedisProtocol (0.00s)
    --- PASS: TestRedisProtocol/get (0.00s)
=== RUN   TestDnsProtocol
=== RUN   TestDnsProtocol/multi
--- PASS: TestDnsProtocol (0.00s)
    --- PASS: TestDnsProtocol/multi (0.00s)
=== RUN   TestKafkaProtocol
=== RUN   TestKafkaProtocol/produce-split
=== RUN   TestKafkaProtocol/fetch-split
=== RUN   TestKafkaProtocol/fetch-one-topic-two-patitions
--- PASS: TestKafkaProtocol (0.00s)
    --- PASS: TestKafkaProtocol/produce-split (0.00s)
    --- PASS: TestKafkaProtocol/fetch-split (0.00s)
    --- PASS: TestKafkaProtocol/fetch-one-topic-two-patitions (0.00s)
=== RUN   TestDubboProtocol
=== RUN   TestDubboProtocol/shortData
--- PASS: TestDubboProtocol (0.00s)
    --- PASS: TestDubboProtocol/shortData (0.00s)
=== RUN   TestRocketMQProtocol
=== RUN   TestRocketMQProtocol/rocketmq-json
=== RUN   TestRocketMQProtocol/rocketmq-rocketmq
=== RUN   TestRocketMQProtocol/rocketmq-error
--- PASS: TestRocketMQProtocol (0.00s)
    --- PASS: TestRocketMQProtocol/rocketmq-json (0.00s)
    --- PASS: TestRocketMQProtocol/rocketmq-rocketmq (0.00s)
    --- PASS: TestRocketMQProtocol/rocketmq-error (0.00s)
PASS

Daxin Wang added 2 commits December 20, 2022 11:19
Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>
Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>
@dxsup dxsup requested a review from hocktea214 December 20, 2022 09:12
@dxsup
Copy link
Member Author

dxsup commented Dec 20, 2022

Also, this PR fixes the potential bug hiding in the test cases of networkanalyzer. I have redesigned the data format used to declare the data field of events.

Check details in collector/pkg/component/analyzer/network/network_analyzer_test.go.

// getData converts the following format to byte array.
//
// There are the following formats supported:
// 1. {hex number}|{string}
//    The first part is a number in hexadecimal which is part of the original data.
//    It holds different meanings in different protocols.
// 2. (hex)|{hex value}
//    The first part is the constant "hex" and the second part is its value
// 3. (string)|{string value}
//    The first part is the constant "string" and the second part is its value
// 4. {string value}
//    If there are no the separator "|" existing, the data is considered as a string
// See the files under the "testdata" directory for how to write your data.
func getData(datas []string) ([]byte, error) {
...
}

@dxsup dxsup merged commit 3cbe703 into KindlingProject:main Dec 20, 2022
@dxsup dxsup deleted the fix-payload-size-limited branch December 20, 2022 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse HTTP protocol bug with the response status code 100
2 participants