diff --git a/.github/workflows/plugins-test.1.yaml b/.github/workflows/plugins-test.1.yaml index a05aa43a67cc..f9fdd74b94f6 100644 --- a/.github/workflows/plugins-test.1.yaml +++ b/.github/workflows/plugins-test.1.yaml @@ -38,6 +38,7 @@ jobs: - { name: 'httpclient-3.x-scenario', title: 'HttpClient 2.0-3.1 (5)' } - { name: 'httpclient-4.3.x-scenario', title: 'HttpClient 4.3.x-4.5.x (14)' } - { name: 'hystrix-scenario', title: 'Hystrix 1.4.20-1.5.12 (20)' } + - { name: 'influxdb-scenario', title: 'InfluxDB Java 2.5-2.17 (12)' } - { name: 'jdk-http-scenario', title: 'JDK http (1)' } - { name: 'jdk-threading-scenario', title: 'JDK Threading (1)' } - { name: 'jedis-scenario', title: 'Jedis 2.4.0-2.9.0 (18)' } diff --git a/.gitignore b/.gitignore index cc89988ebab6..cd2d1bd2c270 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ OALLexer.tokens .externalToolBuilders /test/plugin/dist /test/plugin/workspace +/test/jacoco/classes +/test/jacoco/*.exec \ No newline at end of file diff --git a/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java b/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java index 963baa04d0ba..70bd828de660 100755 --- a/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java +++ b/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java @@ -160,4 +160,6 @@ public class ComponentsDefine { public static final OfficialComponent MARIADB_JDBC = new OfficialComponent(87, "mariadb-jdbc"); public static final OfficialComponent QUASAR = new OfficialComponent(88, "quasar"); + + public static final OfficialComponent INFLUXDB_JAVA = new OfficialComponent(90, "influxdb-java"); } diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java index 172015f3f243..e6e4ffb91f46 100755 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java @@ -399,6 +399,13 @@ public static class Http { */ public static int HTTP_PARAMS_LENGTH_THRESHOLD = 1024; } + + public static class InfluxDB { + /** + * If set to true, the parameters of the InfluxQL would be collected. + */ + public static boolean TRACE_INFLUXQL = true; + } } public static class Correlation { diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/pom.xml new file mode 100644 index 000000000000..67c7d9269209 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/pom.xml @@ -0,0 +1,47 @@ + + + + + + apm-sdk-plugin + org.apache.skywalking + 8.1.0-SNAPSHOT + + 4.0.0 + + apm-influxdb-2.x-plugin + This plugin is for use with influxdb-java client + + + UTF-8 + 2.15 + + + + + org.influxdb + influxdb-java + ${influxdb-jave.version} + provided + + + + \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/define/Constants.java b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/define/Constants.java new file mode 100644 index 000000000000..a83efd2423eb --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/define/Constants.java @@ -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.influxdb.define; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * InfluxDB plugin Constants + * + * @since 2020/6/6 + */ +public class Constants { + + public static final String DB_TYPE = "InfluxDB"; + + public static final String PING_METHOD = "ping"; + public static final String WRITE_METHOD = "write"; + public static final String QUERY_METHOD = "query"; + public static final String CREATE_DATABASE_METHOD = "createDatabase"; + public static final String DELETE_DATABASE_METHOD = "deleteDatabase"; + public static final String FLUSH_METHOD = "flush"; + public static final String CREATE_RETENTION_POLICY_METHOD = "createRetentionPolicy"; + public static final String DROP_RETENTION_POLICY_METHOD = "dropRetentionPolicy"; + + public static final Set MATCHER_METHOD_NAME = new HashSet<>(Arrays.asList(PING_METHOD, WRITE_METHOD, QUERY_METHOD, CREATE_DATABASE_METHOD, DELETE_DATABASE_METHOD, FLUSH_METHOD, CREATE_RETENTION_POLICY_METHOD, DROP_RETENTION_POLICY_METHOD)); + +} diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/define/InfluxDBInstrumentation.java b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/define/InfluxDBInstrumentation.java new file mode 100644 index 000000000000..3570975f447c --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/define/InfluxDBInstrumentation.java @@ -0,0 +1,100 @@ +/* + * 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.influxdb.define; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import net.bytebuddy.matcher.ElementMatchers; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; +import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch; + +import java.util.Set; + +import static net.bytebuddy.matcher.ElementMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.none; + + +/** + * Enhance InfluxDB InfluxDBFactory + * Really impl class {@link org.influxdb.impl.InfluxDBImpl} + * + * @since 2020/05/22 + */ +public class InfluxDBInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { + + private static final String ENHANCE_CLASS = "org.influxdb.impl.InfluxDBImpl"; + private static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.influxdb.interceptor.InfluxDBConstructorInterceptor"; + private static final String INFLUXDB_METHOD_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.influxdb.interceptor.InfluxDBMethodInterceptor"; + + @Override + protected ClassMatch enhanceClass() { + return NameMatch.byName(ENHANCE_CLASS); + } + + @Override + public ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[] { + new ConstructorInterceptPoint() { + @Override + public ElementMatcher getConstructorMatcher() { + return ElementMatchers.takesArgument(0, String.class); + } + + @Override + public String getConstructorInterceptor() { + return INTERCEPTOR_CLASS; + } + } + }; + } + + @Override + public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return new InstanceMethodsInterceptPoint[] { + new InstanceMethodsInterceptPoint() { + @Override + public ElementMatcher getMethodsMatcher() { + ElementMatcher.Junction matcher = none(); + final Set setters = Constants.MATCHER_METHOD_NAME; + for (String setter : setters) { + matcher = matcher.or(named(setter)); + } + return matcher; + } + + @Override + public String getMethodsInterceptor() { + return getInstanceMethodsInterceptor(); + } + + @Override + public boolean isOverrideArgs() { + return false; + } + } + }; + } + + protected String getInstanceMethodsInterceptor() { + return INFLUXDB_METHOD_INTERCEPT_CLASS; + } +} diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBConstructorInterceptor.java b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBConstructorInterceptor.java new file mode 100644 index 000000000000..d73f9f1bda2a --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBConstructorInterceptor.java @@ -0,0 +1,32 @@ +/* + * 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.influxdb.interceptor; + +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; + +public class InfluxDBConstructorInterceptor implements InstanceConstructorInterceptor { + + @Override + public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { + String url = (String) allArguments[0]; + objInst.setSkyWalkingDynamicField(url); + } + +} diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBMethodInterceptor.java new file mode 100644 index 000000000000..252cc6434b94 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBMethodInterceptor.java @@ -0,0 +1,98 @@ +/* + * 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.influxdb.interceptor; + +import org.apache.skywalking.apm.agent.core.conf.Config; +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.context.tag.Tags; +import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; +import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; +import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; +import org.apache.skywalking.apm.plugin.influxdb.define.Constants; +import org.influxdb.dto.BatchPoints; +import org.influxdb.dto.Point; +import org.influxdb.dto.Query; + +import java.lang.reflect.Method; + +import static org.apache.skywalking.apm.plugin.influxdb.define.Constants.DB_TYPE; + +public class InfluxDBMethodInterceptor implements InstanceMethodsAroundInterceptor { + + @Override + public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, + MethodInterceptResult result) throws Throwable { + String methodName = method.getName(); + String peer = String.valueOf(objInst.getSkyWalkingDynamicField()); + AbstractSpan span = ContextManager.createExitSpan("InfluxDB/" + methodName, peer); + span.setComponent(ComponentsDefine.INFLUXDB_JAVA); + SpanLayer.asDB(span); + Tags.DB_TYPE.set(span, DB_TYPE); + + if (allArguments.length <= 0 || !Config.Plugin.InfluxDB.TRACE_INFLUXQL) { + return; + } + + if (allArguments[0] instanceof Query) { + Query query = (Query) allArguments[0]; + Tags.DB_INSTANCE.set(span, query.getDatabase()); + Tags.DB_STATEMENT.set(span, query.getCommand()); + return; + } + + if (Constants.WRITE_METHOD.equals(methodName)) { + if (allArguments[0] instanceof BatchPoints) { + BatchPoints batchPoints = (BatchPoints) allArguments[0]; + Tags.DB_INSTANCE.set(span, batchPoints.getDatabase()); + Tags.DB_STATEMENT.set(span, batchPoints.lineProtocol()); + return; + } + if (allArguments.length == 5) { + if (allArguments[0] instanceof String) { + Tags.DB_INSTANCE.set(span, (String) allArguments[0]); + } + if (allArguments[4] instanceof String) { + Tags.DB_STATEMENT.set(span, (String) allArguments[4]); + } + return; + } + if (allArguments.length == 3 && allArguments[2] instanceof Point) { + Tags.DB_INSTANCE.set(span, (String) allArguments[0]); + Tags.DB_STATEMENT.set(span, ((Point) allArguments[2]).lineProtocol()); + } + } + + } + + @Override + public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, + Object ret) throws Throwable { + ContextManager.stopSpan(); + return ret; + } + + @Override + public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, Throwable t) { + ContextManager.activeSpan().errorOccurred().log(t); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/resources/skywalking-plugin.def new file mode 100644 index 000000000000..ae831a911464 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/resources/skywalking-plugin.def @@ -0,0 +1,17 @@ +# 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. + +influxdb-2.x=org.apache.skywalking.apm.plugin.influxdb.define.InfluxDBInstrumentation diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/influxdb/InfluxDBConstructorInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/influxdb/InfluxDBConstructorInterceptorTest.java new file mode 100644 index 000000000000..434dff094dcb --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/influxdb/InfluxDBConstructorInterceptorTest.java @@ -0,0 +1,65 @@ +/* + * 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.influxdb; + +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.plugin.influxdb.interceptor.InfluxDBConstructorInterceptor; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.mockito.Mockito.verify; + +@RunWith(MockitoJUnitRunner.class) +public class InfluxDBConstructorInterceptorTest { + + private static final String INFLUXDB_URL = "http://127.0.0.1:8086"; + + private InfluxDBConstructorInterceptor interceptor; + + @Mock + private EnhancedInstance enhancedInstance; + + @Before + public void setUp() throws Exception { + interceptor = new InfluxDBConstructorInterceptor(); + } + + @Test + public void onConstruct() throws Exception { + interceptor.onConstruct(enhancedInstance, new Object[] {INFLUXDB_URL}); + + verify(enhancedInstance).setSkyWalkingDynamicField(INFLUXDB_URL); + } + + @Test + public void onConstructWithUsernameAndPassword() { + interceptor.onConstruct(enhancedInstance, new Object[] { + INFLUXDB_URL, + "admin", + "123456", + null + }); + + verify(enhancedInstance).setSkyWalkingDynamicField(INFLUXDB_URL); + } + +} diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/influxdb/InfluxDBMethodInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/influxdb/InfluxDBMethodInterceptorTest.java new file mode 100644 index 000000000000..342b0a446f63 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/influxdb/InfluxDBMethodInterceptorTest.java @@ -0,0 +1,169 @@ +/* + * 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.influxdb; + +import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan; +import org.apache.skywalking.apm.agent.core.context.trace.LogDataEntity; +import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; +import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment; +import org.apache.skywalking.apm.agent.core.context.util.TagValuePair; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.test.helper.SegmentHelper; +import org.apache.skywalking.apm.agent.test.helper.SpanHelper; +import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule; +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.network.trace.component.ComponentsDefine; +import org.apache.skywalking.apm.plugin.influxdb.define.Constants; +import org.apache.skywalking.apm.plugin.influxdb.interceptor.InfluxDBMethodInterceptor; +import org.hamcrest.CoreMatchers; +import org.influxdb.InfluxDB; +import org.influxdb.InfluxDBException; +import org.influxdb.dto.Query; +import org.influxdb.impl.InfluxDBImpl; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.powermock.modules.junit4.PowerMockRunner; +import org.powermock.modules.junit4.PowerMockRunnerDelegate; + +import java.lang.reflect.Method; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import static junit.framework.TestCase.assertNotNull; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.Mockito.when; + +@RunWith(PowerMockRunner.class) +@PowerMockRunnerDelegate(TracingSegmentRunner.class) +public class InfluxDBMethodInterceptorTest { + + @SegmentStoragePoint + private SegmentStorage segmentStorage; + + @Rule + public AgentServiceRule serviceRule = new AgentServiceRule(); + + @Mock + private EnhancedInstance enhancedInstance; + + private InfluxDBMethodInterceptor interceptor; + + private Object[] writeArguments; + + private Class[] writeArgumentTypes; + + private Object[] queryArguments; + + private Class[] queryArgumentTypes; + + @Before + public void setUp() throws Exception { + // write + writeArguments = new Object[] { + "sw8", "auto_gen", InfluxDB.ConsistencyLevel.ALL, TimeUnit.SECONDS, + "weather,location=us-midwest temperature=82 1465839830100400200" + }; + writeArgumentTypes = new Class[] { + String.class, String.class, InfluxDB.ConsistencyLevel.class, TimeUnit.class, String.class + }; + + // query + queryArguments = new Object[] { + new Query("select * from weather limit 1", "sw8") + }; + queryArgumentTypes = new Class[] { + Query.class + }; + + interceptor = new InfluxDBMethodInterceptor(); + when(enhancedInstance.getSkyWalkingDynamicField()).thenReturn("http://127.0.0.1:8086"); + } + + @Test + public void testIntercept() throws Throwable { + interceptor.beforeMethod(enhancedInstance, getMockWriteMethod(), writeArguments, writeArgumentTypes, null); + interceptor.afterMethod(enhancedInstance, getMockQueryMethod(), queryArguments, queryArgumentTypes, null); + + TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0); + List spans = SegmentHelper.getSpans(traceSegment); + assertThat(spans.size(), is(1)); + assertWriteInfluxDBSpan(spans.get(0)); + } + + @Test + public void testInterceptWithException() throws Throwable { + interceptor.beforeMethod(enhancedInstance, getMockWriteMethod(), writeArguments, writeArgumentTypes, null); + interceptor.handleMethodException(enhancedInstance, getMockWriteMethod(), writeArguments, writeArgumentTypes, new InfluxDBException("test exception")); + interceptor.afterMethod(enhancedInstance, getMockWriteMethod(), writeArguments, writeArgumentTypes, null); + + TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0); + List spans = SegmentHelper.getSpans(traceSegment); + assertThat(spans.size(), is(1)); + assertWriteInfluxDBSpan(spans.get(0)); + + assertLogData(SpanHelper.getLogs(spans.get(0))); + } + + private void assertLogData(List logDataEntities) { + assertThat(logDataEntities.size(), is(1)); + LogDataEntity logData = logDataEntities.get(0); + Assert.assertThat(logData.getLogs().size(), is(4)); + Assert.assertThat(logData.getLogs().get(0).getValue(), + CoreMatchers.is("error")); + Assert.assertThat(logData.getLogs().get(1).getValue(), + CoreMatchers.is(InfluxDBException.class.getName())); + Assert.assertEquals("test exception", logData.getLogs().get(2).getValue()); + assertNotNull(logData.getLogs().get(3).getValue()); + } + + private void assertWriteInfluxDBSpan(AbstractTracingSpan span) { + assertThat(span.getOperationName(), is("InfluxDB/write")); + assertThat(span.isExit(), is(true)); + assertThat(SpanHelper.getComponentId(span), is(ComponentsDefine.INFLUXDB_JAVA.getId())); + List tags = SpanHelper.getTags(span); + assertThat(tags.get(0).getValue(), is(Constants.DB_TYPE)); + assertThat(SpanHelper.getLayer(span), CoreMatchers.is(SpanLayer.DB)); + } + + private Method getMockWriteMethod() { + try { + return InfluxDBImpl.class.getMethod(Constants.WRITE_METHOD, writeArgumentTypes); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + return null; + } + } + + private Method getMockQueryMethod() { + try { + return InfluxDBImpl.class.getMethod(Constants.QUERY_METHOD, queryArgumentTypes); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + return null; + } + } + +} diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml index b9e43a3d7fa3..e6076a4792fe 100644 --- a/apm-sniffer/apm-sdk-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/pom.xml @@ -92,6 +92,7 @@ finagle-6.25.x-plugin quasar-plugin mariadb-2.x-plugin + influxdb-2.x-plugin pom diff --git a/docs/en/setup/service-agent/java-agent/README.md b/docs/en/setup/service-agent/java-agent/README.md index 0c53d0c133b0..3a5973da5ff7 100755 --- a/docs/en/setup/service-agent/java-agent/README.md +++ b/docs/en/setup/service-agent/java-agent/README.md @@ -126,6 +126,7 @@ property key | Description | Default | `plugin.tomcat.collect_http_params`| This config item controls that whether the Tomcat plugin should collect the parameters of the request. Also, activate implicitly in the profiled trace. | `false` | `plugin.springmvc.collect_http_params`| This config item controls that whether the SpringMVC plugin should collect the parameters of the request, when your Spring application is based on Tomcat, consider only setting either `plugin.tomcat.collect_http_params` or `plugin.springmvc.collect_http_params`. Also, activate implicitly in the profiled trace. | `false` | `plugin.http.http_params_length_threshold`| When `COLLECT_HTTP_PARAMS` is enabled, how many characters to keep and send to the OAP backend, use negative values to keep and send the complete parameters, NB. this config item is added for the sake of performance. | `1024` | +`plugin.influxdb.trace_influxql`|If true, trace all the influxql(query and write) in InfluxDB access, default is true.|`true`| `correlation.element_max_number`|Max element count of the correlation context.|`3`| `correlation.value_max_length`|Max value length of correlation context element.|`128`| diff --git a/docs/en/setup/service-agent/java-agent/Supported-list.md b/docs/en/setup/service-agent/java-agent/Supported-list.md index d3321fa227e9..ef231ae4cd25 100644 --- a/docs/en/setup/service-agent/java-agent/Supported-list.md +++ b/docs/en/setup/service-agent/java-agent/Supported-list.md @@ -33,6 +33,7 @@ * [ShardingSphere](https://github.com/apache/shardingsphere) 3.0.0, 4.0.0-RC1, 4.0.0, 4.0.1, 4.1.0, 4.1.1 * PostgreSQL Driver 8.x, 9.x, 42.x * Mariadb Driver 2.x, 1.8 + * [InfluxDB](https://github.com/influxdata/influxdb-java) 2.5 -> 2.17 * RPC Frameworks * [Dubbo](https://github.com/alibaba/dubbo) 2.5.4 -> 2.6.0 * [Dubbox](https://github.com/dangdangdotcom/dubbox) 2.8.4 diff --git a/oap-server/server-bootstrap/src/main/resources/component-libraries.yml b/oap-server/server-bootstrap/src/main/resources/component-libraries.yml index bc3c384c59bd..f32de5e1dd7b 100755 --- a/oap-server/server-bootstrap/src/main/resources/component-libraries.yml +++ b/oap-server/server-bootstrap/src/main/resources/component-libraries.yml @@ -296,6 +296,12 @@ mariadb-jdbc: quasar: id: 88 languages: Java +InfluxDB: + id: 89 + languages: Java +influxdb-java: + id: 90 + languages: Java # .NET/.NET Core components # [3000, 4000) for C#/.NET only diff --git a/oap-server/server-core/src/test/resources/component-libraries.yml b/oap-server/server-core/src/test/resources/component-libraries.yml index 02ecbef9f6ea..480577586309 100755 --- a/oap-server/server-core/src/test/resources/component-libraries.yml +++ b/oap-server/server-core/src/test/resources/component-libraries.yml @@ -260,7 +260,12 @@ mariadb-jdbc: quasar: id: 88 languages: Java - +InfluxDB: + id: 89 + languages: Java +influxdb-java: + id: 90 + languages: Java # .NET/.NET Core components # [3000, 4000) for C#/.NET only diff --git a/pom.xml b/pom.xml index 3587dc5b7f87..cb41c46fd998 100755 --- a/pom.xml +++ b/pom.xml @@ -486,6 +486,7 @@ **/test/plugin/workspace/** + **/test/jacoco/** **/*.crt diff --git a/test/plugin/scenarios/influxdb-scenario/bin/startup.sh b/test/plugin/scenarios/influxdb-scenario/bin/startup.sh new file mode 100644 index 000000000000..828221bd4712 --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/bin/startup.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# +# 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. + +home="$(cd "$(dirname $0)"; pwd)" + +java -jar ${agent_opts} -Dinfluxdb.url=${INFLUXDB_URL} \ +${home}/../libs/influxdb-scenario.jar & \ No newline at end of file diff --git a/test/plugin/scenarios/influxdb-scenario/config/expectedData.yaml b/test/plugin/scenarios/influxdb-scenario/config/expectedData.yaml new file mode 100644 index 000000000000..d92d008828fa --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/config/expectedData.yaml @@ -0,0 +1,131 @@ +# 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: influxdb-scenario + segmentSize: gt 1 + segments: + - segmentId: not null + spans: + - operationName: InfluxDB/ping + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: Database + startTime: nq 0 + endTime: nq 0 + componentId: 90 + isError: false + spanType: Exit + peer: http://influxdb:8086 + tags: + - {key: db.type, value: InfluxDB} + skipAnalysis: 'false' + - operationName: /influxdb-scenario/case/healthCheck + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: Http + startTime: nq 0 + endTime: nq 0 + componentId: 1 + isError: false + spanType: Entry + peer: '' + skipAnalysis: false + tags: + - {key: url, value: 'http://localhost:8080/influxdb-scenario/case/healthCheck'} + - {key: http.method, value: HEAD} + - segmentId: not null + spans: + - operationName: InfluxDB/query + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: Database + startTime: nq 0 + endTime: nq 0 + componentId: 90 + isError: false + spanType: Exit + peer: http://influxdb:8086 + tags: + - {key: db.type, value: InfluxDB} + - {key: db.instance, value: skywalking} + - {key: db.statement, value: 'CREATE DATABASE skywalking'} + skipAnalysis: 'false' + - operationName: InfluxDB/query + operationId: 0 + parentSpanId: 0 + spanId: 2 + spanLayer: Database + startTime: nq 0 + endTime: nq 0 + componentId: 90 + isError: false + spanType: Exit + peer: http://influxdb:8086 + tags: + - {key: db.type, value: InfluxDB} + - {key: db.instance, value: skywalking} + - {key: db.statement, value: 'CREATE RETENTION POLICY one_day ON skywalking DURATION 1d REPLICATION 1 DEFAULT'} + skipAnalysis: 'false' + - operationName: InfluxDB/write + operationId: 0 + parentSpanId: 0 + spanId: 3 + spanLayer: Database + startTime: nq 0 + endTime: nq 0 + componentId: 90 + isError: false + spanType: Exit + peer: http://influxdb:8086 + tags: + - {key: db.type, value: InfluxDB} + - {key: db.instance, value: skywalking} + - {key: db.statement, value: not null} + skipAnalysis: 'false' + - operationName: InfluxDB/query + operationId: 0 + parentSpanId: 0 + spanId: 4 + spanLayer: Database + startTime: nq 0 + endTime: nq 0 + componentId: 90 + isError: false + spanType: Exit + peer: http://influxdb:8086 + tags: + - {key: db.type, value: InfluxDB} + - {key: db.instance, value: skywalking} + - {key: db.statement, value: 'SELECT * FROM heartbeat'} + skipAnalysis: 'false' + - operationName: /influxdb-scenario/case/influxdb-scenario + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: Http + startTime: nq 0 + endTime: nq 0 + componentId: 1 + isError: false + spanType: Entry + peer: '' + tags: + - {key: url, value: 'http://localhost:8080/influxdb-scenario/case/influxdb-scenario'} + - {key: http.method, value: GET} + skipAnalysis: 'false' diff --git a/test/plugin/scenarios/influxdb-scenario/configuration.yml b/test/plugin/scenarios/influxdb-scenario/configuration.yml new file mode 100644 index 000000000000..5b7ec58e94ef --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/configuration.yml @@ -0,0 +1,27 @@ +# 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. + +type: jvm +entryService: http://localhost:8080/influxdb-scenario/case/influxdb-scenario +healthCheck: http://localhost:8080/influxdb-scenario/case/healthCheck +startScript: ./bin/startup.sh +environment: + - INFLUXDB_URL=http://influxdb:8086 +dependencies: + influxdb: + image: influxdb:1.7.10 + hostname: influxdb + diff --git a/test/plugin/scenarios/influxdb-scenario/pom.xml b/test/plugin/scenarios/influxdb-scenario/pom.xml new file mode 100644 index 000000000000..6a1a80870d7d --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/pom.xml @@ -0,0 +1,114 @@ + + + + + org.apache.skywalking.apm.testcase + influxdb-scenario + 1.0.0 + jar + + 4.0.0 + + + UTF-8 + 1.8 + 2.1.6.RELEASE + 2.17 + + + skywalking-influxdb-scenario + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot-version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.influxdb + influxdb-java + ${test.framework.version} + + + + junit + junit + test + + + + + influxdb-scenario + + + org.springframework.boot + spring-boot-maven-plugin + 1.5.9.RELEASE + + + + repackage + + + + + + maven-compiler-plugin + + ${compiler.version} + ${compiler.version} + ${project.build.sourceEncoding} + + + + org.apache.maven.plugins + maven-assembly-plugin + + + assemble + package + + single + + + + src/main/assembly/assembly.xml + + ./target/ + + + + + + + + \ No newline at end of file diff --git a/test/plugin/scenarios/influxdb-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/influxdb-scenario/src/main/assembly/assembly.xml new file mode 100644 index 000000000000..52939ceb0a9b --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/src/main/assembly/assembly.xml @@ -0,0 +1,41 @@ + + + + + zip + + + + + ./bin + 0775 + + + + + + ${project.build.directory}/influxdb-scenario.jar + ./libs + 0775 + + + diff --git a/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/Application.java b/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/Application.java new file mode 100644 index 000000000000..621986d7e407 --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/Application.java @@ -0,0 +1,34 @@ +/* + * 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.testcase.influxdb; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + try { + SpringApplication.run(Application.class, args); + } catch (Exception e) { + // Never do this + } + } +} diff --git a/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/controller/CaseController.java b/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/controller/CaseController.java new file mode 100644 index 000000000000..ab9c43d9aebf --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/controller/CaseController.java @@ -0,0 +1,70 @@ +/* + * 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.testcase.influxdb.controller; + +import org.apache.skywalking.apm.testcase.influxdb.executor.InfluxDBExecutor; +import org.influxdb.dto.Point; +import org.influxdb.dto.Pong; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.concurrent.TimeUnit; + +@RestController +@RequestMapping("/case") +public class CaseController { + + private static final String SUCCESS = "Success"; + private static final String ERROR = "Error"; + + @Value("${influxdb.url:http://127.0.0.1:8086}") + private String serverURL; + + @RequestMapping("/influxdb-scenario") + @ResponseBody + public String testcase(){ + InfluxDBExecutor executor = new InfluxDBExecutor(serverURL); + // createDatabase + String db = "skywalking"; + executor.createDatabase(db); + // createRetentionPolicy + String rp = "one_day"; + executor.createRetentionPolicyWithOneDay(db,rp); + Point point = Point.measurement("heartbeat") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .tag("host", "127.0.0.1") + .addField("device_name", "sensor x") + .build(); + // write + executor.write(db,rp,point); + // query + executor.query(db,"SELECT * FROM heartbeat"); + return SUCCESS; + } + + @RequestMapping("/healthCheck") + @ResponseBody + public String healthCheck() { + InfluxDBExecutor executor = new InfluxDBExecutor(serverURL); + Pong pong = executor.ping(); + return pong.getVersion() != null ? SUCCESS : ERROR; + } +} diff --git a/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/executor/InfluxDBExecutor.java b/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/executor/InfluxDBExecutor.java new file mode 100644 index 000000000000..857b60605447 --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/src/main/java/org/apache/skywalking/apm/testcase/influxdb/executor/InfluxDBExecutor.java @@ -0,0 +1,68 @@ +/* + * 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.testcase.influxdb.executor; + +import org.influxdb.InfluxDB; +import org.influxdb.InfluxDBFactory; +import org.influxdb.dto.Point; +import org.influxdb.dto.Pong; +import org.influxdb.dto.Query; +import org.influxdb.dto.QueryResult; + +public class InfluxDBExecutor implements AutoCloseable { + + private final InfluxDB influxDB; + + public InfluxDBExecutor(String serverURL){ + influxDB = InfluxDBFactory.connect(serverURL,"admin",null); + } + + public Pong ping(){ + return influxDB.ping(); + } + + public QueryResult createDatabase(String databaseName){ + // Create a database... + return influxDB.query(new Query("CREATE DATABASE " + databaseName, databaseName)); + } + + public QueryResult createRetentionPolicyWithOneDay(String databaseName, String retentionPolicyName){ +// influxDB.setDatabase(databaseName); + // ... and a retention policy, if necessary. + return influxDB.query(new Query("CREATE RETENTION POLICY " + retentionPolicyName + " ON " + databaseName + " DURATION 1d REPLICATION 1 DEFAULT", databaseName)); + } + + public void write(String databaseName, String retentionPolicyName,Point point){ + // Write points to InfluxDB. + influxDB.write(databaseName, retentionPolicyName, point); + } + + public QueryResult query(String databaseName,String command){ + // Query your data using InfluxQL. + return influxDB.query(new Query(command, databaseName)); + } + + @Override + public void close() throws Exception { + if (influxDB != null){ + // Close it if your application is terminating or you are not using it anymore. + influxDB.close(); + } + } +} diff --git a/test/plugin/scenarios/influxdb-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/influxdb-scenario/src/main/resources/application.yaml new file mode 100644 index 000000000000..9b213e923b20 --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/src/main/resources/application.yaml @@ -0,0 +1,21 @@ +# +# 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. +# +# +server: + port: 8080 + servlet: + context-path: /influxdb-scenario \ No newline at end of file diff --git a/test/plugin/scenarios/influxdb-scenario/support-version.list b/test/plugin/scenarios/influxdb-scenario/support-version.list new file mode 100644 index 000000000000..9c2cb6dff9ae --- /dev/null +++ b/test/plugin/scenarios/influxdb-scenario/support-version.list @@ -0,0 +1,30 @@ +# 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 +# "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. + + +2.17 +2.16 +2.15 +2.14 +2.13 +2.12 +2.11 +2.10 +2.9 +2.8 +2.7 +2.6 +2.5 \ No newline at end of file