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

Iotdb #1

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b28f270
sync ui (#6603)
ruibaby Mar 23, 2021
f3b5671
Enhance the export service. (#6602)
wu-sheng Mar 24, 2021
32736dc
Refine backend-overview.md (#6609)
wingwong-knh Mar 24, 2021
a396888
Fix negative number on the grafana dashboard. (#6615)
Ax1an Mar 24, 2021
35d7a52
A unit test can be better. (#6620)
heihaozi Mar 25, 2021
51b60ae
Update the agent HBase plugin to support HBase Client 2.x (#6577)
nisiyong Mar 25, 2021
073fbbc
Refine event.md (#6622)
wingwong-knh Mar 25, 2021
92c0cb8
Add function `retagByK8sMeta` and opt type `K8sRetagType.Pod2Service`…
wankai123 Mar 25, 2021
f3ca0d0
Timestamp in GlobalIdGenerator is implemented using ThreadLocalRandom…
CalvinKirs Mar 26, 2021
f94bf97
Refine lal.md (#6626)
wingwong-knh Mar 26, 2021
1a0a938
added Component ID for Node Mongoose plugin (#6628)
tom-pytel Mar 26, 2021
ec043d5
document description supplement for #6403 (#6630)
s00373198 Mar 28, 2021
db9cc26
Remove binary files and download them in CI process instead (#6631)
kezhenxu94 Mar 28, 2021
0047829
Fixbug/springmvn-annotation-4.x-plugin, witness class does not exist …
LiWenGu Mar 28, 2021
56bebb8
Remove the close_before_method and close_after_method parameters of c…
liqiangz Mar 29, 2021
0c0a8d4
Revise document description for #4651 (#6638)
s00373198 Mar 29, 2021
523944a
Add arg `namespace` to func `retagByK8sMeta`, rebuild the relationsh…
wankai123 Mar 30, 2021
9a3e835
Fix NullPointerException when call "ReactiveRequestHolder.getHeaders"…
sN0wpeak Mar 30, 2021
0550455
implement storage-iotdb-plugin
wshao08 Mar 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
},
{
"pattern": "^https://github.com/apache/skywalking/blob/master/changes/changes-x.y.z.md$"
},
{
"pattern": "^https://dist.apache.org/repos/dist/dev/skywalking/x.y.z$"
}
],
"timeout": "10s",
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ OALLexer.tokens
/test/jacoco/classes
/test/jacoco/*.exec
oap-server/oal-grammar/**/gen/
test/jacoco
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Release Notes.
* Collect and report agent starting / shutdown events.
* Support jedis pipeline in jedis-2.x-plugin.
* Fix apm-toolkit-log4j-2.x-activation no trace Id in async log.
* Replace hbase-1.x-plugin with hbase-1.x-2.x-plugin to adapt hbase client 2.x
* Remove the close_before_method and close_after_method parameters of custom-enhance-plugin to avoid memory leaks.
* Fix bug that springmvn-annotation-4.x-plugin, witness class does not exist in some versions.
* Fix NullPointerException with `ReactiveRequestHolder.getHeaders`.

#### OAP-Backend
* Allow user-defined `JAVA_OPTS` in the startup script.
Expand Down Expand Up @@ -57,6 +61,8 @@ Release Notes.
* Support metrics grouped by scope labelValue in MAL, no need global same labelValue as before.
* Add functions in MAL to filter metrics according to the metric value.
* Optimize the self monitoring grafana dashboard.
* Enhance the export service.
* Add function `retagByK8sMeta` and opt type `K8sRetagType.Pod2Service` in MAL for k8s to relate pods and services.

#### UI
* Update selector scroller to show in all pages.
Expand All @@ -73,6 +79,7 @@ Release Notes.
* Fix log pages tags column not updated.
* Fix the problem that the footer and topology group is shaded when the topology radiation is displayed.
* When the topology radiation chart is displayed, the corresponding button should be highlighted.
* Refactor the route mapping, Dynamically import routing components, Improve first page loading performance.

#### Documentation
* Polish documentation due to we have covered all tracing, logging, and metrics fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

package org.apache.skywalking.apm.agent.core.context.ids;

import java.util.Random;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

import org.apache.skywalking.apm.util.StringUtil;

public final class GlobalIdGenerator {
Expand Down Expand Up @@ -58,7 +59,6 @@ private static class IDContext {
// Just for considering time-shift-back only.
private long runRandomTimestamp;
private int lastRandomValue;
private Random random;

private IDContext(long lastTimestamp, short threadSeq) {
this.lastTimestamp = lastTimestamp;
Expand All @@ -74,11 +74,8 @@ private long timestamp() {

if (currentTimeMillis < lastTimestamp) {
// Just for considering time-shift-back by Ops or OS. @hanahmily 's suggestion.
if (random == null) {
random = new Random();
}
if (runRandomTimestamp != currentTimeMillis) {
lastRandomValue = random.nextInt();
lastRandomValue = ThreadLocalRandom.current().nextInt();
runRandomTimestamp = currentTimeMillis;
}
return lastRandomValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<version>8.5.0-SNAPSHOT</version>
</parent>

<artifactId>apm-hbase-1.x-plugin</artifactId>
<artifactId>apm-hbase-1.x-2.x-plugin</artifactId>
<packaging>jar</packaging>
<name>hbase-1.x-plugin</name>
<name>hbase-1.x-2.x-plugin</name>

<properties>
<hbase-client.version>1.4.9</hbase-client.version>
<hbase-client.version>2.4.1</hbase-client.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@
*
*/

package org.apache.skywalking.apm.plugin.lettuce.v5.mock;
package org.apache.skywalking.apm.plugin.hbase;

import io.lettuce.core.RedisURI;
import java.lang.reflect.Field;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.ClusterConnection;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
import org.apache.skywalking.apm.agent.core.context.util.PeerFormat;
import org.apache.skywalking.apm.util.StringUtil;

public class MockRedisClusterClientConstructorInterceptor implements InstanceConstructorInterceptor {
public class HTable100Interceptor extends HTableInterceptor {

@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
@SuppressWarnings("unchecked") Iterable<RedisURI> redisURIs = (Iterable<RedisURI>) allArguments[1];
MockRedisClusterClient redisClusterClient = (MockRedisClusterClient) objInst;
StringBuilder peer = new StringBuilder();
for (RedisURI redisURI : redisURIs) {
peer.append(redisURI.getHost()).append(":").append(redisURI.getPort()).append(";");
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable {
Configuration configuration = ((ClusterConnection) allArguments[1]).getConfiguration();
Field field = configuration.getClass().getDeclaredField("overlay");
field.setAccessible(true);
Properties properties = (Properties) field.get(configuration);
String value = properties.getProperty("hbase.zookeeper.quorum");
if (StringUtil.isNotBlank(value)) {
objInst.setSkyWalkingDynamicField(value);
}
EnhancedInstance optionsInst = redisClusterClient.getOptions();
optionsInst.setSkyWalkingDynamicField(PeerFormat.shorten(peer.toString()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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.
*
*/

package org.apache.skywalking.apm.plugin.hbase;

import java.lang.reflect.Field;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.ClusterConnection;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.util.StringUtil;

public class HTable200Interceptor extends HTableInterceptor {

@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable {
Configuration configuration = ((ClusterConnection) allArguments[0]).getConfiguration();
Field field = configuration.getClass().getDeclaredField("overlay");
field.setAccessible(true);
Properties properties = (Properties) field.get(configuration);
String value = properties.getProperty("hbase.zookeeper.quorum");
if (StringUtil.isNotBlank(value)) {
objInst.setSkyWalkingDynamicField(value);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.
*
*/

package org.apache.skywalking.apm.plugin.hbase;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.util.StringUtil;

public class HTable220Interceptor extends HTableInterceptor {

@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable {
Method getConfigurationMethod = Connection.class.getMethod("getConfiguration");
Configuration configuration = (Configuration) getConfigurationMethod.invoke(allArguments[0]);
Field field = configuration.getClass().getDeclaredField("overlay");
field.setAccessible(true);
Properties properties = (Properties) field.get(configuration);
String value = properties.getProperty("hbase.zookeeper.quorum");
if (StringUtil.isNotBlank(value)) {
objInst.setSkyWalkingDynamicField(value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,22 @@
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType;

/**
* There have several interceptors to adapt different version hbase client. We use the minimal compatible version to
* name the Interceptor. eg.
* <p>HTable100Interceptor, 100 means version 1.0.0, compatible with version [1.0.0, 2.0.0)</p>
* <p>HTable200Interceptor, 200 means version 2.0.0, compatible with version [2.0.0, 2.2.0)</p>
* <p>HTable220Interceptor, 220 means version 2.2.0, compatible with version [2.2.0, )</p>
*/
public class HTableInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {

private static final String ENHANCE_CLASS = "org.apache.hadoop.hbase.client.HTable";
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.hbase.HTableInterceptor";
private static final String INTERCEPT_CLASS_100 = "org.apache.skywalking.apm.plugin.hbase.HTable100Interceptor";
private static final String INTERCEPT_CLASS_200 = "org.apache.skywalking.apm.plugin.hbase.HTable200Interceptor";
private static final String INTERCEPT_CLASS_220 = "org.apache.skywalking.apm.plugin.hbase.HTable220Interceptor";

@Override
protected ClassMatch enhanceClass() {
Expand All @@ -60,30 +71,61 @@ protected ClassMatch enhanceClass() {

@Override
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[]{
return new ConstructorInterceptPoint[] {
// compatible with version [1.0.0, 2.0.0)
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArguments(6);
return takesArguments(6)
.and(takesArgumentWithType(0, "org.apache.hadoop.hbase.TableName"));
}

@Override
public String getConstructorInterceptor() {
return INTERCEPT_CLASS;
return INTERCEPT_CLASS_100;
}
},
// compatible with version [2.0.0, 2.2.0)
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArguments(5)
.and(takesArgumentWithType(0, "org.apache.hadoop.hbase.client.ClusterConnection"));
}

@Override
public String getConstructorInterceptor() {
return INTERCEPT_CLASS_200;
}
},
// compatible with version [2.2.0, )
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArguments(5)
.and(takesArgumentWithType(0, "org.apache.hadoop.hbase.client.ConnectionImplementation"));
}

@Override
public String getConstructorInterceptor() {
return INTERCEPT_CLASS_220;
}
}
};
}

@Override
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[]{
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named("delete").or(named("put")).or(isPublic().and(named("get")))
.or(named("getScanner").and(takesArguments(1))
.and(takesArgument(0, named("org.apache.hadoop.hbase.client.Scan"))));
return named("delete")
.or(named("put"))
.or(isPublic().and(named("get")))
.or(named("getScanner")
.and(takesArguments(1))
.and(takesArgument(0, named("org.apache.hadoop.hbase.client.Scan"))));
}

@Override()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

hbase-1.x=org.apache.skywalking.apm.plugin.hbase.define.HTableInstrumentation
hbase-1.x/2.x=org.apache.skywalking.apm.plugin.hbase.define.HTableInstrumentation
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import org.apache.skywalking.apm.agent.test.tools.SegmentStorage;
import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint;
import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner;
import org.apache.skywalking.apm.plugin.lettuce.v5.mock.MockClientOptions;
import org.apache.skywalking.apm.plugin.lettuce.v5.mock.MockRedisClusterClient;
import org.apache.skywalking.apm.plugin.lettuce.v5.mock.MockRedisClusterClientConstructorInterceptor;
import org.hamcrest.CoreMatchers;
import org.hamcrest.MatcherAssert;
import org.hamcrest.core.Is;
Expand Down Expand Up @@ -120,11 +120,13 @@ public void testOnHugeClusterConsumerConfig() {
redisURIs.add(RedisURI.create("localhost", i));
}
MockRedisClusterClient mockRedisClusterClient = new MockRedisClusterClient();
MockRedisClusterClientConstructorInterceptor constructorInterceptor = new MockRedisClusterClientConstructorInterceptor();
MockClientOptions options = new MockClientOptions();
mockRedisClusterClient.setOptions(options);
RedisClusterClientConstructorInterceptor constructorInterceptor = new RedisClusterClientConstructorInterceptor();
constructorInterceptor.onConstruct(mockRedisClusterClient, new Object[] {
null,
redisURIs
});
assertThat(mockRedisClusterClient.getOptions().getSkyWalkingDynamicField().toString().length(), Is.is(200));
assertThat(options.getSkyWalkingDynamicField().toString().length(), Is.is(200));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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.
*
*/

package org.apache.skywalking.apm.plugin.lettuce.v5.mock;

import io.lettuce.core.cluster.ClusterClientOptions;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;

public class MockClientOptions extends ClusterClientOptions implements EnhancedInstance {

private Object object;

public MockClientOptions() {
this(ClusterClientOptions.builder());
}

protected MockClientOptions(Builder builder) {
super(builder);
}

@Override
public Object getSkyWalkingDynamicField() {
return object;
}

@Override
public void setSkyWalkingDynamicField(Object value) {
this.object = value;
}
}
Loading