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

Support tracing for async producing, batch sync consuming, and batch async consuming in rocketMQ-client-java-5.x-plugin #665

Merged
merged 4 commits into from
Jan 21, 2024

Conversation

CzyerChen
Copy link
Contributor

@CzyerChen CzyerChen commented Jan 19, 2024

Enhance an agent plugin to support RocketMQ

  • Add a test case for the new plugin, refer to the doc

Based on rocketMQ-client-java-5.x-plugin, add interceptors to tracing async producing, batch sync consuming, and batch async consuming cases. Batch consuming messages can refer to the producer. Async producing can record messageId.

…async consuming in rocketMQ-client-java-5.x-plugin
@wu-sheng
Copy link
Member

Could you share how batch consuming works? Is UI working as expected to see multiple relative trace ID from downstream?

@wu-sheng wu-sheng added this to the 9.2.0 milestone Jan 19, 2024
@CzyerChen
Copy link
Contributor Author

CzyerChen commented Jan 19, 2024

Could you share how batch consuming works? Is UI working as expected to see multiple relative trace ID from downstream?

As the testcase:

1.api

2.produce 1 normal message

3.PushConsumer consumes 1 message by listener

4.5.produce 2 normal messages async

6.SimpleConsumer consumes 2 messages by triggered manually

7.8.produce 2 normal messages

9.SimpleConsumer consumes 2 messages async by triggered manually


4 segments share 1 traceId

image

@wu-sheng
Copy link
Member

So, from reading your graph, the same number of spans are going to be created based on the number of messages in one bulk. Am I right?

Q, what will happen if two messages are produced from different contexts (two trace IDs), and consumed in one bulk from one client, is this possible?

@wu-sheng
Copy link
Member

BTW, at here, you need to use the whole URL, rather than issue ID.

- [x] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes https://github.com/apache/skywalking/issues/11752.

@CzyerChen
Copy link
Contributor Author

CzyerChen commented Jan 19, 2024

So, from reading your graph, the same number of spans are going to be created based on the number of messages in one bulk. Am I right?

Q, what will happen if two messages are produced from different contexts (two trace IDs), and consumed in one bulk from one client, is this possible?

Testcase:
ProjectA:

  1. produce 1 message
  2. produce 1 message

ProjectB:

  1. consumer 2 message in a batch

Then, the graph like this:
image
image

1 producer can be referred, the other can not.

The graphQL data is here:

{
    "data": {
        "trace": {
            "spans": [
                {
                    "traceId": "d013fdb11b56417a9997db9d56722ce2.57.17056716790540001",
                    "segmentId": "d013fdb11b56417a9997db9d56722ce2.57.17056716790540000",
                    "spanId": 0,
                    "parentSpanId": -1,
                    "refs": [],
                    "serviceCode": "rmq5-grpc-A-scenario",
                    "serviceInstanceName": "[email protected]",
                    "startTime": 1705671679055,
                    "endTime": 1705671679135,
                    "endpointName": "GET:/case/rocketmq-5-grpc-scenario",
                    "type": "Entry",
                    "peer": "",
                    "component": "SpringMVC",
                    "isError": false,
                    "layer": "Http",
                    "tags": [
                        {
                            "key": "url",
                            "value": "http://127.0.0.1:8080/rocketmq-5-grpc-scenario/case/rocketmq-5-grpc-scenario"
                        },
                        {
                            "key": "http.method",
                            "value": "GET"
                        },
                        {
                            "key": "http.status_code",
                            "value": "200"
                        }
                    ],
                    "logs": [],
                    "attachedEvents": []
                },
                {
                    "traceId": "d013fdb11b56417a9997db9d56722ce2.57.17056716790540001",
                    "segmentId": "d013fdb11b56417a9997db9d56722ce2.57.17056716790540000",
                    "spanId": 1,
                    "parentSpanId": 0,
                    "refs": [],
                    "serviceCode": "rmq5-grpc-A-scenario",
                    "serviceInstanceName": "[email protected]",
                    "startTime": 1705671679057,
                    "endTime": 1705671679133,
                    "endpointName": "RocketMQ/ConsumerAsyncTopicTest/Producer",
                    "type": "Exit",
                    "peer": "123.56.194.74:8081",
                    "component": "rocketMQ-producer",
                    "isError": false,
                    "layer": "MQ",
                    "tags": [
                        {
                            "key": "mq.broker",
                            "value": "123.56.194.74:8081"
                        },
                        {
                            "key": "mq.topic",
                            "value": "ConsumerAsyncTopicTest"
                        },
                        {
                            "key": "mq.message.keys",
                            "value": "e8029111-fa26-4738-a59f-2d4dab0b2ffe"
                        },
                        {
                            "key": "mq.message.tags",
                            "value": "Tag:async:consumer"
                        },
                        {
                            "key": "mq.message.id",
                            "value": "01ACDE480011221E0005BC15FF00000003"
                        }
                    ],
                    "logs": [],
                    "attachedEvents": []
                },
                {
                    "traceId": "d013fdb11b56417a9997db9d56722ce2.57.17056716790540001",
                    "segmentId": "1c116740e8dd41f9af3577a03c969a4b.53.17056716950020000",
                    "spanId": 0,
                    "parentSpanId": -1,
                    "refs": [
                        {
                            "traceId": "d013fdb11b56417a9997db9d56722ce2.57.17056716790540001",
                            "parentSegmentId": "d013fdb11b56417a9997db9d56722ce2.57.17056716790540000",
                            "parentSpanId": 1,
                            "type": "CROSS_PROCESS"
                        },
                        {
                            "traceId": "d013fdb11b56417a9997db9d56722ce2.55.17056716721260001",
                            "parentSegmentId": "d013fdb11b56417a9997db9d56722ce2.55.17056716721250000",
                            "parentSpanId": 1,
                            "type": "CROSS_PROCESS"
                        }
                    ],
                    "serviceCode": "rmq5-grpc-B-scenario",
                    "serviceInstanceName": "[email protected]",
                    "startTime": 1705671695004,
                    "endTime": 1705671696483,
                    "endpointName": "RocketMQ/ConsumerAsyncTopicTest/Consumer",
                    "type": "Entry",
                    "peer": "123.56.194.74:8081",
                    "component": "rocketMQ-consumer",
                    "isError": false,
                    "layer": "MQ",
                    "tags": [
                        {
                            "key": "mq.topic",
                            "value": "ConsumerAsyncTopicTest"
                        },
                        {
                            "key": "mq.broker",
                            "value": "123.56.194.74:8081"
                        },
                        {
                            "key": "transmission.latency",
                            "value": "17345"
                        },
                        {
                            "key": "transmission.latency",
                            "value": "24263"
                        },
                        {
                            "key": "http.status_code",
                            "value": "200"
                        }
                    ],
                    "logs": [],
                    "attachedEvents": []
                }
            ]
        }
    }
}

@wu-sheng
Copy link
Member

What does the VNode mean in this case?

@CzyerChen
Copy link
Contributor Author

What does the VNode mean in this case?

image The VNode is another ref.

@wu-sheng
Copy link
Member

OK, I will work with @Fine0830 about UI part, this should not be your concern. Thanks for your explanation.

… code & log when error occurred & update test scenario
@wu-sheng wu-sheng merged commit bbb177a into apache:main Jan 21, 2024
188 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants