Skip to content

Commit 969a258

Browse files
authored
Remove inappropriate dependency from elasticsearch-7.x-plugin (#299)
1 parent 92665b8 commit 969a258

File tree

6 files changed

+82
-13
lines changed

6 files changed

+82
-13
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Release Notes.
1919
* Plugin to support xxl-job 2.3.x.
2020
* Add plugin to support Micronaut(HTTP Client/Server) 3.2.x-3.6.x
2121
* Add plugin to support NATS Java client 2.14.x-2.15.x
22+
* Remove inappropriate dependency from elasticsearch-7.x-plugin
2223

2324
#### Documentation
2425

apm-sniffer/apm-sdk-plugin/elasticsearch-7.x-plugin/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,5 @@
4242
<version>${elasticsearch.rest.high.level.client.version}</version>
4343
<scope>provided</scope>
4444
</dependency>
45-
<dependency>
46-
<groupId>org.apache.skywalking</groupId>
47-
<artifactId>apm-elasticsearch-6.x-plugin</artifactId>
48-
<version>${project.version}</version>
49-
<scope>provided</scope>
50-
</dependency>
5145
</dependencies>
5246
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
package org.apache.skywalking.apm.plugin.elasticsearch.v7;
20+
21+
import org.apache.skywalking.apm.agent.core.context.tag.AbstractTag;
22+
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
23+
24+
public class Constants {
25+
26+
//witnessClasses
27+
public static final String TASK_TRANSPORT_CHANNEL_WITNESS_CLASSES = "org.elasticsearch.transport.TaskTransportChannel";
28+
public static final String SEARCH_HITS_WITNESS_CLASSES = "org.elasticsearch.search.SearchHits";
29+
public static final String DB_TYPE = "Elasticsearch";
30+
31+
public static final String BASE_FUTURE_METHOD = "actionGet";
32+
33+
//tags
34+
public static final AbstractTag<String> ES_TOOK_MILLIS = Tags.ofKey("es.took_millis");
35+
public static final AbstractTag<String> ES_TOTAL_HITS = Tags.ofKey("es.total_hits");
36+
public static final AbstractTag<String> ES_INGEST_TOOK_MILLIS = Tags.ofKey("es.ingest_took_millis");
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
package org.apache.skywalking.apm.plugin.elasticsearch.v7;
20+
21+
import org.apache.skywalking.apm.agent.core.boot.PluginConfig;
22+
23+
public class ElasticsearchPluginConfig {
24+
public static class Plugin {
25+
@PluginConfig(root = ElasticsearchPluginConfig.class)
26+
public static class Elasticsearch {
27+
/**
28+
* If true, trace all the DSL(Domain Specific Language) in ElasticSearch access, default is false
29+
*/
30+
public static boolean TRACE_DSL = false;
31+
32+
public static int ELASTICSEARCH_DSL_LENGTH_THRESHOLD = 1024;
33+
}
34+
}
35+
}

apm-sniffer/apm-sdk-plugin/elasticsearch-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v7/define/AdapterActionFutureInstrumentation.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
package org.apache.skywalking.apm.plugin.elasticsearch.v7.define;
2020

21-
import java.util.Collections;
22-
import java.util.List;
2321
import net.bytebuddy.description.method.MethodDescription;
2422
import net.bytebuddy.matcher.ElementMatcher;
2523
import org.apache.skywalking.apm.agent.core.plugin.WitnessMethod;
@@ -28,7 +26,10 @@
2826
import org.apache.skywalking.apm.agent.core.plugin.interceptor.StaticMethodsInterceptPoint;
2927
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassEnhancePluginDefine;
3028
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
31-
import org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants;
29+
import org.apache.skywalking.apm.plugin.elasticsearch.v7.Constants;
30+
31+
import java.util.Collections;
32+
import java.util.List;
3233

3334
import static net.bytebuddy.matcher.ElementMatchers.named;
3435
import static net.bytebuddy.matcher.ElementMatchers.returns;

apm-sniffer/apm-sdk-plugin/elasticsearch-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v7/interceptor/AdapterActionFutureActionGetMethodsInterceptor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818

1919
package org.apache.skywalking.apm.plugin.elasticsearch.v7.interceptor;
2020

21-
import java.lang.reflect.Method;
2221
import org.apache.skywalking.apm.agent.core.context.ContextManager;
2322
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
2423
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
2524
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
2625
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
2726
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
2827
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
29-
import org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants;
28+
import org.apache.skywalking.apm.plugin.elasticsearch.v7.Constants;
3029
import org.apache.skywalking.apm.util.StringUtil;
3130
import org.elasticsearch.action.ActionResponse;
3231
import org.elasticsearch.action.bulk.BulkResponse;
@@ -36,8 +35,10 @@
3635
import org.elasticsearch.action.search.SearchResponse;
3736
import org.elasticsearch.action.update.UpdateResponse;
3837

39-
import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.ELASTICSEARCH_DSL_LENGTH_THRESHOLD;
40-
import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL;
38+
import java.lang.reflect.Method;
39+
40+
import static org.apache.skywalking.apm.plugin.elasticsearch.v7.ElasticsearchPluginConfig.Plugin.Elasticsearch.ELASTICSEARCH_DSL_LENGTH_THRESHOLD;
41+
import static org.apache.skywalking.apm.plugin.elasticsearch.v7.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL;
4142

4243
public class AdapterActionFutureActionGetMethodsInterceptor implements InstanceMethodsAroundInterceptor {
4344

0 commit comments

Comments
 (0)