You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/07/18 13:27:33 UTC
[GitHub] [skywalking] Cool-Coding opened a new issue #7325: the logic of creating and consuming kafka topic is not consistent at oap and agent side when using kafka namespace
Cool-Coding opened a new issue #7325:
URL: https://github.com/apache/skywalking/issues/7325
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
- [x] Bug
- [ ] Requirement
- [ ] Feature or performance improvement
___
### Bug
- Which version of SkyWalking, OS, and JRE?
Skywalking8.6.0 mac jdk1.8.0_191
- What happened?
when I use kafka namespace at oap and agent side, I start oap server and agent. the agent reports an error.
Below is my operation steps.
1. give namespace a string value
```yaml
kafka-fetcher:
selector: ${SW_KAFKA_FETCHER:default}
default:
bootstrapServers: ${SW_KAFKA_FETCHER_SERVERS:localhost:9092}
namespace: ${SW_NAMESPACE:"yanggy"}
partitions: ${SW_KAFKA_FETCHER_PARTITIONS:2}
replicationFactor: ${SW_KAFKA_FETCHER_PARTITIONS_FACTOR:2}
enableMeterSystem: ${SW_KAFKA_FETCHER_ENABLE_METER_SYSTEM:false}
enableNativeProtoLog: ${SW_KAFKA_FETCHER_ENABLE_NATIVE_PROTO_LOG:false}
enableNativeJsonLog: ${SW_KAFKA_FETCHER_ENABLE_NATIVE_JSON_LOG:false}
isSharding: ${SW_KAFKA_FETCHER_IS_SHARDING:false}
consumePartitions: ${SW_KAFKA_FETCHER_CONSUME_PARTITIONS:""}
kafkaHandlerThreadPoolSize: ${SW_KAFKA_HANDLER_THREAD_POOL_SIZE:-1}
kafkaHandlerThreadPoolQueueSize: ${SW_KAFKA_HANDLER_THREAD_POOL_QUEUE_SIZE:-1}
```
2. start oap server
3. starg a demo appllication with agent
- config sending data using kafka
```yaml
# Kafka producer configuration
plugin.kafka.bootstrap_servers=${SW_KAFKA_BOOTSTRAP_SERVERS:localhost:9092}
# if you want to set namespace. please make sure the OAP server has set it in Kafka fetcher module
plugin.kafka.namespace=${SW_KAFKA_NAMESPACE:yanggy}
```
- start demo
I got an error because of the "yanggy-skywalking-meters" topic doesn't exist
```java
ERROR 2021-07-16 16:23:35:343 SkywalkingAgent-11-org.apache.skywalking.apm.dependencies.kafkaProducerInitThread-0 KafkaProducerManager : Get KAFKA topic:yanggy-skywalking-meters error.
java.util.concurrent.ExecutionException: org.apache.skywalking.apm.dependencies.org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition.
at org.apache.skywalking.apm.dependencies.org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45)
at org.apache.skywalking.apm.dependencies.org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32)
at org.apache.skywalking.apm.dependencies.org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:104)
at org.apache.skywalking.apm.dependencies.org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:272)
at org.apache.skywalking.apm.agent.core.kafka.KafkaProducerManager.lambda$run$1(KafkaProducerManager.java:109)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.apache.skywalking.apm.agent.core.kafka.KafkaProducerManager.run(KafkaProducerManager.java:120)
at org.apache.skywalking.apm.util.RunnableWithExceptionProtection.run(RunnableWithExceptionProtection.java:33)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
___
### The reason
1. when kafka fetcher plugin starts at oap side, it will register many kafka topics.
```java
public void start() throws ServiceNotProvidedException {
handlerRegister.register(new JVMMetricsHandler(getManager(), config));
handlerRegister.register(new ServiceManagementHandler(getManager(), config));
handlerRegister.register(new TraceSegmentHandler(getManager(), config));
handlerRegister.register(new ProfileTaskHandler(getManager(), config));
if (config.isEnableMeterSystem()) {
handlerRegister.register(new MeterServiceHandler(getManager(), config));
}
if (config.isEnableNativeProtoLog()) {
handlerRegister.register(new LogHandler(getManager(), config));
}
if (config.isEnableNativeJsonLog()) {
handlerRegister.register(new JsonLogHandler(getManager(), config));
}
handlerRegister.start();
}
```
we can see the last three topics oly can be registed when they satisfy some conditions. the agent reports the "yanggy-skywalking-meters" topic doesn't exist; because the switch of "meter" topic is default disabled. it is configured in application.yml at oap side.
```yml
kafka-fetcher:
selector: ${SW_KAFKA_FETCHER:default}
default:
......
enableMeterSystem: ${SW_KAFKA_FETCHER_ENABLE_METER_SYSTEM: false}
.....
```
**Question:**
why does agent only report the "meter" topic error, not the two other topics ?
**Answer:**
the kafka report plugin at agent side will send five kind of kafka topics. whereas, oap only create four kind of kafka topics when using kafka namespace.

___
### Requirement or improvement
I suggest that we should give default "true" value to "enableMeterSystem" in order to keep the logic consistency of creating and consuming topic at oap and agent side.
--
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
[GitHub] [skywalking] wu-sheng commented on issue #7325: the logic of creating and consuming kafka topic is not consistent at oap and agent side when using kafka namespace
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7325:
URL: https://github.com/apache/skywalking/issues/7325#issuecomment-882056693
This was reported through #7316
--
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
[GitHub] [skywalking] wu-sheng commented on issue #7325: the logic of creating and consuming kafka topic is not consistent at oap and agent side when using kafka namespace
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7325:
URL: https://github.com/apache/skywalking/issues/7325#issuecomment-882065449
Let's make the meter system is activated in default. We don't need this confusion. Please send a pull request when you are ready.
--
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
[GitHub] [skywalking] wu-sheng closed issue #7325: `-meters` metrics topic isn't created with namespace prefix
Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #7325:
URL: https://github.com/apache/skywalking/issues/7325
--
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