You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "CodePrometheus (via GitHub)" <gi...@apache.org> on 2024/02/26 17:59:15 UTC

[PR] [feature-WIP] add support for Pulsar [skywalking-go]

CodePrometheus opened a new pull request, #173:
URL: https://github.com/apache/skywalking-go/pull/173

   ### summary
   [Pulsar](https://github.com/apache/pulsar-client-go) is a native go client maintained by the apache pulsar team.
   
   - [x] Update the docs.
   - [x] Pass CI test.
   - [ ] Pass Plugin test.
   
   ### test report
   <img width="400" alt="image" src="https://github.com/apache/skywalking-go/assets/66550292/2039a4e0-4d99-4fef-8886-ca4b7c1ee0d0">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "mrproliu (via GitHub)" <gi...@apache.org>.
mrproliu commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1511232215


##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/health' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-1/Producer
+            parentSpanId: 0
+            spanId: 1
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+              - { key: mq.msg.id, value: not null }
+          - operationName: Pulsar/sw-topic-1/Consumer
+            parentSpanId: 0
+            spanId: 2
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 74
+            isError: false
+            spanType: Entry
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+            refs:
+              - { parentEndpoint: 'GET:/execute', networkAddress: 'pulsar://pulsar-server:6650',
+                  refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: pulsar,
+                  traceId: not null }
+          - operationName: Pulsar/sw-topic-2/AsyncProducer
+            parentSpanId: 0
+            spanId: 3
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+          - operationName: GET:/execute
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/execute' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-2/Producer/Callback

Review Comment:
   Then, why does the async producer have the children consumer, but the synchronized producer doesn't? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#issuecomment-1972269012

   PTAL.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#issuecomment-1986811961

   `go: /skywalking-go/go.work:3: unknown directive: toolchain` 
   Very strange, I tried it locally and it was passed.
   <img width="600" alt="image" src="https://github.com/apache/skywalking-go/assets/66550292/4c84b2cf-4022-441c-8fa0-e51931bd2b5a">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1518543011


##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health

Review Comment:
   I noticed that I have also retained this spans in other plugin's file, I'll delete it in future PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1518543011


##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health

Review Comment:
   I noticed that I have also retained this spans in other plugin's file, I'll delete it from future PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1518541606


##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#issuecomment-1964808100

   Ref https://github.com/apache/skywalking/pull/11937. 
   
   Maybe I need some time, please hold for a while, thanks. 
   
   AFAIK, We have Pulsar monitoring and agent plugins (Java is ready and Go are currently in progress) for Pulsar, skywalking-showcase needs to be added accordingly? I am willing to try.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#issuecomment-1965523729

   Showcase is fine, it can't hold all plugin examples there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "mrproliu (via GitHub)" <gi...@apache.org>.
mrproliu commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1508380183


##########
plugins/pulsar/pulsar/receive_consumer.go:
##########
@@ -0,0 +1,70 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package pulsar
+
+import (
+	"github.com/apache/pulsar-client-go/pulsar"
+
+	"github.com/apache/skywalking-go/plugins/core/operator"
+	"github.com/apache/skywalking-go/plugins/core/tracing"
+)
+
+const (
+	pulsarReceivePrefix      = "Pulsar/"
+	pulsarReceiveSuffix      = "/Consumer"
+	pulsarReceiveComponentID = 74
+)
+
+type ReceiveInterceptor struct {
+}
+
+func (r *ReceiveInterceptor) BeforeInvoke(invocation operator.Invocation) error {
+	return nil
+}
+
+func (r *ReceiveInterceptor) AfterInvoke(invocation operator.Invocation, result ...interface{}) error {
+	nativeConsumer := invocation.CallerInstance().(*nativeconsumer)
+	topic := nativeConsumer.options.Topic
+	lookup, err := nativeConsumer.client.lookupService.Lookup(topic)
+	if err != nil {
+		return err
+	}
+	message := result[0].(pulsar.Message)
+	peer := lookup.PhysicalAddr.String()
+	operationName := pulsarReceivePrefix + topic + pulsarReceiveSuffix
+
+	span, err := tracing.CreateEntrySpan(operationName, func(headerKey string) (string, error) {

Review Comment:
   Why we don't move `CreateEntrySpan` to the `BeforeInvoke`? It looks like we created a span and stopped them quickly. 



##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/health' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-1/Producer
+            parentSpanId: 0
+            spanId: 1
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+              - { key: mq.msg.id, value: not null }
+          - operationName: Pulsar/sw-topic-1/Consumer
+            parentSpanId: 0

Review Comment:
   Why the consumer parent span id is `0`(span `GET:/execute`), I think It should be `Pulsar/sw-topic-1/Producer`. Am I right?



##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health

Review Comment:
   Please delete the `GET:/health` checker.



##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/health' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-1/Producer
+            parentSpanId: 0
+            spanId: 1
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+              - { key: mq.msg.id, value: not null }
+          - operationName: Pulsar/sw-topic-1/Consumer
+            parentSpanId: 0
+            spanId: 2
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 74
+            isError: false
+            spanType: Entry
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+            refs:
+              - { parentEndpoint: 'GET:/execute', networkAddress: 'pulsar://pulsar-server:6650',
+                  refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: pulsar,
+                  traceId: not null }
+          - operationName: Pulsar/sw-topic-2/AsyncProducer
+            parentSpanId: 0
+            spanId: 3
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+          - operationName: GET:/execute
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/execute' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-2/Producer/Callback

Review Comment:
   When will we have the `Callback` span, It's a local span and not reference? Could you please add the screenshot about this plugin test? I'm not sure what's the real show like. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1518541697


##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/health' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-1/Producer
+            parentSpanId: 0
+            spanId: 1
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+              - { key: mq.msg.id, value: not null }
+          - operationName: Pulsar/sw-topic-1/Consumer
+            parentSpanId: 0
+            spanId: 2
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 74
+            isError: false
+            spanType: Entry
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+            refs:
+              - { parentEndpoint: 'GET:/execute', networkAddress: 'pulsar://pulsar-server:6650',
+                  refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: pulsar,
+                  traceId: not null }
+          - operationName: Pulsar/sw-topic-2/AsyncProducer
+            parentSpanId: 0
+            spanId: 3
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+          - operationName: GET:/execute
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/execute' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-2/Producer/Callback

Review Comment:
   I think it's a problem with the test code, and I think I've found the solution, please take a look again, thx.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #173:
URL: https://github.com/apache/skywalking-go/pull/173


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1509946436


##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/health' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-1/Producer
+            parentSpanId: 0
+            spanId: 1
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+              - { key: mq.msg.id, value: not null }
+          - operationName: Pulsar/sw-topic-1/Consumer
+            parentSpanId: 0
+            spanId: 2
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 74
+            isError: false
+            spanType: Entry
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+            refs:
+              - { parentEndpoint: 'GET:/execute', networkAddress: 'pulsar://pulsar-server:6650',
+                  refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: pulsar,
+                  traceId: not null }
+          - operationName: Pulsar/sw-topic-2/AsyncProducer
+            parentSpanId: 0
+            spanId: 3
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+          - operationName: GET:/execute
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/execute' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-2/Producer/Callback

Review Comment:
   Now as shown in the figure, when the two test methods are executed separately, it's as expected.
   <img width="400" alt="image" src="https://github.com/apache/skywalking-go/assets/66550292/d94d4afb-8c8c-41bf-a23d-4e40cf2189a2">
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1509152389


##########
plugins/pulsar/pulsar/receive_consumer.go:
##########
@@ -0,0 +1,70 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package pulsar
+
+import (
+	"github.com/apache/pulsar-client-go/pulsar"
+
+	"github.com/apache/skywalking-go/plugins/core/operator"
+	"github.com/apache/skywalking-go/plugins/core/tracing"
+)
+
+const (
+	pulsarReceivePrefix      = "Pulsar/"
+	pulsarReceiveSuffix      = "/Consumer"
+	pulsarReceiveComponentID = 74
+)
+
+type ReceiveInterceptor struct {
+}
+
+func (r *ReceiveInterceptor) BeforeInvoke(invocation operator.Invocation) error {
+	return nil
+}
+
+func (r *ReceiveInterceptor) AfterInvoke(invocation operator.Invocation, result ...interface{}) error {
+	nativeConsumer := invocation.CallerInstance().(*nativeconsumer)
+	topic := nativeConsumer.options.Topic
+	lookup, err := nativeConsumer.client.lookupService.Lookup(topic)
+	if err != nil {
+		return err
+	}
+	message := result[0].(pulsar.Message)
+	peer := lookup.PhysicalAddr.String()
+	operationName := pulsarReceivePrefix + topic + pulsarReceiveSuffix
+
+	span, err := tracing.CreateEntrySpan(operationName, func(headerKey string) (string, error) {

Review Comment:
   Because the `Extractor` function requires the `message` in the `result[0]` to inject the `headerKey`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on code in PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#discussion_r1518541989


##########
test/plugins/scenarios/pulsar/config/excepted.yml:
##########
@@ -0,0 +1,142 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+segmentItems:
+  - serviceName: pulsar
+    segmentSize: 4
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/health
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 5004
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - { key: http.method, value: GET }
+              - { key: url, value: 'service:8080/health' }
+              - { key: status_code, value: '200' }
+      - segmentId: not null
+        spans:
+          - operationName: Pulsar/sw-topic-1/Producer
+            parentSpanId: 0
+            spanId: 1
+            spanLayer: MQ
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 73
+            isError: false
+            spanType: Exit
+            peer: pulsar://pulsar-server:6650
+            skipAnalysis: false
+            tags:
+              - { key: mq.broker, value: not null }
+              - { key: mq.topic, value: not null }
+              - { key: mq.msg.id, value: not null }
+          - operationName: Pulsar/sw-topic-1/Consumer
+            parentSpanId: 0

Review Comment:
   In the current test code, both consumer and producer are triggered by `http`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feature: add support for Pulsar [skywalking-go]

Posted by "mrproliu (via GitHub)" <gi...@apache.org>.
mrproliu commented on PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#issuecomment-1986859860

   Could you take a look on the go.work file under the root directory? Maybe change this file in a mistake?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "CodePrometheus (via GitHub)" <gi...@apache.org>.
CodePrometheus commented on PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#issuecomment-1965608815

   > Meanwhile, you should try and test service hierarchy for Pulsar, if you want. especially from virtual MQ to MQ server.
   
   Copy that, I want to try it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feature-WIP] add support for Pulsar [skywalking-go]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #173:
URL: https://github.com/apache/skywalking-go/pull/173#issuecomment-1965524702

   Meanwhile, you should try and test service hierarchy for Pulsar, if you want. especially from virtual MQ to MQ server.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org