├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── build.yml │ └── license-checker.yml ├── .gitignore ├── .licenserc.yaml ├── AOSP-Checkstyles.xml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── build ├── pom.xml └── src │ ├── assembly │ └── src.xml │ └── main │ ├── java │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── StartBootstrap.java │ └── resources │ ├── agent-to-cloud_1.0.properties │ ├── agent.properties │ ├── easeagent-log4j2.xml │ └── user-minimal-cfg.properties ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── config │ │ ├── AutoRefreshConfigItem.java │ │ ├── CompatibilityConversion.java │ │ ├── ConfigAware.java │ │ ├── ConfigFactory.java │ │ ├── ConfigLoader.java │ │ ├── ConfigManagerMXBean.java │ │ ├── ConfigNotifier.java │ │ ├── ConfigPropertiesUtils.java │ │ ├── ConfigUtils.java │ │ ├── Configs.java │ │ ├── GlobalConfigs.java │ │ ├── JarFileConfigLoader.java │ │ ├── OtelSdkConfigs.java │ │ ├── PluginConfig.java │ │ ├── PluginConfigManager.java │ │ ├── PluginProperty.java │ │ ├── PluginSourceConfig.java │ │ ├── ValidateUtils.java │ │ ├── WrappedConfigManager.java │ │ ├── report │ │ ├── ReportConfigAdapter.java │ │ └── ReportConfigConst.java │ │ └── yaml │ │ └── YamlReader.java │ └── test │ ├── java │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── config │ │ ├── CompatibilityConversionTest.java │ │ ├── ConfigFactoryTest.java │ │ ├── ConfigPropertiesUtilsTest.java │ │ ├── ConfigUtilsTest.java │ │ ├── ConfigsTest.java │ │ ├── IPluginConfigConstTest.java │ │ ├── JarFileConfigLoaderTest.java │ │ ├── OtelSdkConfigsTest.java │ │ ├── PluginConfigManagerTest.java │ │ ├── PluginConfigTest.java │ │ ├── PluginPropertyTest.java │ │ ├── PluginSourceConfigTest.java │ │ ├── ValidateUtilsTest.java │ │ ├── report │ │ └── ReportConfigAdapterTest.java │ │ └── yaml │ │ └── YamlReaderTest.java │ └── resources │ ├── agent.properties │ ├── agent.yaml │ ├── easeagent_config.jar │ ├── user-spec.properties │ ├── user-spec2.properties │ └── user.properties ├── context ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── context │ │ ├── AsyncContextImpl.java │ │ ├── ContextManager.java │ │ ├── GlobalContext.java │ │ ├── ProgressFieldsManager.java │ │ ├── RetBound.java │ │ ├── SessionContext.java │ │ └── log │ │ ├── LoggerFactoryImpl.java │ │ ├── LoggerImpl.java │ │ └── LoggerMdc.java │ └── test │ ├── java │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── context │ │ ├── AsyncContextImplTest.java │ │ ├── ContextManagerTest.java │ │ ├── GlobalContextTest.java │ │ ├── ProgressFieldsManagerTest.java │ │ ├── RetBoundTest.java │ │ ├── SessionContextTest.java │ │ └── log │ │ ├── LoggerFactoryImplTest.java │ │ ├── LoggerImplTest.java │ │ └── LoggerMdcTest.java │ └── resources │ └── log4j2.xml ├── core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── core │ │ │ ├── AppendBootstrapClassLoaderSearch.java │ │ │ ├── Bootstrap.java │ │ │ ├── GlobalAgentHolder.java │ │ │ ├── config │ │ │ ├── CanaryListUpdateAgentHttpHandler.java │ │ │ ├── CanaryUpdateAgentHttpHandler.java │ │ │ ├── ConfigsUpdateAgentHttpHandler.java │ │ │ ├── PluginPropertiesHttpHandler.java │ │ │ ├── PluginPropertyHttpHandler.java │ │ │ └── ServiceUpdateAgentHttpHandler.java │ │ │ ├── health │ │ │ └── HealthProvider.java │ │ │ ├── info │ │ │ ├── AgentInfoFactory.java │ │ │ └── AgentInfoProvider.java │ │ │ ├── plugin │ │ │ ├── BaseLoader.java │ │ │ ├── BridgeDispatcher.java │ │ │ ├── CommonInlineAdvice.java │ │ │ ├── Dispatcher.java │ │ │ ├── PluginLoader.java │ │ │ ├── annotation │ │ │ │ ├── EaseAgentInstrumented.java │ │ │ │ └── Index.java │ │ │ ├── interceptor │ │ │ │ ├── InterceptorPluginDecorator.java │ │ │ │ ├── ProviderChain.java │ │ │ │ └── ProviderPluginDecorator.java │ │ │ ├── matcher │ │ │ │ ├── ClassLoaderMatcherConvert.java │ │ │ │ ├── ClassMatcherConvert.java │ │ │ │ ├── ClassTransformation.java │ │ │ │ ├── Converter.java │ │ │ │ ├── MethodMatcherConvert.java │ │ │ │ └── MethodTransformation.java │ │ │ ├── registry │ │ │ │ ├── AdviceRegistry.java │ │ │ │ └── PluginRegistry.java │ │ │ └── transformer │ │ │ │ ├── AnnotationTransformer.java │ │ │ │ ├── CompoundPluginTransformer.java │ │ │ │ ├── DynamicFieldAdvice.java │ │ │ │ ├── DynamicFieldTransformer.java │ │ │ │ ├── ForAdviceTransformer.java │ │ │ │ ├── advice │ │ │ │ ├── AgentAdvice.java │ │ │ │ ├── AgentForAdvice.java │ │ │ │ ├── AgentJavaConstantValue.java │ │ │ │ ├── BypassMethodVisitor.java │ │ │ │ └── MethodIdentityJavaConstant.java │ │ │ │ └── classloader │ │ │ │ └── CompoundClassloader.java │ │ │ └── utils │ │ │ ├── AgentArray.java │ │ │ ├── ContextUtils.java │ │ │ ├── JsonUtil.java │ │ │ ├── MutableObject.java │ │ │ ├── ServletUtils.java │ │ │ └── TextUtils.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ └── com.megaease.easeagent.plugin.bean.BeanProvider │ │ └── version.txt │ └── test │ └── java │ └── com │ └── megaease │ └── easeagent │ └── core │ ├── AppendBootstrapClassLoaderSearchTest.java │ ├── BootstrapTest.java │ ├── HttpServerTest.java │ ├── info │ └── AgentInfoFactoryTest.java │ ├── instrument │ ├── ClinitMethodTransformTest.java │ ├── NewInstanceMethodTransformTest.java │ ├── NonStaticMethodTransformTest.java │ ├── OrchestrationTransformTest.java │ ├── StaticMethodTransformTest.java │ ├── TestContext.java │ ├── TestPlugin.java │ └── TransformTestBase.java │ ├── matcher │ ├── ClassLoaderMatcherTest.java │ ├── ClassMatcherTest.java │ └── MethodMatcherTest.java │ └── utils │ └── AgentAttachmentRule.java ├── doc ├── add-plugin-demo.md ├── benchmark.md ├── context.md ├── criteria-for-configuring-priorities.md ├── development-guide.md ├── how-to-use │ ├── megacloud-config.md │ ├── use-in-docker.md │ └── use-on-host.md ├── images │ ├── Context-span-api.png │ ├── Cross-server-tracing-UML.png │ ├── Cross-thread-tracing-UML.png │ ├── EaseAgent-Architecture-Base-v2.0.png │ ├── EaseAgent-Architecture-v2.0.jpg │ ├── EaseAgent-Architecture-v2.0.png │ ├── EaseAgent-Architecture.jpg │ ├── MessageTracing-UML.png │ ├── Metric-Class-UML.png │ ├── Metric-SequenceDiagram-UML.png │ ├── SessionContext.png │ ├── Span-tracing-UML.png │ ├── benchmark │ │ ├── 10t-mem-heap.png │ │ ├── 10t-process-cpu-load-mean.png │ │ ├── 10t-resp-per-15seconds.png │ │ ├── 10t-resp-time-p75.png │ │ ├── 20t-mem-heap.png │ │ ├── 20t-process-cpu-load-mean.png │ │ ├── 20t-resp-per-15seconds.png │ │ ├── 20t-resp-time-p75.png │ │ ├── 50t-mem-heap.png │ │ ├── 50t-process-cpu-load-mean.png │ │ ├── 50t-resp-per-15seconds.png │ │ ├── 50t-resp-time-p75.png │ │ ├── agent-320vus-mem.png │ │ ├── agent-320vus-process-cpu-load.png │ │ ├── agent-mem.png │ │ ├── agent-process-cpu-load.png │ │ ├── baseline-320vus-mem.png │ │ ├── baseline-320vus-process-cpu-load.png │ │ ├── baseline-cpu-load.png │ │ ├── baseline-mem.png │ │ └── baseline-process-cpu-load.png │ ├── enhancement-debug.png │ ├── grafana-metric.png │ ├── grafana-tracing.png │ ├── httpServletPlugin-module.jpg │ ├── plugin-structure.png │ ├── prometheus-demo-1.png │ ├── prometheus-demo-2.png │ ├── prometheus-demo.jpg │ ├── prometheus-petclinic-demo.png │ ├── session-RunnableImplUML.png │ ├── simple-plugin.jpg │ ├── slack-community.jpg │ ├── trace-and-span.png │ └── zipkin-span.jpg ├── matcher-DSL.md ├── metric-api.md ├── plugin-unit-test.md ├── prometheus-metric-schedule.md ├── report-development-guide.md ├── spring-petclinic-demo.md ├── tracing-api.md └── user-manual.md ├── httpserver ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── megaease │ └── easeagent │ └── httpserver │ ├── HttpRequest.java │ ├── HttpResponse.java │ ├── IHttpHandler.java │ ├── IHttpServer.java │ ├── jdk │ ├── AgentHttpServerV2.java │ ├── RootContextHandler.java │ └── UriResource.java │ ├── nano │ ├── AgentHttpHandler.java │ ├── AgentHttpHandlerProvider.java │ └── AgentHttpServer.java │ └── nanohttpd │ ├── protocols │ └── http │ │ ├── ClientHandler.java │ │ ├── HTTPSession.java │ │ ├── IHTTPSession.java │ │ ├── NanoHTTPD.java │ │ ├── ServerRunnable.java │ │ ├── content │ │ ├── ContentType.java │ │ ├── Cookie.java │ │ └── CookieHandler.java │ │ ├── request │ │ └── Method.java │ │ ├── response │ │ ├── ChunkedOutputStream.java │ │ ├── IStatus.java │ │ ├── Response.java │ │ └── Status.java │ │ ├── sockets │ │ ├── DefaultServerSocketFactory.java │ │ └── SecureServerSocketFactory.java │ │ ├── tempfiles │ │ ├── DefaultTempFile.java │ │ ├── DefaultTempFileManager.java │ │ ├── DefaultTempFileManagerFactory.java │ │ ├── ITempFile.java │ │ └── ITempFileManager.java │ │ └── threading │ │ ├── DefaultAsyncRunner.java │ │ └── IAsyncRunner.java │ ├── router │ └── RouterNanoHTTPD.java │ └── util │ ├── IFactory.java │ ├── IFactoryThrowing.java │ ├── IHandler.java │ └── ServerRunner.java ├── loader ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── megaease │ └── easeagent │ ├── JarUtils.java │ ├── Main.java │ └── StringSequence.java ├── log4j2 ├── README.md ├── log4j2-api │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── log4j2 │ │ ├── ClassLoaderUtils.java │ │ ├── ClassloaderSupplier.java │ │ ├── FinalClassloaderSupplier.java │ │ ├── Logger.java │ │ ├── LoggerFactory.java │ │ ├── MDC.java │ │ ├── api │ │ ├── AgentLogger.java │ │ ├── AgentLoggerFactory.java │ │ ├── ILevel.java │ │ └── Mdc.java │ │ └── exception │ │ └── Log4j2Exception.java ├── log4j2-impl │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── log4j2 │ │ └── impl │ │ ├── AgentLoggerProxy.java │ │ ├── LoggerProxyFactory.java │ │ ├── MdcProxy.java │ │ └── Slf4jLogger.java └── pom.xml ├── metrics ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── metrics │ │ │ ├── AgentScheduledReporter.java │ │ │ ├── AutoRefreshReporter.java │ │ │ ├── MetricBeanProviderImpl.java │ │ │ ├── MetricProviderImpl.java │ │ │ ├── MetricRegistryService.java │ │ │ ├── PrometheusAgentHttpHandler.java │ │ │ ├── config │ │ │ ├── MetricsCollectorConfig.java │ │ │ ├── MetricsConfig.java │ │ │ └── PluginMetricsConfig.java │ │ │ ├── converter │ │ │ ├── AbstractConverter.java │ │ │ ├── Converter.java │ │ │ ├── ConverterAdapter.java │ │ │ ├── EaseAgentPrometheusExports.java │ │ │ ├── IgnoreOutputException.java │ │ │ ├── KeyType.java │ │ │ └── MetricsAdditionalAttributes.java │ │ │ ├── impl │ │ │ ├── CounterImpl.java │ │ │ ├── GaugeImpl.java │ │ │ ├── HistogramImpl.java │ │ │ ├── MeterImpl.java │ │ │ ├── MetricInstance.java │ │ │ ├── MetricRegistryImpl.java │ │ │ ├── SnapshotImpl.java │ │ │ └── TimerImpl.java │ │ │ ├── jvm │ │ │ ├── JvmBeanProvider.java │ │ │ ├── gc │ │ │ │ └── JVMGCMetricV2.java │ │ │ └── memory │ │ │ │ └── JVMMemoryMetricV2.java │ │ │ └── model │ │ │ └── JVMMemoryGaugeMetricModel.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.megaease.easeagent.plugin.bean.BeanProvider │ └── test │ ├── java │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── metrics │ │ ├── MetricProviderImplTest.java │ │ ├── MetricRegistryServiceTest.java │ │ ├── PrometheusAgentHttpHandlerTest.java │ │ ├── TestConst.java │ │ ├── config │ │ └── PluginMetricsConfigTest.java │ │ ├── converter │ │ ├── AbstractConverterTest.java │ │ ├── ConverterAdapterTest.java │ │ ├── IgnoreOutputExceptionTest.java │ │ └── MetricsAdditionalAttributesTest.java │ │ ├── impl │ │ ├── CounterImplTest.java │ │ ├── GaugeImplTest.java │ │ ├── HistogramImplTest.java │ │ ├── MeterImplTest.java │ │ ├── MetricInstanceTest.java │ │ ├── MetricRegistryImplTest.java │ │ ├── MetricRegistryMock.java │ │ ├── MetricTestUtils.java │ │ ├── MockClock.java │ │ ├── SnapshotImplTest.java │ │ └── TimerImplTest.java │ │ └── jvm │ │ └── memory │ │ └── JVMMemoryMetricV2Test.java │ └── resources │ ├── log4j2.xml │ └── mock_agent.properties ├── mock ├── config-mock │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ ├── config │ │ │ └── MockConfigLoader.java │ │ │ └── mock │ │ │ └── config │ │ │ └── MockConfig.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── mock │ │ │ └── config │ │ │ └── MockConfigTest.java │ │ └── resources │ │ ├── mock_agent.properties │ │ └── mock_agent.yaml ├── context-mock │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── mock │ │ └── context │ │ ├── MockContext.java │ │ └── MockContextManager.java ├── log4j2-mock │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── megaease │ │ │ │ └── easeagent │ │ │ │ └── mock │ │ │ │ └── log4j2 │ │ │ │ ├── AllUrlsSupplier.java │ │ │ │ ├── DirUrlsSupplier.java │ │ │ │ ├── JarPathUrlsSupplier.java │ │ │ │ ├── JarUrlsSupplier.java │ │ │ │ ├── URLClassLoaderSupplier.java │ │ │ │ └── UrlSupplier.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── com.megaease.easeagent.log4j2.ClassloaderSupplier │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── log4j2 │ │ │ └── impl │ │ │ ├── AgentLoggerFactoryTest.java │ │ │ └── MDCTest.java │ │ └── resources │ │ └── log4j2.xml ├── metrics-mock │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── mock │ │ │ └── metrics │ │ │ ├── MetricTestUtils.java │ │ │ └── MockMetricProvider.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.megaease.easeagent.mock.utils.MockProvider ├── plugin-api-mock │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── mock │ │ │ └── plugin │ │ │ └── api │ │ │ ├── MockEaseAgent.java │ │ │ ├── junit │ │ │ ├── AfterStatement.java │ │ │ ├── BeforeStatement.java │ │ │ ├── EaseAgentJunit4ClassRunner.java │ │ │ └── ScopeMustBeCloseException.java │ │ │ └── utils │ │ │ ├── ConfigTestUtils.java │ │ │ ├── ContextUtils.java │ │ │ ├── InterceptorTestUtils.java │ │ │ ├── SpanTestUtils.java │ │ │ └── TagVerifier.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── mock │ │ │ └── plugin │ │ │ └── api │ │ │ ├── TestContext.java │ │ │ ├── TestEaseAgent.java │ │ │ ├── demo │ │ │ ├── InterceptorTest.java │ │ │ ├── M1MetricCollect.java │ │ │ └── MockEaseAgentTest.java │ │ │ └── utils │ │ │ └── ConfigTestUtilsTest.java │ │ └── resources │ │ └── log4j2.xml ├── pom.xml ├── report-mock │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── mock │ │ │ └── report │ │ │ ├── JsonReporter.java │ │ │ ├── MetricFlushable.java │ │ │ ├── MockAtomicReferenceReportSpanReport.java │ │ │ ├── MockReport.java │ │ │ ├── MockSpan.java │ │ │ ├── MockSpanReport.java │ │ │ └── impl │ │ │ ├── LastJsonReporter.java │ │ │ └── ZipkinMockSpanImpl.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── mock │ │ │ └── report │ │ │ └── MockReportTest.java │ │ └── resources │ │ └── log4j2.xml ├── utils-mock │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── mock │ │ └── utils │ │ ├── JdkHttpServer.java │ │ ├── MockProvider.java │ │ └── MockSystemEnv.java └── zipkin-mock │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ ├── brave │ │ │ ├── TracerTestUtils.java │ │ │ └── internal │ │ │ │ └── collect │ │ │ │ └── WeakConcurrentMapTestUtils.java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── mock │ │ │ └── zipkin │ │ │ └── MockTracingProvider.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.megaease.easeagent.mock.utils.MockProvider │ └── test │ └── java │ └── com │ └── megaease │ └── easeagent │ └── mock │ └── zipkin │ └── MockTracingProviderTest.java ├── plugin-api ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ ├── com │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ ├── AgentPlugin.java │ │ │ ├── AppendBootstrapLoader.java │ │ │ ├── Ordered.java │ │ │ ├── Points.java │ │ │ ├── annotation │ │ │ ├── AdviceTo.java │ │ │ ├── AdvicesTo.java │ │ │ ├── DynamicField.java │ │ │ └── Injection.java │ │ │ ├── api │ │ │ ├── Cleaner.java │ │ │ ├── Context.java │ │ │ ├── InitializeContext.java │ │ │ ├── ProgressFields.java │ │ │ ├── Reporter.java │ │ │ ├── config │ │ │ │ ├── AutoRefreshConfigSupplier.java │ │ │ │ ├── AutoRefreshPluginConfig.java │ │ │ │ ├── AutoRefreshPluginConfigImpl.java │ │ │ │ ├── AutoRefreshPluginConfigRegistry.java │ │ │ │ ├── ChangeItem.java │ │ │ │ ├── Config.java │ │ │ │ ├── ConfigChangeListener.java │ │ │ │ ├── ConfigConst.java │ │ │ │ ├── Const.java │ │ │ │ ├── IConfigFactory.java │ │ │ │ ├── IPluginConfig.java │ │ │ │ └── PluginConfigChangeListener.java │ │ │ ├── context │ │ │ │ ├── AsyncContext.java │ │ │ │ ├── ContextCons.java │ │ │ │ ├── ContextUtils.java │ │ │ │ ├── IContextManager.java │ │ │ │ └── RequestContext.java │ │ │ ├── dispatcher │ │ │ │ └── IDispatcher.java │ │ │ ├── health │ │ │ │ └── AgentHealth.java │ │ │ ├── logging │ │ │ │ ├── AccessLogInfo.java │ │ │ │ ├── ILoggerFactory.java │ │ │ │ ├── Logger.java │ │ │ │ └── Mdc.java │ │ │ ├── metric │ │ │ │ ├── Counter.java │ │ │ │ ├── Gauge.java │ │ │ │ ├── Histogram.java │ │ │ │ ├── Meter.java │ │ │ │ ├── Metric.java │ │ │ │ ├── MetricProvider.java │ │ │ │ ├── MetricRegistry.java │ │ │ │ ├── MetricRegistrySupplier.java │ │ │ │ ├── MetricSupplier.java │ │ │ │ ├── ServiceMetric.java │ │ │ │ ├── ServiceMetricRegistry.java │ │ │ │ ├── ServiceMetricSupplier.java │ │ │ │ ├── Snapshot.java │ │ │ │ ├── Timer.java │ │ │ │ └── name │ │ │ │ │ ├── ConverterType.java │ │ │ │ │ ├── MetricField.java │ │ │ │ │ ├── MetricName.java │ │ │ │ │ ├── MetricSubType.java │ │ │ │ │ ├── MetricType.java │ │ │ │ │ ├── MetricValueFetcher.java │ │ │ │ │ ├── NameFactory.java │ │ │ │ │ └── Tags.java │ │ │ ├── middleware │ │ │ │ ├── MiddlewareConstants.java │ │ │ │ ├── Redirect.java │ │ │ │ ├── RedirectProcessor.java │ │ │ │ ├── ResourceConfig.java │ │ │ │ └── Type.java │ │ │ ├── otlp │ │ │ │ └── common │ │ │ │ │ ├── AgentAttributes.java │ │ │ │ │ ├── AgentInstrumentLibInfo.java │ │ │ │ │ ├── AgentLogData.java │ │ │ │ │ ├── AgentLogDataImpl.java │ │ │ │ │ ├── LogMapper.java │ │ │ │ │ ├── OtlpSpanContext.java │ │ │ │ │ └── SemanticKey.java │ │ │ └── trace │ │ │ │ ├── Extractor.java │ │ │ │ ├── Getter.java │ │ │ │ ├── ITracing.java │ │ │ │ ├── Injector.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessagingRequest.java │ │ │ │ ├── MessagingTracing.java │ │ │ │ ├── Request.java │ │ │ │ ├── Response.java │ │ │ │ ├── Scope.java │ │ │ │ ├── Setter.java │ │ │ │ ├── Span.java │ │ │ │ ├── SpanContext.java │ │ │ │ ├── Tracing.java │ │ │ │ ├── TracingContext.java │ │ │ │ ├── TracingProvider.java │ │ │ │ └── TracingSupplier.java │ │ │ ├── asm │ │ │ └── Modifier.java │ │ │ ├── async │ │ │ ├── AgentThreadFactory.java │ │ │ ├── ScheduleHelper.java │ │ │ ├── ScheduleRunner.java │ │ │ ├── ThreadLocalCurrentContext.java │ │ │ └── ThreadUtils.java │ │ │ ├── bean │ │ │ ├── AgentInitializingBean.java │ │ │ └── BeanProvider.java │ │ │ ├── bridge │ │ │ ├── AgentInfo.java │ │ │ ├── EaseAgent.java │ │ │ ├── NoOpAgentReporter.java │ │ │ ├── NoOpCleaner.java │ │ │ ├── NoOpConfigFactory.java │ │ │ ├── NoOpContext.java │ │ │ ├── NoOpDispatcher.java │ │ │ ├── NoOpIPluginConfig.java │ │ │ ├── NoOpLoggerFactory.java │ │ │ ├── NoOpMetrics.java │ │ │ ├── NoOpReporter.java │ │ │ └── NoOpTracer.java │ │ │ ├── enums │ │ │ ├── ClassMatch.java │ │ │ ├── Operator.java │ │ │ ├── Order.java │ │ │ └── StringMatch.java │ │ │ ├── field │ │ │ ├── AgentDynamicFieldAccessor.java │ │ │ ├── AgentFieldReflectAccessor.java │ │ │ ├── DynamicFieldAccessor.java │ │ │ └── NullObject.java │ │ │ ├── interceptor │ │ │ ├── AgentInterceptorChain.java │ │ │ ├── Interceptor.java │ │ │ ├── InterceptorProvider.java │ │ │ ├── MethodInfo.java │ │ │ └── NonReentrantInterceptor.java │ │ │ ├── matcher │ │ │ ├── ClassMatcher.java │ │ │ ├── IClassMatcher.java │ │ │ ├── IMethodMatcher.java │ │ │ ├── Matcher.java │ │ │ ├── MethodMatcher.java │ │ │ ├── loader │ │ │ │ ├── ClassLoaderMatcher.java │ │ │ │ ├── IClassLoaderMatcher.java │ │ │ │ └── NegateClassLoaderMatcher.java │ │ │ └── operator │ │ │ │ ├── AndClassMatcher.java │ │ │ │ ├── AndMethodMatcher.java │ │ │ │ ├── NegateClassMatcher.java │ │ │ │ ├── NegateMethodMatcher.java │ │ │ │ ├── Operator.java │ │ │ │ ├── OrClassMatcher.java │ │ │ │ └── OrMethodMatcher.java │ │ │ ├── processor │ │ │ ├── BeanUtils.java │ │ │ ├── ElementVisitor8.java │ │ │ ├── GenerateProviderBean.java │ │ │ ├── PluginProcessor.java │ │ │ └── RepeatedAnnotationVisitor.java │ │ │ ├── report │ │ │ ├── AgentReport.java │ │ │ ├── ByteWrapper.java │ │ │ ├── Call.java │ │ │ ├── Callback.java │ │ │ ├── EncodedData.java │ │ │ ├── Encoder.java │ │ │ ├── Packer.java │ │ │ ├── Sender.java │ │ │ ├── encoder │ │ │ │ └── JsonEncoder.java │ │ │ ├── metric │ │ │ │ └── MetricReporterFactory.java │ │ │ └── tracing │ │ │ │ ├── Annotation.java │ │ │ │ ├── Endpoint.java │ │ │ │ ├── ReportSpan.java │ │ │ │ └── ReportSpanImpl.java │ │ │ ├── tools │ │ │ ├── config │ │ │ │ └── NameAndSystem.java │ │ │ ├── loader │ │ │ │ └── AgentHelperClassLoader.java │ │ │ ├── matcher │ │ │ │ ├── ClassMatcherUtils.java │ │ │ │ └── MethodMatcherUtils.java │ │ │ ├── metrics │ │ │ │ ├── AccessLogServerInfo.java │ │ │ │ ├── ErrorPercentModelGauge.java │ │ │ │ ├── GaugeMetricModel.java │ │ │ │ ├── HttpLog.java │ │ │ │ ├── LastMinutesCounterGauge.java │ │ │ │ ├── NameFactorySupplier.java │ │ │ │ ├── RedisMetric.java │ │ │ │ └── ServerMetric.java │ │ │ └── trace │ │ │ │ ├── BaseHttpClientTracingInterceptor.java │ │ │ │ ├── HttpRequest.java │ │ │ │ ├── HttpResponse.java │ │ │ │ ├── HttpUtils.java │ │ │ │ └── TraceConst.java │ │ │ └── utils │ │ │ ├── AdditionalAttributes.java │ │ │ ├── ClassInstance.java │ │ │ ├── ClassUtils.java │ │ │ ├── ImmutableMap.java │ │ │ ├── NoNull.java │ │ │ ├── Pair.java │ │ │ ├── SystemClock.java │ │ │ ├── SystemEnv.java │ │ │ ├── common │ │ │ ├── DataSize.java │ │ │ ├── DataUnit.java │ │ │ ├── ExceptionUtil.java │ │ │ ├── HostAddress.java │ │ │ ├── JsonUtil.java │ │ │ ├── StringUtils.java │ │ │ └── WeakConcurrentMap.java │ │ │ └── jackson │ │ │ └── annotation │ │ │ └── JsonProperty.java │ │ └── io │ │ └── opentelemetry │ │ └── sdk │ │ └── resources │ │ └── EaseAgentResource.java │ └── test │ └── java │ └── com │ └── megaease │ └── easeagent │ └── plugin │ ├── api │ ├── MockSystemEnv.java │ ├── ProgressFieldsTest.java │ ├── metric │ │ └── name │ │ │ └── NameFactoryTest.java │ └── middleware │ │ ├── RedirectProcessorTest.java │ │ ├── RedirectTest.java │ │ └── ResourceConfigTest.java │ ├── async │ └── ThreadLocalCurrentContextTest.java │ └── tools │ └── config │ └── AutoRefreshConfigSupplierTest.java ├── plugins ├── async │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ ├── AsyncPlugin.java │ │ │ ├── advice │ │ │ ├── CrossThreadAdvice.java │ │ │ └── ReactSchedulersAdvice.java │ │ │ └── interceptor │ │ │ └── RunnableInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── interceptor │ │ │ └── RunnableInterceptorTest.java │ │ └── resources │ │ └── log4j2.xml ├── dubbo │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── dubbo │ │ │ ├── AlibabaDubboCtxUtils.java │ │ │ ├── ApacheDubboCtxUtils.java │ │ │ ├── DubboMetricTags.java │ │ │ ├── DubboPlugin.java │ │ │ ├── DubboTraceTags.java │ │ │ ├── advice │ │ │ ├── AlibabaDubboAdvice.java │ │ │ ├── AlibabaDubboResponseFutureAdvice.java │ │ │ └── ApacheDubboAdvice.java │ │ │ ├── config │ │ │ └── DubboTraceConfig.java │ │ │ └── interceptor │ │ │ ├── DubboBaseInterceptor.java │ │ │ ├── metrics │ │ │ ├── DubboBaseMetricsInterceptor.java │ │ │ ├── DubboMetrics.java │ │ │ ├── alibaba │ │ │ │ ├── AlibabaDubboAsyncMetricsInterceptor.java │ │ │ │ ├── AlibabaDubboMetricsCallback.java │ │ │ │ └── AlibabaDubboMetricsInterceptor.java │ │ │ └── apache │ │ │ │ ├── ApacheDubboMetricsAsyncCallback.java │ │ │ │ └── ApacheDubboMetricsInterceptor.java │ │ │ └── trace │ │ │ ├── alibaba │ │ │ ├── AlibabaDubboAsyncTraceInterceptor.java │ │ │ ├── AlibabaDubboClientRequest.java │ │ │ ├── AlibabaDubboServerRequest.java │ │ │ ├── AlibabaDubboTraceCallback.java │ │ │ └── AlibabaDubboTraceInterceptor.java │ │ │ └── apache │ │ │ ├── ApacheDubboClientRequest.java │ │ │ ├── ApacheDubboServerRequest.java │ │ │ ├── ApacheDubboTraceCallback.java │ │ │ └── ApacheDubboTraceInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── dubbo │ │ │ └── interceptor │ │ │ ├── AlibabaDubboBaseTest.java │ │ │ ├── ApacheDubboBaseTest.java │ │ │ ├── metrics │ │ │ ├── alibaba │ │ │ │ ├── AlibabaDubboAsyncMetricsInterceptorTest.java │ │ │ │ └── AlibabaDubboMetricsInterceptorTest.java │ │ │ └── apache │ │ │ │ └── ApacheDubboMetricsInterceptorTest.java │ │ │ └── trace │ │ │ ├── alibaba │ │ │ ├── AlibabaDubboAsyncTraceInterceptorTest.java │ │ │ └── AlibabaDubboTraceInterceptorTest.java │ │ │ └── apache │ │ │ └── ApacheDubboTraceInterceptorTest.java │ │ └── resources │ │ └── mock_agent.properties ├── elasticsearch │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── elasticsearch │ │ │ ├── ElasticsearchPlugin.java │ │ │ ├── ElasticsearchRedirectPlugin.java │ │ │ ├── advice │ │ │ └── SpringElasticsearchAdvice.java │ │ │ ├── interceptor │ │ │ ├── AsyncResponse4MetricsListener.java │ │ │ ├── AsyncResponse4TraceListener.java │ │ │ ├── ElasticsearchBaseInterceptor.java │ │ │ ├── ElasticsearchBaseMetricsInterceptor.java │ │ │ ├── ElasticsearchBaseTraceInterceptor.java │ │ │ ├── ElasticsearchCtxUtils.java │ │ │ ├── ElasticsearchMetric.java │ │ │ ├── ElasticsearchPerformRequestAsync4MetricsInterceptor.java │ │ │ ├── ElasticsearchPerformRequestAsync4TraceInterceptor.java │ │ │ ├── ElasticsearchPerformRequestMetricsInterceptor.java │ │ │ ├── ElasticsearchPerformRequestTraceInterceptor.java │ │ │ └── redirect │ │ │ │ └── SpringElasticsearchInterceptor.java │ │ │ └── points │ │ │ ├── ElasticsearchPerformRequestAsyncPoints.java │ │ │ └── ElasticsearchPerformRequestPoints.java │ │ └── test │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── plugin │ │ └── elasticsearch │ │ └── interceptor │ │ ├── ElasticsearchBaseTest.java │ │ ├── ElasticsearchCtxUtilsTest.java │ │ ├── ElasticsearchPerformRequestAsyncMetricsInterceptorTest.java │ │ ├── ElasticsearchPerformRequestAsyncTraceInterceptorTest.java │ │ ├── ElasticsearchPerformRequestMetricsInterceptorTest.java │ │ └── ElasticsearchPerformRequestTraceInterceptorTest.java ├── healthy │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── healthy │ │ │ ├── HealthPlugin.java │ │ │ ├── OnApplicationEventInterceptor.java │ │ │ └── SpringApplicationAdminMXBeanRegistrarAdvice.java │ │ └── test │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── plugin │ │ └── healthy │ │ └── OnApplicationEventInterceptorTest.java ├── httpclient │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── httpclient │ │ │ ├── ForwardedPlugin.java │ │ │ ├── HttpClientPlugin.java │ │ │ ├── advice │ │ │ ├── HttpClient5AsyncAdvice.java │ │ │ ├── HttpClient5DoExecuteAdvice.java │ │ │ └── HttpClientDoExecuteAdvice.java │ │ │ └── interceptor │ │ │ ├── HttpClient5AsyncForwardedInterceptor.java │ │ │ ├── HttpClient5AsyncTracingInterceptor.java │ │ │ ├── HttpClient5DoExecuteForwardedInterceptor.java │ │ │ ├── HttpClient5DoExecuteInterceptor.java │ │ │ ├── HttpClientDoExecuteForwardedInterceptor.java │ │ │ └── HttpClientDoExecuteInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── httpclient │ │ │ └── interceptor │ │ │ ├── HttpClient5AsyncForwardedInterceptorTest.java │ │ │ ├── HttpClient5AsyncTracingInterceptorTest.java │ │ │ ├── HttpClient5DoExecuteForwardedInterceptorTest.java │ │ │ ├── HttpClient5DoExecuteInterceptorTest.java │ │ │ ├── HttpClientDoExecuteForwardedInterceptorTest.java │ │ │ ├── HttpClientDoExecuteInterceptorTest.java │ │ │ └── TestConst.java │ │ └── resources │ │ └── mock_agent.properties ├── httpservlet │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── httpservlet │ │ │ ├── AccessPlugin.java │ │ │ ├── ForwardedPlugin.java │ │ │ ├── HttpServletPlugin.java │ │ │ ├── advice │ │ │ └── DoFilterPoints.java │ │ │ ├── interceptor │ │ │ ├── BaseServletInterceptor.java │ │ │ ├── DoFilterForwardedInterceptor.java │ │ │ ├── DoFilterMetricInterceptor.java │ │ │ ├── DoFilterTraceInterceptor.java │ │ │ ├── HttpServerRequest.java │ │ │ ├── ServletAccessLogServerInfo.java │ │ │ └── ServletHttpLogInterceptor.java │ │ │ └── utils │ │ │ ├── InternalAsyncListener.java │ │ │ ├── ServletUtils.java │ │ │ └── SpringWebUtils.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── httpservlet │ │ │ └── interceptor │ │ │ ├── BaseServletInterceptorTest.java │ │ │ ├── DoFilterForwardedInterceptorTest.java │ │ │ ├── DoFilterMetricInterceptorTest.java │ │ │ ├── DoFilterTraceInterceptorTest.java │ │ │ ├── HttpServerRequestTest.java │ │ │ ├── ServletAccessLogInfoServerInfoTest.java │ │ │ ├── ServletHttpLogInterceptorTest.java │ │ │ ├── TestConst.java │ │ │ └── TestServletUtils.java │ │ └── resources │ │ └── mock_agent.properties ├── httpurlconnection │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── httpurlconnection │ │ │ ├── ForwardedPlugin.java │ │ │ ├── HttpURLConnectionPlugin.java │ │ │ ├── advice │ │ │ └── HttpURLConnectionGetResponseCodeAdvice.java │ │ │ └── interceptor │ │ │ ├── HttpURLConnectionGetResponseCodeForwardedInterceptor.java │ │ │ └── HttpURLConnectionGetResponseCodeInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── httpurlconnection │ │ │ └── interceptor │ │ │ ├── HttpURLConnectionGetResponseCodeForwardedInterceptorTest.java │ │ │ ├── HttpURLConnectionGetResponseCodeInterceptorTest.java │ │ │ └── TestUtils.java │ │ └── resources │ │ └── mock_agent.properties ├── jdbc │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── jdbc │ │ │ ├── JdbcConnectionMetricPlugin.java │ │ │ ├── JdbcDataSourceMetricPlugin.java │ │ │ ├── JdbcRedirectPlugin.java │ │ │ ├── JdbcTracingPlugin.java │ │ │ ├── advice │ │ │ ├── HikariDataSourceAdvice.java │ │ │ ├── JdbcConnectionAdvice.java │ │ │ ├── JdbcDataSourceAdvice.java │ │ │ └── JdbcStatementAdvice.java │ │ │ ├── common │ │ │ ├── DatabaseInfo.java │ │ │ ├── JdbcUtils.java │ │ │ ├── MD5DictionaryItem.java │ │ │ ├── MD5ReportConsumer.java │ │ │ ├── MD5SQLCompression.java │ │ │ ├── SQLCompression.java │ │ │ ├── SQLCompressionFactory.java │ │ │ ├── SQLCompressionWrapper.java │ │ │ └── SqlInfo.java │ │ │ └── interceptor │ │ │ ├── JdbConPrepareOrCreateStmInterceptor.java │ │ │ ├── JdbcStmPrepareSqlInterceptor.java │ │ │ ├── metric │ │ │ ├── JdbcDataSourceMetricInterceptor.java │ │ │ ├── JdbcMetric.java │ │ │ └── JdbcStmMetricInterceptor.java │ │ │ ├── redirect │ │ │ └── HikariSetPropertyInterceptor.java │ │ │ └── tracing │ │ │ └── JdbcStmTracingInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── jdbc │ │ │ ├── MockJDBCStatement.java │ │ │ ├── TestUtils.java │ │ │ ├── common │ │ │ ├── DatabaseInfoTest.java │ │ │ ├── JdbcUtilsTest.java │ │ │ ├── MD5DictionaryItemTest.java │ │ │ ├── MD5ReportConsumerTest.java │ │ │ ├── MD5SQLCompressionTest.java │ │ │ └── SqlInfoTest.java │ │ │ └── interceptor │ │ │ ├── JdbConPrepareOrCreateStmInterceptorTest.java │ │ │ ├── JdbcStmPrepareSqlInterceptorTest.java │ │ │ ├── metric │ │ │ ├── JdbcDataSourceMetricInterceptorTest.java │ │ │ ├── JdbcMetricTest.java │ │ │ └── JdbcStmMetricInterceptorTest.java │ │ │ ├── redirect │ │ │ └── HikariSetPropertyInterceptorTest.java │ │ │ └── tracing │ │ │ └── JdbcStmTracingInterceptorTest.java │ │ └── resources │ │ └── mock_agent.properties ├── kafka │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── kafka │ │ │ ├── KafkaPlugin.java │ │ │ ├── KafkaRedirectPlugin.java │ │ │ ├── advice │ │ │ ├── KafkaConsumerAdvice.java │ │ │ ├── KafkaConsumerConfigAdvice.java │ │ │ ├── KafkaConsumerRecordAdvice.java │ │ │ ├── KafkaMessageListenerAdvice.java │ │ │ ├── KafkaProducerAdvice.java │ │ │ └── KafkaProducerConfigAdvice.java │ │ │ └── interceptor │ │ │ ├── AsyncCallback.java │ │ │ ├── KafkaUtils.java │ │ │ ├── initialize │ │ │ ├── ConsumerRecordInterceptor.java │ │ │ ├── KafkaConsumerConstructInterceptor.java │ │ │ ├── KafkaConsumerPollInterceptor.java │ │ │ └── KafkaProducerConstructInterceptor.java │ │ │ ├── metric │ │ │ ├── KafkaConsumerMetricInterceptor.java │ │ │ ├── KafkaMessageListenerMetricInterceptor.java │ │ │ ├── KafkaMetric.java │ │ │ ├── KafkaProducerMetricInterceptor.java │ │ │ └── MetricCallback.java │ │ │ ├── redirect │ │ │ ├── KafkaAbstractConfigConstructInterceptor.java │ │ │ ├── KafkaConsumerConfigConstructInterceptor.java │ │ │ └── KafkaProducerConfigConstructInterceptor.java │ │ │ └── tracing │ │ │ ├── KafkaConsumerRequest.java │ │ │ ├── KafkaConsumerTracingInterceptor.java │ │ │ ├── KafkaHeaders.java │ │ │ ├── KafkaMessageListenerTracingInterceptor.java │ │ │ ├── KafkaProducerDoSendInterceptor.java │ │ │ ├── KafkaProducerRequest.java │ │ │ ├── KafkaTags.java │ │ │ └── TraceCallback.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── kafka │ │ │ └── interceptor │ │ │ ├── AsyncCallbackTest.java │ │ │ ├── KafkaTestUtils.java │ │ │ ├── KafkaUtilsTest.java │ │ │ ├── MockConsumerRecord.java │ │ │ ├── MockKafkaConsumer.java │ │ │ ├── MockKafkaProducer.java │ │ │ ├── TestConst.java │ │ │ ├── initialize │ │ │ ├── ConsumerRecordInterceptorTest.java │ │ │ ├── KafkaConsumerConstructInterceptorTest.java │ │ │ ├── KafkaConsumerPollInterceptorTest.java │ │ │ ├── KafkaProducerConstructInterceptorTest.java │ │ │ └── MockDynamicFieldAccessor.java │ │ │ ├── metric │ │ │ ├── KafkaConsumerMetricInterceptorTest.java │ │ │ ├── KafkaMessageListenerMetricInterceptorTest.java │ │ │ ├── KafkaMetricTest.java │ │ │ ├── KafkaProducerMetricInterceptorTest.java │ │ │ └── MetricCallbackTest.java │ │ │ ├── redirect │ │ │ └── KafkaAbstractConfigConstructInterceptorTest.java │ │ │ └── tracing │ │ │ ├── KafkaConsumerRequestTest.java │ │ │ ├── KafkaConsumerTracingInterceptorTest.java │ │ │ ├── KafkaHeadersTest.java │ │ │ ├── KafkaMessageListenerTracingInterceptorTest.java │ │ │ ├── KafkaProducerDoSendInterceptorTest.java │ │ │ ├── KafkaProducerRequestTest.java │ │ │ └── TraceCallbackTest.java │ │ └── resources │ │ └── mock_agent.properties ├── log4j2-log-plugin │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── log4j2 │ │ ├── Log4j2Plugin.java │ │ ├── interceptor │ │ └── Log4j2AppenderInterceptor.java │ │ ├── log │ │ └── Log4jLogMapper.java │ │ └── points │ │ └── AbstractLoggerPoints.java ├── logback │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── logback │ │ ├── LogbackPlugin.java │ │ ├── interceptor │ │ └── LogbackAppenderInterceptor.java │ │ ├── log │ │ └── LogbackLogMapper.java │ │ └── points │ │ └── LoggerPoints.java ├── mongodb │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── mongodb │ │ │ ├── MongoPlugin.java │ │ │ ├── MongoRedirectPlugin.java │ │ │ ├── MongoUtils.java │ │ │ ├── interceptor │ │ │ ├── InterceptorHelper.java │ │ │ ├── MetricHelper.java │ │ │ ├── MongoBaseInterceptor.java │ │ │ ├── MongoBaseMetricInterceptor.java │ │ │ ├── MongoBaseTraceInterceptor.java │ │ │ ├── MongoClientConstruct4MetricInterceptor.java │ │ │ ├── MongoClientConstruct4TraceInterceptor.java │ │ │ ├── MongoCtx.java │ │ │ ├── MongoDbRedirectInterceptor.java │ │ │ ├── MongoInternalConnectionSendAndReceiveAsync4MetricInterceptor.java │ │ │ ├── MongoInternalConnectionSendAndReceiveAsync4TraceInterceptor.java │ │ │ ├── MongoMetric.java │ │ │ ├── MongoReactiveInitMetricInterceptor.java │ │ │ ├── MongoReactiveInitTraceInterceptor.java │ │ │ ├── TraceHelper.java │ │ │ └── listener │ │ │ │ ├── MongoBaseCommandListener.java │ │ │ │ ├── MongoBaseMetricCommandListener.java │ │ │ │ ├── MongoBaseTraceCommandListener.java │ │ │ │ ├── MongoMetricCommandListener.java │ │ │ │ ├── MongoReactiveMetricCommandListener.java │ │ │ │ ├── MongoReactiveTraceCommandListener.java │ │ │ │ └── MongoTraceCommandListener.java │ │ │ └── points │ │ │ ├── MongoAsyncMongoClientsPoints.java │ │ │ ├── MongoClientImplPoints.java │ │ │ ├── MongoDBInternalConnectionPoints.java │ │ │ └── MongoRedirectPoints.java │ │ └── test │ │ └── java │ │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── plugin │ │ └── mongodb │ │ ├── MongoBaseTest.java │ │ ├── MongoMetricTest.java │ │ ├── MongoReactiveMetricTest.java │ │ ├── MongoReactiveTraceTest.java │ │ ├── MongoTraceTest.java │ │ └── TraceHelperTest.java ├── motan │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── motan │ │ │ ├── MotanPlugin.java │ │ │ ├── advice │ │ │ ├── MotanConsumerAdvice.java │ │ │ └── MotanProviderAdvice.java │ │ │ ├── config │ │ │ └── MotanPluginConfig.java │ │ │ └── interceptor │ │ │ ├── MotanClassUtils.java │ │ │ ├── MotanCtxUtils.java │ │ │ ├── metrics │ │ │ ├── MetricsFutureListener.java │ │ │ ├── MotanBaseMetricsInterceptor.java │ │ │ ├── MotanMetric.java │ │ │ ├── MotanMetricTags.java │ │ │ └── MotanMetricsInterceptor.java │ │ │ └── trace │ │ │ ├── MotanBaseInterceptor.java │ │ │ ├── MotanTags.java │ │ │ ├── consumer │ │ │ ├── MotanConsumerRequest.java │ │ │ ├── MotanConsumerTraceInterceptor.java │ │ │ └── TraceFutureListener.java │ │ │ └── provider │ │ │ ├── MotanProviderRequest.java │ │ │ └── MotanProviderTraceInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── motan │ │ │ └── interceptor │ │ │ ├── metrics │ │ │ └── MotanMetricsInterceptorTest.java │ │ │ └── trace │ │ │ ├── MotanInterceptorTest.java │ │ │ ├── consumer │ │ │ └── MotanConsumerInterceptorTest.java │ │ │ └── provider │ │ │ └── MotanProviderInterceptorTest.java │ │ └── resources │ │ └── mock_agent.properties ├── okhttp │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── okhttp │ │ │ ├── ForwardedPlugin.java │ │ │ ├── OkHttpPlugin.java │ │ │ ├── advice │ │ │ └── OkHttpAdvice.java │ │ │ └── interceptor │ │ │ ├── ForwardedRequest.java │ │ │ ├── InternalRequest.java │ │ │ ├── InternalResponse.java │ │ │ ├── OkHttpAsyncTracingInterceptor.java │ │ │ ├── OkHttpForwardedInterceptor.java │ │ │ └── OkHttpTracingInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── okhttp │ │ │ └── interceptor │ │ │ ├── OkHttpAsyncTracingInterceptorTest.java │ │ │ ├── OkHttpForwardedInterceptorTest.java │ │ │ ├── OkHttpTestUtils.java │ │ │ ├── OkHttpTracingInterceptorTest.java │ │ │ └── TestConst.java │ │ └── resources │ │ └── mock_agent.properties ├── pom.xml ├── rabbitmq │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── rabbitmq │ │ │ ├── RabbitMqConsumerMetric.java │ │ │ ├── RabbitMqPlugin.java │ │ │ ├── RabbitMqProducerMetric.java │ │ │ ├── RabbitMqRedirectPlugin.java │ │ │ ├── spring │ │ │ ├── RabbitMqMessageListenerAdvice.java │ │ │ └── interceptor │ │ │ │ ├── RabbitMqMessageListenerOnMessageInterceptor.java │ │ │ │ ├── RabbitMqOnMessageMetricInterceptor.java │ │ │ │ └── RabbitMqOnMessageTracingInterceptor.java │ │ │ └── v5 │ │ │ ├── advice │ │ │ ├── RabbitMqChannelAdvice.java │ │ │ ├── RabbitMqConfigFactoryAdvice.java │ │ │ ├── RabbitMqConsumerAdvice.java │ │ │ └── RabbitMqPropertyAdvice.java │ │ │ └── interceptor │ │ │ ├── RabbitMqChannelConsumeInterceptor.java │ │ │ ├── RabbitMqChannelConsumerDeliveryInterceptor.java │ │ │ ├── RabbitMqChannelPublishInterceptor.java │ │ │ ├── RabbitMqConsumerHandleDeliveryInterceptor.java │ │ │ ├── metirc │ │ │ ├── RabbitMqConsumerMetricInterceptor.java │ │ │ └── RabbitMqProducerMetricInterceptor.java │ │ │ ├── redirect │ │ │ ├── RabbitMqConfigFactoryInterceptor.java │ │ │ └── RabbitMqPropertyInterceptor.java │ │ │ └── tracing │ │ │ ├── RabbitMqChannelPublishTracingInterceptor.java │ │ │ └── RabbitMqConsumerTracingInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── rabbitmq │ │ │ ├── RabbitMqConsumerMetricTest.java │ │ │ ├── RabbitMqProducerMetricTest.java │ │ │ ├── TestUtils.java │ │ │ ├── spring │ │ │ └── interceptor │ │ │ │ ├── RabbitMqMessageListenerOnMessageInterceptorTest.java │ │ │ │ ├── RabbitMqOnMessageMetricInterceptorTest.java │ │ │ │ └── RabbitMqOnMessageTracingInterceptorTest.java │ │ │ └── v5 │ │ │ └── interceptor │ │ │ ├── MockConsumer.java │ │ │ ├── RabbitMqChannelConsumeInterceptorTest.java │ │ │ ├── RabbitMqChannelConsumerDeliveryInterceptorTest.java │ │ │ ├── RabbitMqChannelPublishInterceptorTest.java │ │ │ ├── RabbitMqConsumerHandleDeliveryInterceptorTest.java │ │ │ ├── metirc │ │ │ ├── RabbitMqConsumerMetricInterceptorTest.java │ │ │ └── RabbitMqProducerMetricInterceptorTest.java │ │ │ ├── redirect │ │ │ └── RabbitMqPropertyInterceptorTest.java │ │ │ └── tracing │ │ │ ├── RabbitMqChannelPublishTracingInterceptorTest.java │ │ │ └── RabbitMqConsumerTracingInterceptorTest.java │ │ └── resources │ │ └── mock_agent.properties ├── redis │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── redis │ │ │ ├── RedisPlugin.java │ │ │ ├── RedisRedirectPlugin.java │ │ │ ├── advice │ │ │ ├── JedisAdvice.java │ │ │ ├── JedisConstructorAdvice.java │ │ │ ├── LettuceRedisClientAdvice.java │ │ │ ├── RedisChannelWriterAdvice.java │ │ │ ├── RedisClusterClientAdvice.java │ │ │ ├── RedisPropertiesAdvice.java │ │ │ ├── RedisPropertiesClusterAdvice.java │ │ │ └── StatefulRedisConnectionAdvice.java │ │ │ └── interceptor │ │ │ ├── RedisClassUtils.java │ │ │ ├── RedisClientUtils.java │ │ │ ├── initialize │ │ │ ├── CommonRedisClientInterceptor.java │ │ │ ├── CompletableFutureWrapper.java │ │ │ ├── ConnectionFutureWrapper.java │ │ │ ├── RedisClientInterceptor.java │ │ │ └── RedisClusterClientInterceptor.java │ │ │ ├── metric │ │ │ ├── CommonRedisMetricInterceptor.java │ │ │ ├── JedisMetricInterceptor.java │ │ │ └── LettuceMetricInterceptor.java │ │ │ ├── redirect │ │ │ ├── JedisConstructorInterceptor.java │ │ │ ├── LettuceRedisClientConstructInterceptor.java │ │ │ ├── RedisPropertiesClusterSetNodesInterceptor.java │ │ │ └── RedisPropertiesSetPropertyInterceptor.java │ │ │ └── tracing │ │ │ ├── CommonRedisTracingInterceptor.java │ │ │ ├── JedisTracingInterceptor.java │ │ │ ├── LettuceTracingInterceptor.java │ │ │ └── StatefulRedisConnectionInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── redis │ │ │ └── interceptor │ │ │ ├── RedisUtils.java │ │ │ ├── TestConst.java │ │ │ ├── initialize │ │ │ ├── CommonRedisClientInterceptorTest.java │ │ │ ├── CompletableFutureWrapperTest.java │ │ │ ├── ConnectionFutureWrapperTest.java │ │ │ └── DynamicFieldAccessorObj.java │ │ │ ├── metric │ │ │ ├── CommonRedisMetricInterceptorTest.java │ │ │ ├── JedisMetricInterceptorTest.java │ │ │ └── LettuceMetricInterceptorTest.java │ │ │ ├── redirect │ │ │ ├── JedisConstructorInterceptorTest.java │ │ │ ├── LettuceRedisClientConstructInterceptorTest.java │ │ │ ├── RedisPropertiesClusterSetNodesInterceptorTest.java │ │ │ └── RedisPropertiesSetPropertyInterceptorTest.java │ │ │ └── tracing │ │ │ ├── CommonRedisTracingInterceptorTest.java │ │ │ ├── JedisTracingInterceptorTest.java │ │ │ └── LettuceTracingInterceptorTest.java │ │ └── resources │ │ └── mock_agent.properties ├── servicename │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── servicename │ │ │ ├── Const.java │ │ │ ├── ReflectionTool.java │ │ │ ├── ServiceNamePlugin.java │ │ │ ├── ServiceNamePluginConfig.java │ │ │ ├── advice │ │ │ ├── FeignBlockingLoadBalancerClientAdvice.java │ │ │ ├── FeignLoadBalancerAdvice.java │ │ │ ├── FilteringWebHandlerAdvice.java │ │ │ ├── LoadBalancerFeignClientAdvice.java │ │ │ ├── RestTemplateInterceptAdvice.java │ │ │ └── WebClientFilterAdvice.java │ │ │ └── interceptor │ │ │ ├── BaseServiceNameInterceptor.java │ │ │ ├── FeignBlockingLoadBalancerClientInterceptor.java │ │ │ ├── FeignLoadBalancerInterceptor.java │ │ │ ├── FilteringWebHandlerInterceptor.java │ │ │ ├── LoadBalancerFeignClientInterceptor.java │ │ │ ├── RestTemplateInterceptInterceptor.java │ │ │ └── WebClientFilterInterceptor.java │ │ └── test │ │ ├── java │ │ ├── com │ │ │ └── megaease │ │ │ │ └── easeagent │ │ │ │ └── plugin │ │ │ │ └── servicename │ │ │ │ ├── ReflectionToolTest.java │ │ │ │ └── interceptor │ │ │ │ ├── BaseServiceNameInterceptorTest.java │ │ │ │ ├── CheckUtils.java │ │ │ │ ├── FeignBlockingLoadBalancerClientInterceptorTest.java │ │ │ │ ├── FeignLoadBalancerInterceptorTest.java │ │ │ │ ├── FilteringWebHandlerInterceptorTest.java │ │ │ │ ├── LoadBalancerFeignClientInterceptorTest.java │ │ │ │ ├── RestTemplateInterceptInterceptorTest.java │ │ │ │ ├── TestConst.java │ │ │ │ └── WebClientFilterInterceptorTest.java │ │ └── org │ │ │ └── springframework │ │ │ ├── cloud │ │ │ └── openfeign │ │ │ │ └── ribbon │ │ │ │ └── MockRibbonRequest.java │ │ │ └── web │ │ │ └── reactive │ │ │ └── function │ │ │ └── client │ │ │ └── MockClientRequest.java │ │ └── resources │ │ └── mock_agent.properties ├── sofarpc │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── sofarpc │ │ │ ├── SofaRpcCtxUtils.java │ │ │ ├── SofaRpcMetricsTags.java │ │ │ ├── SofaRpcPlugin.java │ │ │ ├── SofaRpcTraceTags.java │ │ │ ├── adivce │ │ │ ├── BoltFutureInvokeCallbackConstructAdvice.java │ │ │ ├── ConsumerAdvice.java │ │ │ ├── FutureInvokeCallbackConstructAdvice.java │ │ │ ├── ProviderAdvice.java │ │ │ ├── ResponseCallbackAdvice.java │ │ │ └── ResponseFutureAdvice.java │ │ │ ├── config │ │ │ └── SofaRpcTraceConfig.java │ │ │ └── interceptor │ │ │ ├── initalize │ │ │ └── SofaRpcFutureInvokeCallbackConstructInterceptor.java │ │ │ ├── metrics │ │ │ ├── SofaRpcMetrics.java │ │ │ ├── SofaRpcMetricsBaseInterceptor.java │ │ │ ├── callback │ │ │ │ ├── SofaRpcResponseCallbackMetrics.java │ │ │ │ └── SofaRpcResponseCallbackMetricsInterceptor.java │ │ │ ├── common │ │ │ │ └── SofaRpcMetricsInterceptor.java │ │ │ └── future │ │ │ │ └── SofaRpcResponseFutureMetricsInterceptor.java │ │ │ └── trace │ │ │ ├── SofaRpcTraceBaseInterceptor.java │ │ │ ├── callback │ │ │ ├── SofaRpcResponseCallbackTrace.java │ │ │ └── SofaRpcResponseCallbackTraceInterceptor.java │ │ │ ├── common │ │ │ ├── SofaClientTraceRequest.java │ │ │ ├── SofaRpcConsumerTraceInterceptor.java │ │ │ ├── SofaRpcProviderTraceInterceptor.java │ │ │ └── SofaServerTraceRequest.java │ │ │ └── future │ │ │ └── SofaRpcResponseFutureTraceInterceptor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── sofarpc │ │ │ └── interceptor │ │ │ ├── BaseInterceptorTest.java │ │ │ ├── MockBoltResponseFuture.java │ │ │ ├── metrics │ │ │ ├── BaseMetricsInterceptorTest.java │ │ │ ├── callback │ │ │ │ ├── MockSofaResponseCallback.java │ │ │ │ └── SofaRpcResponseCallbackMetricsInterceptorTest.java │ │ │ ├── common │ │ │ │ └── SofaRpcMetricsInterceptorTest.java │ │ │ └── future │ │ │ │ └── SofaRpcResponseFutureMetricsInterceptorTest.java │ │ │ └── trace │ │ │ ├── callback │ │ │ ├── MockSofaResponseCallback.java │ │ │ └── SofaRpcResponseCallbackTraceInterceptorTest.java │ │ │ ├── common │ │ │ ├── SofaRpcConsumerTraceInterceptorTest.java │ │ │ └── SofaRpcProviderTraceInterceptorTest.java │ │ │ └── future │ │ │ └── SofaRpcResponseFutureTraceInterceptorTest.java │ │ └── resources │ │ └── mock_agent.properties ├── spring-gateway │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── spring │ │ │ └── gateway │ │ │ ├── AccessPlugin.java │ │ │ ├── ForwardedPlugin.java │ │ │ ├── SpringGatewayPlugin.java │ │ │ ├── advice │ │ │ ├── AgentGlobalFilterAdvice.java │ │ │ ├── HttpHeadersFilterAdvice.java │ │ │ └── InitGlobalFilterAdvice.java │ │ │ ├── interceptor │ │ │ ├── GatewayCons.java │ │ │ ├── initialize │ │ │ │ ├── AgentGlobalFilter.java │ │ │ │ ├── GatewayServerForwardedInterceptor.java │ │ │ │ └── GlobalFilterInterceptor.java │ │ │ ├── metric │ │ │ │ ├── GatewayMetricsInterceptor.java │ │ │ │ ├── TimeUtils.java │ │ │ │ └── log │ │ │ │ │ ├── GatewayAccessLogInterceptor.java │ │ │ │ │ └── SpringGatewayAccessLogServerInfo.java │ │ │ └── tracing │ │ │ │ ├── FluxHttpServerRequest.java │ │ │ │ ├── FluxHttpServerResponse.java │ │ │ │ ├── GatewayServerTracingInterceptor.java │ │ │ │ └── HttpHeadersFilterTracingInterceptor.java │ │ │ └── reactor │ │ │ ├── AgentCoreSubscriber.java │ │ │ └── AgentMono.java │ │ └── test │ │ ├── java │ │ └── easeagent │ │ │ └── plugin │ │ │ └── spring │ │ │ └── gateway │ │ │ ├── TestConst.java │ │ │ ├── TestServerWebExchangeUtils.java │ │ │ ├── interceptor │ │ │ ├── initialize │ │ │ │ ├── AgentGlobalFilterTest.java │ │ │ │ ├── GatewayServerForwardedInterceptorTest.java │ │ │ │ └── GlobalFilterInterceptorTest.java │ │ │ ├── metric │ │ │ │ ├── GatewayMetricsInterceptorTest.java │ │ │ │ ├── MockRouteBuilder.java │ │ │ │ ├── TimeUtilsTest.java │ │ │ │ └── log │ │ │ │ │ ├── GatewayAccessLogInfoInterceptorTest.java │ │ │ │ │ └── SpringGatewayAccessLogInfoServerInfoTest.java │ │ │ └── tracing │ │ │ │ ├── FluxHttpServerRequestTest.java │ │ │ │ ├── FluxHttpServerResponseTest.java │ │ │ │ ├── GatewayServerTracingInterceptorTest.java │ │ │ │ └── HttpHeadersFilterTracingInterceptorTest.java │ │ │ └── reactor │ │ │ ├── AgentCoreSubscriberTest.java │ │ │ ├── AgentMonoTest.java │ │ │ └── MockCoreSubscriber.java │ │ └── resources │ │ └── mock_agent.properties └── springweb │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── megaease │ │ │ ├── easeagent │ │ │ └── plugin │ │ │ │ └── springweb │ │ │ │ ├── FeignClientPlugin.java │ │ │ │ ├── ForwardedPlugin.java │ │ │ │ ├── RestTemplatePlugin.java │ │ │ │ ├── SpringWebPlugin.java │ │ │ │ ├── WebClientPlugin.java │ │ │ │ ├── advice │ │ │ │ ├── ClientHttpRequestAdvice.java │ │ │ │ ├── FeignClientAdvice.java │ │ │ │ ├── WebClientBuilderAdvice.java │ │ │ │ └── WebClientFilterAdvice.java │ │ │ │ ├── interceptor │ │ │ │ ├── HeadersFieldFinder.java │ │ │ │ ├── forwarded │ │ │ │ │ ├── FeignClientForwardedInterceptor.java │ │ │ │ │ ├── RestTemplateForwardedInterceptor.java │ │ │ │ │ └── WebClientFilterForwardedInterceptor.java │ │ │ │ ├── initialize │ │ │ │ │ └── WebClientBuildInterceptor.java │ │ │ │ └── tracing │ │ │ │ │ ├── ClientHttpRequestInterceptor.java │ │ │ │ │ ├── FeignClientTracingInterceptor.java │ │ │ │ │ └── WebClientFilterTracingInterceptor.java │ │ │ │ └── reactor │ │ │ │ ├── AgentCoreSubscriber.java │ │ │ │ └── AgentMono.java │ │ │ └── plugin │ │ │ └── easeagent │ │ │ └── springweb │ │ │ └── interceptor │ │ │ └── tracing │ │ │ └── WebClientTracingFilter.java │ └── resources │ │ └── application.yaml │ └── test │ ├── java │ ├── com │ │ └── megaease │ │ │ └── easeagent │ │ │ └── plugin │ │ │ └── springweb │ │ │ ├── interceptor │ │ │ ├── HeadersFieldFinderTest.java │ │ │ ├── RequestUtils.java │ │ │ ├── TestConst.java │ │ │ ├── forwarded │ │ │ │ ├── FeignClientForwardedInterceptorTest.java │ │ │ │ ├── RestTemplateForwardedInterceptorTest.java │ │ │ │ └── WebClientFilterForwardedInterceptorTest.java │ │ │ ├── initialize │ │ │ │ └── WebClientBuildInterceptorTest.java │ │ │ └── tracing │ │ │ │ ├── ClientHttpRequestInterceptorTest.java │ │ │ │ ├── FeignClientTracingInterceptorTest.java │ │ │ │ └── WebClientFilterTracingInterceptorTest.java │ │ │ └── reactor │ │ │ ├── AgentCoreSubscriberTest.java │ │ │ ├── AgentMonoTest.java │ │ │ ├── MockCoreSubscriber.java │ │ │ └── MockMono.java │ └── org │ │ └── springframework │ │ ├── http │ │ └── client │ │ │ └── SimpleClientHttpResponseFactory.java │ │ └── web │ │ └── reactive │ │ └── function │ │ └── client │ │ ├── MockClientRequest.java │ │ └── MockDefaultClientResponse.java │ └── resources │ └── mock_agent.properties ├── pom.xml ├── release ├── report ├── pom.xml └── src │ ├── main │ └── java │ │ ├── com │ │ └── megaease │ │ │ └── easeagent │ │ │ └── report │ │ │ ├── AgentReportAware.java │ │ │ ├── DefaultAgentReport.java │ │ │ ├── GlobalExtractor.java │ │ │ ├── OutputProperties.java │ │ │ ├── ReportConfigChange.java │ │ │ ├── async │ │ │ ├── AsyncProps.java │ │ │ ├── AsyncReporter.java │ │ │ ├── AsyncReporterMetrics.java │ │ │ ├── DefaultAsyncReporter.java │ │ │ ├── log │ │ │ │ ├── AccessLogReporter.java │ │ │ │ ├── ApplicationLogReporter.java │ │ │ │ └── LogAsyncProps.java │ │ │ ├── trace │ │ │ │ ├── SDKAsyncReporter.java │ │ │ │ └── TraceAsyncProps.java │ │ │ └── zipkin │ │ │ │ ├── AgentBufferNextMessage.java │ │ │ │ ├── AgentByteBoundedQueue.java │ │ │ │ └── WithSizeConsumer.java │ │ │ ├── encoder │ │ │ ├── PackedMessage.java │ │ │ ├── log │ │ │ │ ├── AccessLogJsonEncoder.java │ │ │ │ ├── AccessLogWriter.java │ │ │ │ ├── LogDataJsonEncoder.java │ │ │ │ ├── LogDataWriter.java │ │ │ │ └── pattern │ │ │ │ │ ├── LogDataDatePatternConverterDelegate.java │ │ │ │ │ ├── LogDataLevelPatternConverter.java │ │ │ │ │ ├── LogDataLineSeparatorPatternConverter.java │ │ │ │ │ ├── LogDataLoggerPatternConverter.java │ │ │ │ │ ├── LogDataMdcPatternConverter.java │ │ │ │ │ ├── LogDataPatternConverter.java │ │ │ │ │ ├── LogDataPatternFormatter.java │ │ │ │ │ ├── LogDataSimpleLiteralPatternConverter.java │ │ │ │ │ ├── LogDataThreadNamePatternConverter.java │ │ │ │ │ ├── LogDataThrowablePatternConverter.java │ │ │ │ │ ├── NamePatternConverter.java │ │ │ │ │ ├── NoOpPatternConverter.java │ │ │ │ │ └── SimpleMessageConverter.java │ │ │ ├── metric │ │ │ │ └── MetricJsonEncoder.java │ │ │ └── span │ │ │ │ ├── AbstractAgentV2SpanEndpointWriter.java │ │ │ │ ├── AgentV2SpanAnnotationsWriter.java │ │ │ │ ├── AgentV2SpanBaseWriter.java │ │ │ │ ├── AgentV2SpanGlobalWriter.java │ │ │ │ ├── AgentV2SpanLocalEndpointWriter.java │ │ │ │ ├── AgentV2SpanRemoteEndpointWriter.java │ │ │ │ ├── AgentV2SpanTagsWriter.java │ │ │ │ ├── AgentV2SpanWriter.java │ │ │ │ ├── GlobalExtrasSupplier.java │ │ │ │ ├── SpanJsonEncoder.java │ │ │ │ └── okhttp │ │ │ │ ├── HttpSpanJsonEncoder.java │ │ │ │ └── OkHttpJsonRequestBody.java │ │ │ ├── metric │ │ │ ├── MetricItem.java │ │ │ ├── MetricProps.java │ │ │ └── MetricReporterFactoryImpl.java │ │ │ ├── plugin │ │ │ ├── NoOpCall.java │ │ │ ├── NoOpEncoder.java │ │ │ ├── ReporterLoader.java │ │ │ └── ReporterRegistry.java │ │ │ ├── sender │ │ │ ├── AgentKafkaSender.java │ │ │ ├── AgentLoggerSender.java │ │ │ ├── NoOpSender.java │ │ │ ├── SenderConfigDecorator.java │ │ │ ├── SenderWithEncoder.java │ │ │ ├── ZipkinCallWrapper.java │ │ │ ├── metric │ │ │ │ ├── KeySender.java │ │ │ │ ├── MetricKafkaSender.java │ │ │ │ └── log4j │ │ │ │ │ ├── AppenderManager.java │ │ │ │ │ ├── LoggerFactory.java │ │ │ │ │ ├── MetricRefreshableAppender.java │ │ │ │ │ ├── RefreshableAppender.java │ │ │ │ │ └── TestableAppender.java │ │ │ └── okhttp │ │ │ │ ├── ByteRequestBody.java │ │ │ │ ├── HttpCall.java │ │ │ │ └── HttpSender.java │ │ │ ├── trace │ │ │ ├── RefreshableReporter.java │ │ │ ├── ReportSpanBuilder.java │ │ │ └── TraceReport.java │ │ │ └── util │ │ │ ├── SpanUtils.java │ │ │ ├── TextUtils.java │ │ │ └── Utils.java │ │ └── zipkin2 │ │ └── reporter │ │ ├── TracerConverter.java │ │ ├── brave │ │ ├── ConvertSpanReporter.java │ │ └── ConvertZipkinSpanHandler.java │ │ └── kafka11 │ │ ├── SDKKafkaSender.java │ │ ├── SDKSender.java │ │ └── SimpleSender.java │ └── test │ └── java │ └── com │ └── megaease │ └── easeagent │ └── report │ ├── HttpSenderTest.java │ ├── async │ └── zipkin │ │ └── AgentByteBoundedQueueTest.java │ ├── encoder │ └── log │ │ ├── LogDataJsonEncoderTest.java │ │ └── LogDataWriterTest.java │ ├── metric │ ├── MetricPropsTest.java │ └── MetricReporterFactoryTest.java │ └── trace │ └── TraceReportTest.java ├── resources ├── rootfs │ └── Dockerfile └── scripts │ ├── Jenkinsfile │ └── build-image.sh └── zipkin ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── megaease │ │ └── easeagent │ │ └── zipkin │ │ ├── CustomTagsSpanHandler.java │ │ ├── TracingProviderImpl.java │ │ ├── impl │ │ ├── AsyncRequest.java │ │ ├── MessageImpl.java │ │ ├── RemoteGetterImpl.java │ │ ├── RemoteSetterImpl.java │ │ ├── RequestContextImpl.java │ │ ├── ScopeImpl.java │ │ ├── SpanContextImpl.java │ │ ├── SpanImpl.java │ │ ├── TracingImpl.java │ │ └── message │ │ │ ├── MessagingTracingImpl.java │ │ │ ├── ZipkinConsumerRequest.java │ │ │ └── ZipkinProducerRequest.java │ │ └── logging │ │ ├── AgentLogMDC.java │ │ ├── AgentMDCScopeDecorator.java │ │ └── LogUtils.java └── resources │ └── META-INF │ └── services │ └── com.megaease.easeagent.plugin.bean.BeanProvider └── test └── java ├── brave ├── TracerTestUtils.java └── internal │ └── collect │ └── WeakConcurrentMapTestUtils.java └── com └── megaease └── easeagent └── zipkin ├── CustomTagsSpanHandlerTest.java ├── TracingProviderImplMock.java ├── TracingProviderImplTest.java ├── impl ├── AsyncRequestTest.java ├── MessageImplTest.java ├── MessagingRequestMock.java ├── RemoteGetterImplTest.java ├── RemoteSetterImplTest.java ├── RequestContextImplTest.java ├── RequestMock.java ├── ScopeImplTest.java ├── SpanContextImplTest.java ├── SpanImplTest.java ├── TracingImplTest.java └── message │ ├── MessagingTracingImplTest.java │ ├── ZipkinConsumerRequestTest.java │ └── ZipkinProducerRequestTest.java └── logging ├── AgentLogMDCTest.java ├── AgentMDCScopeDecoratorTest.java └── LogUtilsTest.java /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | end_of_line = lf 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | --- 11 | name: 🐞 Bug report 12 | about: Create a report to help us improve 13 | title: '' 14 | labels: '' 15 | assignees: '' 16 | 17 | --- 18 | 19 | **Describe the bug** 20 | A clear and concise description of what the bug is. 21 | 22 | **To Reproduce** 23 | Steps to reproduce the behavior: 24 | 1. Execute '...' 25 | 2. Send a request to '....' 26 | 3. See error 27 | 28 | **Expected behavior** 29 | A clear and concise description of what you expected to happen. 30 | 31 | **Version** 32 | The version number of Easegress. 33 | 34 | **Configuration** 35 | * EaseAgent Configuration 36 | ``` 37 | ``` 38 | 39 | **Logs** 40 | ``` 41 | EaseAgent logs, if applicable. 42 | ``` 43 | 44 | **OS and Hardware** 45 | - OS: [e.g. Ubuntu 20.04] 46 | - CPU:[e.g. Intel(R) Core(TM) i5-8265U] 47 | - Memory: [e.g. 16GB] 48 | 49 | **Additional context** 50 | Add any other context about the problem here. 51 | 52 | 53 | --- 54 | Thanks for contributing 🎉! 55 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | --- 11 | name: 🚀 Feature request 12 | about: Suggest an idea for this project 13 | title: '' 14 | labels: '' 15 | assignees: '' 16 | 17 | --- 18 | 19 | **Is your feature request related to a problem? Please describe.** 20 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 21 | 22 | **Describe the solution you'd like** 23 | A clear and concise description of what you want to happen. 24 | 25 | **Describe alternatives you've considered** 26 | A clear and concise description of any alternative solutions or features you've considered. 27 | 28 | **Additional context** 29 | Add any other context or screenshots about the feature request here. 30 | 31 | 32 | --- 33 | Thanks for contributing 🎉! 34 | -------------------------------------------------------------------------------- /.github/workflows/license-checker.yml: -------------------------------------------------------------------------------- 1 | name: License checker 2 | 3 | on: 4 | push: 5 | branches: 6 | - maste 7 | paths-ignore: 8 | - 'doc/**' 9 | - 'resources/**' 10 | - '**.md' 11 | pull_request: 12 | branches: 13 | - master 14 | paths-ignore: 15 | - 'doc/**' 16 | - 'resources/**' 17 | - '**.md' 18 | 19 | jobs: 20 | check-license: 21 | runs-on: ubuntu-latest 22 | 23 | steps: 24 | - uses: actions/checkout@v2 25 | - name: Check License Header 26 | uses: apache/skywalking-eyes@main 27 | env: 28 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | with: 30 | log: info 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | target/ 4 | dependency-reduced-pom.xml 5 | *.class 6 | *.swp 7 | **/*.versionsBackup 8 | 9 | .patch 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .DS_Store 15 | .vscode 16 | logs/ 17 | tmp/ 18 | -------------------------------------------------------------------------------- /build/src/main/java/com/megaease/easeagent/StartBootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent; 19 | 20 | import com.megaease.easeagent.core.Bootstrap; 21 | 22 | import java.lang.instrument.Instrumentation; 23 | 24 | public class StartBootstrap { 25 | private StartBootstrap() {} 26 | 27 | public static void premain(String args, Instrumentation inst, String javaAgentJarPath) { 28 | Bootstrap.start(args, inst, javaAgentJarPath); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /build/src/main/resources/agent-to-cloud_1.0.properties: -------------------------------------------------------------------------------- 1 | # for v2.0 agent send to megacloud-v1.0 kafka topic setting 2 | 3 | plugin.observability.global.metric.topic=application-meter 4 | plugin.observability.access.metric.topic=application-log 5 | plugin.observability.redis.metric.topic=platform-meter 6 | plugin.observability.rabbit.metric.topic=platform-meter 7 | plugin.observability.kafka.metric.topic=platform-meter 8 | plugin.observability.elasticsearch.metric.topic=platform-meter 9 | 10 | plugin.observability.jvmGc.metric.topic=platform-meter 11 | plugin.observability.jvmMemory.metric.topic=platform-meter 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /build/src/main/resources/easeagent-log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | %d [%10.10t] %5p %10.10c{1} - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /config/src/main/java/com/megaease/easeagent/config/AutoRefreshConfigItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.config; 19 | 20 | import com.megaease.easeagent.plugin.api.config.Config; 21 | 22 | import java.util.function.BiFunction; 23 | 24 | public class AutoRefreshConfigItem { 25 | private volatile T value; 26 | 27 | public AutoRefreshConfigItem(Config config, String name, BiFunction func) { 28 | ConfigUtils.bindProp(name, config, func, v -> this.value = v); 29 | } 30 | 31 | public T getValue() { 32 | return value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /config/src/main/java/com/megaease/easeagent/config/ConfigAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.config; 19 | 20 | import com.megaease.easeagent.plugin.api.config.Config; 21 | 22 | public interface ConfigAware { 23 | void setConfig(Config config); 24 | } 25 | -------------------------------------------------------------------------------- /config/src/test/resources/easeagent_config.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/config/src/test/resources/easeagent_config.jar -------------------------------------------------------------------------------- /config/src/test/resources/user-spec.properties: -------------------------------------------------------------------------------- 1 | name=user-spec 2 | system=system-spec 3 | -------------------------------------------------------------------------------- /config/src/test/resources/user-spec2.properties: -------------------------------------------------------------------------------- 1 | name=user-spec2 2 | system=system-spec2 3 | -------------------------------------------------------------------------------- /config/src/test/resources/user.properties: -------------------------------------------------------------------------------- 1 | name=demo-user 2 | system=demo-system 3 | 4 | ## topic for kafka use 5 | reporter.metric.sender.topic=application-meter 6 | 7 | #reporter.metric.encoder=MetricJsonEncoder 8 | reporter.metric.output.interval=30 9 | -------------------------------------------------------------------------------- /context/src/main/java/com/megaease/easeagent/context/log/LoggerImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.context.log; 19 | 20 | import com.megaease.easeagent.log4j2.api.AgentLogger; 21 | 22 | import java.util.function.Function; 23 | import java.util.logging.Logger; 24 | 25 | public class LoggerImpl extends AgentLogger implements com.megaease.easeagent.plugin.api.logging.Logger { 26 | public static final Function LOGGER_SUPPLIER = LoggerImpl::new; 27 | 28 | public LoggerImpl(Logger logger) { 29 | super(logger); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /context/src/test/java/com/megaease/easeagent/context/log/LoggerImplTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.context.log; 19 | 20 | import com.megaease.easeagent.plugin.api.logging.Logger; 21 | import org.junit.Test; 22 | 23 | import static org.junit.Assert.*; 24 | 25 | public class LoggerImplTest { 26 | @Test 27 | public void test() { 28 | LoggerFactoryImpl loggerFactory = LoggerFactoryImpl.build(); 29 | Logger logger = loggerFactory.getLogger(LoggerFactoryImplTest.class.getName()); 30 | assertTrue(logger instanceof LoggerImpl); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /context/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/megaease/easeagent/core/plugin/annotation/EaseAgentInstrumented.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.core.plugin.annotation; 19 | 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | @Retention(RetentionPolicy.RUNTIME) 24 | public @interface EaseAgentInstrumented { 25 | int value() default 0; 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/com/megaease/easeagent/core/plugin/annotation/Index.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.core.plugin.annotation; 19 | 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | @Retention(RetentionPolicy.RUNTIME) 24 | public @interface Index { 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/com/megaease/easeagent/core/plugin/matcher/Converter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.core.plugin.matcher; 19 | 20 | public interface Converter { 21 | T convert(S source); 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/com.megaease.easeagent.plugin.bean.BeanProvider: -------------------------------------------------------------------------------- 1 | com.megaease.easeagent.core.health.HealthProvider 2 | com.megaease.easeagent.core.info.AgentInfoProvider 3 | -------------------------------------------------------------------------------- /core/src/main/resources/version.txt: -------------------------------------------------------------------------------- 1 | ${project.version} 2 | -------------------------------------------------------------------------------- /core/src/test/java/com/megaease/easeagent/core/instrument/TestContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.core.instrument; 19 | 20 | import com.megaease.easeagent.plugin.bridge.NoOpContext; 21 | 22 | public class TestContext extends NoOpContext.NoopContext { 23 | @Override 24 | public boolean isNoop() { 25 | return false; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/com/megaease/easeagent/core/instrument/TestPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.core.instrument; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | 22 | public class TestPlugin implements AgentPlugin { 23 | @Override 24 | public String getNamespace() { 25 | return "test"; 26 | } 27 | 28 | @Override 29 | public String getDomain() { 30 | return "observability"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /doc/how-to-use/use-in-docker.md: -------------------------------------------------------------------------------- 1 | # Get the agent 2 | 3 | Download the agent, [see our doc](https://github.com/megaease/easeagent#get-and-set-environment-variable) 4 | 5 | # Modify startup scripts 6 | 7 | The startup parameters of the Java application server must include the built-in argument -javaagent. 8 | 9 | It is recommended that you set this argument with the JAVA_OPTS environment variable. 10 | 11 | The value of that argument must contain the location where you ADD the easeagent.jar file to the image. 12 | 13 | For example, with Tomcat, use commands like these in the Dockerfile: 14 | 15 | ```dockerfile 16 | RUN mkdir -p /usr/local/tomcat/easeagent 17 | ADD ./easeagent/easeagent.jar /usr/local/tomcat/easeagent/easeagent.jar 18 | ENV JAVA_OPTS="$JAVA_OPTS -javaagent:/usr/local/tomcat/easeagent/easeagent.jar" 19 | ``` 20 | 21 | # Restart your application 22 | 23 | Deploy your application to start using the EaseAgent to send data to MegaCloud. 24 | -------------------------------------------------------------------------------- /doc/images/Context-span-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/Context-span-api.png -------------------------------------------------------------------------------- /doc/images/Cross-server-tracing-UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/Cross-server-tracing-UML.png -------------------------------------------------------------------------------- /doc/images/Cross-thread-tracing-UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/Cross-thread-tracing-UML.png -------------------------------------------------------------------------------- /doc/images/EaseAgent-Architecture-Base-v2.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/EaseAgent-Architecture-Base-v2.0.png -------------------------------------------------------------------------------- /doc/images/EaseAgent-Architecture-v2.0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/EaseAgent-Architecture-v2.0.jpg -------------------------------------------------------------------------------- /doc/images/EaseAgent-Architecture-v2.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/EaseAgent-Architecture-v2.0.png -------------------------------------------------------------------------------- /doc/images/EaseAgent-Architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/EaseAgent-Architecture.jpg -------------------------------------------------------------------------------- /doc/images/MessageTracing-UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/MessageTracing-UML.png -------------------------------------------------------------------------------- /doc/images/Metric-Class-UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/Metric-Class-UML.png -------------------------------------------------------------------------------- /doc/images/Metric-SequenceDiagram-UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/Metric-SequenceDiagram-UML.png -------------------------------------------------------------------------------- /doc/images/SessionContext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/SessionContext.png -------------------------------------------------------------------------------- /doc/images/Span-tracing-UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/Span-tracing-UML.png -------------------------------------------------------------------------------- /doc/images/benchmark/10t-mem-heap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/10t-mem-heap.png -------------------------------------------------------------------------------- /doc/images/benchmark/10t-process-cpu-load-mean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/10t-process-cpu-load-mean.png -------------------------------------------------------------------------------- /doc/images/benchmark/10t-resp-per-15seconds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/10t-resp-per-15seconds.png -------------------------------------------------------------------------------- /doc/images/benchmark/10t-resp-time-p75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/10t-resp-time-p75.png -------------------------------------------------------------------------------- /doc/images/benchmark/20t-mem-heap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/20t-mem-heap.png -------------------------------------------------------------------------------- /doc/images/benchmark/20t-process-cpu-load-mean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/20t-process-cpu-load-mean.png -------------------------------------------------------------------------------- /doc/images/benchmark/20t-resp-per-15seconds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/20t-resp-per-15seconds.png -------------------------------------------------------------------------------- /doc/images/benchmark/20t-resp-time-p75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/20t-resp-time-p75.png -------------------------------------------------------------------------------- /doc/images/benchmark/50t-mem-heap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/50t-mem-heap.png -------------------------------------------------------------------------------- /doc/images/benchmark/50t-process-cpu-load-mean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/50t-process-cpu-load-mean.png -------------------------------------------------------------------------------- /doc/images/benchmark/50t-resp-per-15seconds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/50t-resp-per-15seconds.png -------------------------------------------------------------------------------- /doc/images/benchmark/50t-resp-time-p75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/50t-resp-time-p75.png -------------------------------------------------------------------------------- /doc/images/benchmark/agent-320vus-mem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/agent-320vus-mem.png -------------------------------------------------------------------------------- /doc/images/benchmark/agent-320vus-process-cpu-load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/agent-320vus-process-cpu-load.png -------------------------------------------------------------------------------- /doc/images/benchmark/agent-mem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/agent-mem.png -------------------------------------------------------------------------------- /doc/images/benchmark/agent-process-cpu-load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/agent-process-cpu-load.png -------------------------------------------------------------------------------- /doc/images/benchmark/baseline-320vus-mem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/baseline-320vus-mem.png -------------------------------------------------------------------------------- /doc/images/benchmark/baseline-320vus-process-cpu-load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/baseline-320vus-process-cpu-load.png -------------------------------------------------------------------------------- /doc/images/benchmark/baseline-cpu-load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/baseline-cpu-load.png -------------------------------------------------------------------------------- /doc/images/benchmark/baseline-mem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/baseline-mem.png -------------------------------------------------------------------------------- /doc/images/benchmark/baseline-process-cpu-load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/benchmark/baseline-process-cpu-load.png -------------------------------------------------------------------------------- /doc/images/enhancement-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/enhancement-debug.png -------------------------------------------------------------------------------- /doc/images/grafana-metric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/grafana-metric.png -------------------------------------------------------------------------------- /doc/images/grafana-tracing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/grafana-tracing.png -------------------------------------------------------------------------------- /doc/images/httpServletPlugin-module.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/httpServletPlugin-module.jpg -------------------------------------------------------------------------------- /doc/images/plugin-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/plugin-structure.png -------------------------------------------------------------------------------- /doc/images/prometheus-demo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/prometheus-demo-1.png -------------------------------------------------------------------------------- /doc/images/prometheus-demo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/prometheus-demo-2.png -------------------------------------------------------------------------------- /doc/images/prometheus-demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/prometheus-demo.jpg -------------------------------------------------------------------------------- /doc/images/prometheus-petclinic-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/prometheus-petclinic-demo.png -------------------------------------------------------------------------------- /doc/images/session-RunnableImplUML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/session-RunnableImplUML.png -------------------------------------------------------------------------------- /doc/images/simple-plugin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/simple-plugin.jpg -------------------------------------------------------------------------------- /doc/images/slack-community.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/slack-community.jpg -------------------------------------------------------------------------------- /doc/images/trace-and-span.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/trace-and-span.png -------------------------------------------------------------------------------- /doc/images/zipkin-span.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megaease/easeagent/8a5854b55cd703066c0d35e63029f2dd33ae2c74/doc/images/zipkin-span.jpg -------------------------------------------------------------------------------- /doc/report-development-guide.md: -------------------------------------------------------------------------------- 1 | # 2 | ToDo... 3 | -------------------------------------------------------------------------------- /httpserver/src/main/java/com/megaease/easeagent/httpserver/HttpRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.httpserver; 19 | 20 | import lombok.Builder; 21 | import lombok.Data; 22 | import org.apache.kafka.common.header.Headers; 23 | 24 | import java.io.InputStream; 25 | 26 | @Data 27 | @Builder 28 | public class HttpRequest { 29 | Headers headers; 30 | String method; 31 | String uri; 32 | String remoteIp; 33 | String remoteHostName; 34 | InputStream input; 35 | } 36 | -------------------------------------------------------------------------------- /httpserver/src/main/java/com/megaease/easeagent/httpserver/HttpResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.httpserver; 19 | 20 | import lombok.Builder; 21 | import lombok.Data; 22 | 23 | @Data 24 | @Builder 25 | public class HttpResponse { 26 | private int statusCode; 27 | private String data; 28 | } 29 | -------------------------------------------------------------------------------- /httpserver/src/main/java/com/megaease/easeagent/httpserver/IHttpHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.httpserver; 19 | 20 | import java.util.Map; 21 | 22 | public interface IHttpHandler { 23 | String getPath(); 24 | 25 | HttpResponse process(HttpRequest request, Map uriParams); 26 | 27 | default int priority() { 28 | return 100; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /httpserver/src/main/java/com/megaease/easeagent/httpserver/IHttpServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.httpserver; 19 | 20 | import java.util.List; 21 | 22 | public interface IHttpServer { 23 | void start(int port); 24 | 25 | void addHttpRoutes(List agentHttpHandlers); 26 | 27 | void stop(); 28 | } 29 | -------------------------------------------------------------------------------- /httpserver/src/main/java/com/megaease/easeagent/httpserver/nano/AgentHttpHandlerProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.httpserver.nano; 19 | 20 | import java.util.List; 21 | 22 | public interface AgentHttpHandlerProvider { 23 | 24 | List getAgentHttpHandlers(); 25 | } 26 | -------------------------------------------------------------------------------- /log4j2/README.md: -------------------------------------------------------------------------------- 1 | # HTTPS Supporting 2 | 3 | ## Import cert file to trust key store 4 | 5 | ``` 6 | keytool -importcert -v -trustcacerts -alias some.host.name -file /path/to/cert/file -keystore /path/to/store/file 7 | ``` 8 | 9 | ## Setup System properties 10 | 11 | ``` 12 | java -Djavax.net.ssl.trustStore=/path/to/store/file -Djavax.net.ssl.trustStorePassword=****** ... 13 | ``` 14 | 15 | > If `/path/to/store/file` is the JRE default store file, you can ignore properties above. 16 | 17 | ## Reference 18 | 19 | * [Converting PEM-format keys to JKS format](https://docs.oracle.com/cd/E35976_01/server.740/es_admin/src/tadm_ssl_convert_pem_to_jks.html) -------------------------------------------------------------------------------- /log4j2/log4j2-api/src/main/java/com/megaease/easeagent/log4j2/FinalClassloaderSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.log4j2; 19 | 20 | import java.util.function.Supplier; 21 | 22 | @SuppressWarnings("all") 23 | public class FinalClassloaderSupplier implements Supplier { 24 | public static volatile ClassLoader CLASSLOADER = null; 25 | 26 | 27 | @Override 28 | public ClassLoader get() { 29 | return CLASSLOADER; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /log4j2/log4j2-api/src/main/java/com/megaease/easeagent/log4j2/MDC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.log4j2; 19 | 20 | import com.megaease.easeagent.log4j2.api.Mdc; 21 | 22 | public class MDC { 23 | private static final Mdc MDC_I = LoggerFactory.FACTORY.mdc(); 24 | 25 | public static void put(String key, String value) { 26 | MDC_I.put(key, value); 27 | } 28 | 29 | public static void remove(String key) { 30 | MDC_I.remove(key); 31 | } 32 | 33 | public static String get(String key) { 34 | return MDC_I.get(key); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /log4j2/log4j2-api/src/main/java/com/megaease/easeagent/log4j2/exception/Log4j2Exception.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.log4j2.exception; 19 | 20 | public class Log4j2Exception extends RuntimeException { 21 | public Log4j2Exception(Throwable cause) { 22 | super(cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /metrics/src/main/java/com/megaease/easeagent/metrics/config/MetricsConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.metrics.config; 19 | 20 | import java.util.concurrent.TimeUnit; 21 | 22 | public interface MetricsConfig { 23 | boolean isEnabled(); 24 | 25 | int getInterval(); 26 | 27 | TimeUnit getIntervalUnit(); 28 | 29 | void setIntervalChangeCallback(Runnable runnable); 30 | } 31 | -------------------------------------------------------------------------------- /metrics/src/main/java/com/megaease/easeagent/metrics/converter/IgnoreOutputException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.metrics.converter; 19 | 20 | class IgnoreOutputException extends RuntimeException { 21 | public IgnoreOutputException(String message) { 22 | super(message); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /metrics/src/main/resources/META-INF/services/com.megaease.easeagent.plugin.bean.BeanProvider: -------------------------------------------------------------------------------- 1 | com.megaease.easeagent.metrics.MetricBeanProviderImpl 2 | com.megaease.easeagent.metrics.jvm.JvmBeanProvider 3 | -------------------------------------------------------------------------------- /metrics/src/test/java/com/megaease/easeagent/metrics/PrometheusAgentHttpHandlerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.metrics; 19 | 20 | import org.junit.Test; 21 | 22 | import static org.junit.Assert.assertEquals; 23 | 24 | public class PrometheusAgentHttpHandlerTest { 25 | 26 | @Test 27 | public void getPath() { 28 | assertEquals("/prometheus/metrics", new PrometheusAgentHttpHandler().getPath()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /metrics/src/test/java/com/megaease/easeagent/metrics/converter/IgnoreOutputExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.metrics.converter; 19 | 20 | import org.junit.Test; 21 | 22 | import static org.junit.Assert.*; 23 | 24 | public class IgnoreOutputExceptionTest { 25 | @Test(expected = IgnoreOutputException.class) 26 | public void constructor() { 27 | throw new IgnoreOutputException("test"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /metrics/src/test/java/com/megaease/easeagent/metrics/impl/MetricRegistryMock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.metrics.impl; 19 | 20 | import com.codahale.metrics.MetricRegistry; 21 | import com.megaease.easeagent.metrics.MetricRegistryService; 22 | 23 | public class MetricRegistryMock { 24 | private static final MetricRegistry CODAHALE_METRIC_REGISTRY = MetricRegistryService.DEFAULT.createMetricRegistry(null, null, null); 25 | 26 | public static MetricRegistry getCodahaleMetricRegistry() { 27 | return CODAHALE_METRIC_REGISTRY; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /metrics/src/test/java/com/megaease/easeagent/metrics/impl/MockClock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.metrics.impl; 19 | 20 | import com.codahale.metrics.Clock; 21 | 22 | import java.util.Iterator; 23 | import java.util.List; 24 | 25 | public class MockClock extends Clock { 26 | private final Iterator ticks; 27 | 28 | public MockClock(List ticks) { 29 | this.ticks = ticks.iterator(); 30 | } 31 | 32 | @Override 33 | public long getTick() { 34 | return ticks.next(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /metrics/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | name=test-metric-service 2 | system=test-metric-system 3 | 4 | plugin.observability.global.metric.enabled=true 5 | plugin.observability.jvmMemory.metric.enabled=true 6 | plugin.observability.testMetric.metric.enabled=true 7 | plugin.observability.testMetric.metric.interval=30 8 | plugin.observability.testMetric.metric.topic=application-meter 9 | plugin.observability.testMetric.metric.appendType=kafka 10 | 11 | plugin.observability.testMetric2.metric.intervalUnit=MILLISECONDS 12 | -------------------------------------------------------------------------------- /mock/config-mock/src/main/java/com/megaease/easeagent/config/MockConfigLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.config; 19 | 20 | import java.io.File; 21 | 22 | public class MockConfigLoader { 23 | public static GlobalConfigs loadFromFile(File file) { 24 | return ConfigLoader.loadFromFile(file); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mock/config-mock/src/test/java/com/megaease/easeagent/mock/config/MockConfigTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.config; 19 | 20 | import org.junit.Test; 21 | 22 | import static org.junit.Assert.*; 23 | 24 | public class MockConfigTest { 25 | 26 | @Test 27 | public void getCONFIGS() { 28 | assertTrue(MockConfig.getCONFIGS().getBoolean("test.mock.key")); 29 | assertEquals("testValue", MockConfig.getCONFIGS().getString("test.mock.keyStr")); 30 | assertNull(MockConfig.getCONFIGS().getString("test.mock.keyStrAAAAAAAAAA")); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mock/config-mock/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | test.mock.key=true 2 | test.mock.keyStr=testValue 3 | -------------------------------------------------------------------------------- /mock/config-mock/src/test/resources/mock_agent.yaml: -------------------------------------------------------------------------------- 1 | test: 2 | mock: 3 | key: true 4 | keyStr: testValue 5 | -------------------------------------------------------------------------------- /mock/context-mock/src/main/java/com/megaease/easeagent/mock/context/MockContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.context; 19 | 20 | import com.megaease.easeagent.plugin.api.Context; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.TYPE) 29 | public @interface MockContext { 30 | @SuppressWarnings("unused") 31 | Context ignored = MockContextManager.getContext(); 32 | } 33 | -------------------------------------------------------------------------------- /mock/log4j2-mock/src/main/java/com/megaease/easeagent/mock/log4j2/UrlSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.log4j2; 19 | 20 | import java.net.URL; 21 | 22 | public interface UrlSupplier { 23 | URL[] get(); 24 | } 25 | -------------------------------------------------------------------------------- /mock/log4j2-mock/src/main/resources/META-INF/services/com.megaease.easeagent.log4j2.ClassloaderSupplier: -------------------------------------------------------------------------------- 1 | com.megaease.easeagent.mock.log4j2.URLClassLoaderSupplier 2 | -------------------------------------------------------------------------------- /mock/log4j2-mock/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mock/metrics-mock/src/main/resources/META-INF/services/com.megaease.easeagent.mock.utils.MockProvider: -------------------------------------------------------------------------------- 1 | com.megaease.easeagent.mock.metrics.MockMetricProvider 2 | -------------------------------------------------------------------------------- /mock/plugin-api-mock/src/main/java/com/megaease/easeagent/mock/plugin/api/junit/ScopeMustBeCloseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.plugin.api.junit; 19 | 20 | public class ScopeMustBeCloseException extends RuntimeException{ 21 | public ScopeMustBeCloseException(String message) { 22 | super(message); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /mock/plugin-api-mock/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mock/report-mock/src/main/java/com/megaease/easeagent/mock/report/JsonReporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.report; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | public interface JsonReporter { 24 | void report(List> json); 25 | } 26 | -------------------------------------------------------------------------------- /mock/report-mock/src/main/java/com/megaease/easeagent/mock/report/MetricFlushable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.report; 19 | 20 | public interface MetricFlushable { 21 | void flush(); 22 | } 23 | -------------------------------------------------------------------------------- /mock/report-mock/src/main/java/com/megaease/easeagent/mock/report/MockSpanReport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.report; 19 | 20 | import com.megaease.easeagent.plugin.report.tracing.ReportSpan; 21 | 22 | public interface MockSpanReport { 23 | void report(ReportSpan span); 24 | } 25 | -------------------------------------------------------------------------------- /mock/report-mock/src/test/java/com/megaease/easeagent/mock/report/MockReportTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.report; 19 | 20 | import com.megaease.easeagent.plugin.report.AgentReport; 21 | import org.junit.Test; 22 | 23 | import static org.junit.Assert.assertNotNull; 24 | 25 | public class MockReportTest { 26 | 27 | @Test 28 | public void getAgentReport() { 29 | AgentReport agentReport = MockReport.getAgentReport(); 30 | assertNotNull(agentReport); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mock/report-mock/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mock/utils-mock/src/main/java/com/megaease/easeagent/mock/utils/MockProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.mock.utils; 19 | 20 | public interface MockProvider { 21 | Object get(); 22 | } 23 | -------------------------------------------------------------------------------- /mock/zipkin-mock/src/main/java/brave/internal/collect/WeakConcurrentMapTestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package brave.internal.collect; 19 | 20 | public class WeakConcurrentMapTestUtils { 21 | public static void runExpungeStaleEntries(WeakConcurrentMap weakConcurrentMap) { 22 | weakConcurrentMap.expungeStaleEntries(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /mock/zipkin-mock/src/main/resources/META-INF/services/com.megaease.easeagent.mock.utils.MockProvider: -------------------------------------------------------------------------------- 1 | com.megaease.easeagent.mock.zipkin.MockTracingProvider 2 | -------------------------------------------------------------------------------- /plugin-api/README.md: -------------------------------------------------------------------------------- 1 | # easeagent plugin api 2 | 3 | * It only serves plugin 4 | * It is a bridge between easeagent and plugin 5 | * It must be very clean 6 | * It tries to have only interfaces 7 | * It should not be dependent on other packages 8 | * Its interface is only related to plugin 9 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/AppendBootstrapLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin; 19 | 20 | public interface AppendBootstrapLoader { 21 | } 22 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/Ordered.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin; 19 | 20 | public interface Ordered { 21 | /** 22 | * Higher values operate later 23 | * For example: an interceptor with order=1 will be called after an interceptor with order=0. 24 | * 25 | * {@link com.megaease.easeagent.plugin.enums.Order} has predefined kinds of priorities 26 | * 27 | */ 28 | int order(); 29 | } 30 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/annotation/AdvicesTo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.annotation; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.TYPE) 27 | public @interface AdvicesTo { 28 | AdviceTo[] value(); 29 | } 30 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/annotation/DynamicField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.annotation; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | @SuppressWarnings("unused") 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.TYPE) 28 | public @interface DynamicField { 29 | } 30 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/Reporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api; 19 | 20 | import com.megaease.easeagent.plugin.report.EncodedData; 21 | 22 | /** 23 | * a reporter for message like metric or trace 24 | */ 25 | public interface Reporter { 26 | /** 27 | * out put the metric 28 | * 29 | * @param msg metric string like json 30 | */ 31 | void report(String msg); 32 | 33 | void report(EncodedData msg); 34 | } 35 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/config/AutoRefreshPluginConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.config; 19 | 20 | public interface AutoRefreshPluginConfig extends PluginConfigChangeListener { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/config/ConfigChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.config; 19 | 20 | import java.util.List; 21 | 22 | public interface ConfigChangeListener { 23 | void onChange(List list); 24 | } 25 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/config/Const.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.config; 19 | 20 | public interface Const { 21 | int MAX_PLUGIN_STACK = 10000; 22 | String ENABLED_CONFIG = "enabled"; 23 | 24 | int METRIC_DEFAULT_INTERVAL = 30; 25 | String METRIC_DEFAULT_INTERVAL_UNIT = "SECONDS"; 26 | String METRIC_DEFAULT_TOPIC = "application-meter"; 27 | 28 | String DEFAULT_APPEND_TYPE = "console"; 29 | } 30 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/config/PluginConfigChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.config; 19 | 20 | public interface PluginConfigChangeListener { 21 | void onChange(IPluginConfig oldConfig, IPluginConfig newConfig); 22 | } 23 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/context/IContextManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.context; 19 | 20 | import com.megaease.easeagent.plugin.api.InitializeContext; 21 | 22 | public interface IContextManager { 23 | /** 24 | * Get current context or create a context 25 | * @return context 26 | */ 27 | InitializeContext getContext(); 28 | } 29 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/dispatcher/IDispatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.dispatcher; 19 | 20 | import com.megaease.easeagent.plugin.interceptor.MethodInfo; 21 | import com.megaease.easeagent.plugin.api.Context; 22 | 23 | public interface IDispatcher { 24 | void enter(int chainIndex, MethodInfo info); 25 | 26 | Object exit(int chainIndex, MethodInfo methodInfo, 27 | Context context, Object result, Throwable e); 28 | } 29 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/logging/ILoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.logging; 19 | 20 | public interface ILoggerFactory { 21 | /** 22 | * Returns a logger that logs to the Java agent log output. 23 | * @return A log where messages can be written to the Java agent log file or console. 24 | */ 25 | public Logger getLogger(String name); 26 | 27 | default public Logger getLogger(Class clazz) { 28 | return getLogger(clazz.getCanonicalName()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/logging/Mdc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.logging; 19 | 20 | public interface Mdc { 21 | void put(String key, String value); 22 | 23 | void remove(String key); 24 | 25 | String get(String key); 26 | } 27 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/metric/Metric.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.metric; 19 | 20 | /** 21 | * A tag interface to indicate that a class is a metric. 22 | */ 23 | public interface Metric { 24 | } 25 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/metric/MetricProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.metric; 19 | 20 | public interface MetricProvider { 21 | MetricRegistrySupplier metricSupplier(); 22 | } 23 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/metric/MetricSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.metric; 19 | 20 | public interface MetricSupplier { 21 | M newMetric(); 22 | } 23 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/metric/name/ConverterType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.metric.name; 19 | 20 | public enum ConverterType { 21 | 22 | NONE(0), 23 | RATE(1), 24 | DURATION(2), 25 | ; 26 | 27 | private int value; 28 | 29 | public int getValue() { 30 | return value; 31 | } 32 | 33 | ConverterType(int value) { 34 | this.value = value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/metric/name/MetricType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.metric.name; 19 | 20 | import com.megaease.easeagent.plugin.api.metric.*; 21 | 22 | public enum MetricType { 23 | 24 | TimerType(Timer.class), 25 | HistogramType(Histogram.class), 26 | MeterType(Meter.class), 27 | CounterType(Counter.class), 28 | GaugeType(Gauge.class); 29 | 30 | MetricType(Class clazz) { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/otlp/common/LogMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.otlp.common; 19 | 20 | import com.megaease.easeagent.plugin.api.config.IPluginConfig; 21 | import com.megaease.easeagent.plugin.interceptor.MethodInfo; 22 | 23 | public interface LogMapper { 24 | public String MDC_KEYS = "encoder.collectMDCKeys"; 25 | 26 | AgentLogData mapLoggingEvent(MethodInfo methodInfo, int levelInt, IPluginConfig config); 27 | } 28 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/trace/Getter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.trace; 19 | 20 | public interface Getter { 21 | /** 22 | * @param name 23 | * @return 24 | * @see Request#header(String) 25 | */ 26 | String header(String name); 27 | } 28 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/trace/Message.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.trace; 19 | 20 | 21 | public interface Message { 22 | M get(); 23 | } 24 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/trace/Setter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.trace; 19 | 20 | public interface Setter { 21 | /** 22 | * @param name header name 23 | * @param value header value 24 | * @see Request#setHeader(String name, String value) 25 | */ 26 | void setHeader(String name, String value); 27 | } 28 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/trace/TracingContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.trace; 19 | 20 | import com.megaease.easeagent.plugin.api.Context; 21 | 22 | /** 23 | * Subtype of {@link Context} which can set up Tracing. 24 | */ 25 | public interface TracingContext extends Context { 26 | 27 | /** 28 | * set up tracing to the session tracing context 29 | * 30 | * @param tracing {@link ITracing} 31 | */ 32 | void setCurrentTracing(ITracing tracing); 33 | } 34 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/trace/TracingProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.trace; 19 | 20 | public interface TracingProvider { 21 | TracingSupplier tracingSupplier(); 22 | } 23 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/api/trace/TracingSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.api.trace; 19 | 20 | import com.megaease.easeagent.plugin.api.InitializeContext; 21 | 22 | import java.util.function.Supplier; 23 | 24 | public interface TracingSupplier { 25 | ITracing get(Supplier contextSupplier); 26 | } 27 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/async/ScheduleRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.async; 19 | 20 | public interface ScheduleRunner { 21 | 22 | void doJob(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/bean/AgentInitializingBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.bean; 19 | 20 | public interface AgentInitializingBean { 21 | void afterPropertiesSet(); 22 | } 23 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/bridge/AgentInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.bridge; 19 | 20 | public class AgentInfo { 21 | private final String type; 22 | private final String version; 23 | 24 | public AgentInfo(String type, String version) { 25 | this.type = type; 26 | this.version = version; 27 | } 28 | 29 | public String getType() { 30 | return type; 31 | } 32 | 33 | public String getVersion() { 34 | return version; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/bridge/NoOpCleaner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.bridge; 19 | 20 | import com.megaease.easeagent.plugin.api.Cleaner; 21 | 22 | public class NoOpCleaner implements Cleaner { 23 | public static final NoOpCleaner INSTANCE = new NoOpCleaner(); 24 | 25 | @Override 26 | public void close() { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/enums/ClassMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.enums; 19 | 20 | public enum ClassMatch { 21 | SUPER_CLASS, 22 | INTERFACE, 23 | NAMED, 24 | ANNOTATION, 25 | } 26 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/enums/Operator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.enums; 19 | 20 | public enum Operator { 21 | AND, 22 | OR, 23 | NEGATE, 24 | } 25 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/enums/StringMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.enums; 19 | 20 | public enum StringMatch { 21 | START_WITH, 22 | END_WITH, 23 | CONTAINS, 24 | EQUALS, 25 | } 26 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/field/DynamicFieldAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.field; 19 | 20 | public interface DynamicFieldAccessor { 21 | 22 | void setEaseAgent$$DynamicField$$Data(Object data); 23 | 24 | Object getEaseAgent$$DynamicField$$Data(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/field/NullObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.field; 19 | 20 | /** 21 | * default value for Agent Dynamic Field, 22 | * avoiding NullPointerException when serialized 23 | */ 24 | public class NullObject { 25 | public static final Object NULL = new Object(); 26 | 27 | public String toString() { 28 | return "null"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/interceptor/InterceptorProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.interceptor; 19 | 20 | import com.megaease.easeagent.plugin.interceptor.Interceptor; 21 | 22 | import java.util.function.Supplier; 23 | 24 | /** 25 | * used in autogenerate code 26 | */ 27 | public interface InterceptorProvider { 28 | Supplier getInterceptorProvider(); 29 | 30 | String getAdviceTo(); 31 | 32 | String getPluginClassName(); 33 | } 34 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/matcher/Matcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.matcher; 19 | 20 | public interface Matcher { 21 | } 22 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/matcher/loader/IClassLoaderMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 com.megaease.easeagent.plugin.matcher.loader; 20 | 21 | import com.megaease.easeagent.plugin.matcher.Matcher; 22 | 23 | public interface IClassLoaderMatcher extends Matcher { 24 | String getClassLoaderName(); 25 | 26 | IClassLoaderMatcher negate(); 27 | } 28 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/matcher/operator/AndClassMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.matcher.operator; 19 | 20 | import com.megaease.easeagent.plugin.matcher.IClassMatcher; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | public class AndClassMatcher implements IClassMatcher { 25 | protected IClassMatcher left; 26 | protected IClassMatcher right; 27 | 28 | public AndClassMatcher(IClassMatcher left, IClassMatcher right) { 29 | this.left = left; 30 | this.right = right; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/matcher/operator/NegateClassMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.matcher.operator; 19 | 20 | import com.megaease.easeagent.plugin.matcher.IClassMatcher; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | public class NegateClassMatcher implements IClassMatcher { 25 | protected IClassMatcher matcher; 26 | 27 | public NegateClassMatcher(IClassMatcher matcher) { 28 | this.matcher = matcher; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/matcher/operator/Operator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.matcher.operator; 19 | 20 | public interface Operator { 21 | S and(S matcher); 22 | S or(S matcher); 23 | S negate(); 24 | } 25 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/matcher/operator/OrClassMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.matcher.operator; 19 | 20 | import com.megaease.easeagent.plugin.matcher.IClassMatcher; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | public class OrClassMatcher implements IClassMatcher { 25 | protected IClassMatcher left; 26 | protected IClassMatcher right; 27 | 28 | public OrClassMatcher(IClassMatcher left, IClassMatcher right) { 29 | this.left = left; 30 | this.right = right; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/report/ByteWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.report; 19 | 20 | public class ByteWrapper implements EncodedData { 21 | byte[] data; 22 | 23 | public ByteWrapper(byte[] data) { 24 | this.data = data; 25 | } 26 | 27 | @Override 28 | public byte[] getData() { 29 | return data; 30 | } 31 | 32 | @Override 33 | public int size() { 34 | return this.data.length; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/report/Call.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 com.megaease.easeagent.plugin.report; 20 | 21 | import java.io.IOException; 22 | 23 | @SuppressWarnings("unused") 24 | public interface Call { 25 | V execute() throws IOException; 26 | 27 | default void enqueue(Callback cb) { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/report/EncodedData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.report; 19 | 20 | public interface EncodedData { 21 | int size(); 22 | 23 | byte[] getData(); 24 | 25 | EncodedData EMPTY = new EncodedData() { 26 | @Override 27 | public int size() { 28 | return 0; 29 | } 30 | 31 | @Override 32 | public byte[] getData() { 33 | return new byte[0]; 34 | } 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/report/metric/MetricReporterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.report.metric; 19 | 20 | import com.megaease.easeagent.plugin.api.Reporter; 21 | import com.megaease.easeagent.plugin.api.config.IPluginConfig; 22 | 23 | /** 24 | * Metric plugin get reporter from metricReporterFactory 25 | */ 26 | public interface MetricReporterFactory { 27 | Reporter reporter(IPluginConfig config); 28 | } 29 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/tools/metrics/NameFactorySupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.tools.metrics; 19 | 20 | import com.megaease.easeagent.plugin.api.metric.name.NameFactory; 21 | 22 | /** 23 | * A {@link NameFactory} Supplier 24 | */ 25 | public interface NameFactorySupplier { 26 | /** 27 | * new a NameFactory 28 | * 29 | * @return {@link NameFactory} 30 | */ 31 | NameFactory newInstance(); 32 | } 33 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/tools/trace/HttpRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.tools.trace; 19 | 20 | import com.megaease.easeagent.plugin.api.trace.Request; 21 | 22 | public interface HttpRequest extends Request { 23 | @Override 24 | default String name() { 25 | return method(); 26 | } 27 | 28 | String method(); 29 | 30 | String path(); 31 | 32 | String route(); 33 | 34 | String getRemoteAddr(); 35 | 36 | int getRemotePort(); 37 | } 38 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/tools/trace/HttpResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.tools.trace; 19 | 20 | import com.megaease.easeagent.plugin.api.trace.Response; 21 | 22 | public interface HttpResponse extends Response { 23 | 24 | String method(); 25 | 26 | String route(); 27 | 28 | int statusCode(); 29 | 30 | Throwable maybeError(); 31 | } 32 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/tools/trace/TraceConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.tools.trace; 19 | 20 | public interface TraceConst { 21 | String HTTP_HEADER_X_FORWARDED_FOR = "X-Forwarded-For"; 22 | String HTTP_ATTRIBUTE_ROUTE = "http.route"; 23 | String HTTP_TAG_ROUTE = HTTP_ATTRIBUTE_ROUTE; 24 | String HTTP_TAG_METHOD = "http.method"; 25 | String HTTP_TAG_PATH = "http.path"; 26 | String HTTP_TAG_STATUS_CODE = "http.status_code"; 27 | String HTTP_TAG_ERROR = "error"; 28 | } 29 | -------------------------------------------------------------------------------- /plugin-api/src/main/java/com/megaease/easeagent/plugin/utils/Pair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.utils; 19 | 20 | public class Pair { 21 | private final K key; 22 | private final V value; 23 | 24 | public Pair(K key, V value) { 25 | this.key = key; 26 | this.value = value; 27 | } 28 | 29 | public K getKey() { 30 | return key; 31 | } 32 | 33 | public V getValue() { 34 | return value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /plugins/async/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /plugins/dubbo/src/main/java/com/megaease/easeagent/plugin/dubbo/DubboMetricTags.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.dubbo; 2 | 3 | public enum DubboMetricTags { 4 | CATEGORY("application"), 5 | TYPE("dubbo"), 6 | LABEL_NAME("interface"), 7 | ; 8 | 9 | public final String name; 10 | 11 | DubboMetricTags(String name) { 12 | this.name = name; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /plugins/dubbo/src/main/java/com/megaease/easeagent/plugin/dubbo/DubboPlugin.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.dubbo; 2 | 3 | import com.megaease.easeagent.plugin.AgentPlugin; 4 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 5 | 6 | public class DubboPlugin implements AgentPlugin { 7 | @Override 8 | public String getNamespace() { 9 | return ConfigConst.Namespace.DUBBO; 10 | } 11 | 12 | @Override 13 | public String getDomain() { 14 | return ConfigConst.OBSERVABILITY; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /plugins/dubbo/src/main/java/com/megaease/easeagent/plugin/dubbo/DubboTraceTags.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.dubbo; 2 | 3 | public enum DubboTraceTags { 4 | SERVICE("dubbo.service"), 5 | METHOD("dubbo.method"), 6 | SERVICE_VERSION("dubbo.service.version"), 7 | SERVER_APPLICATION("dubbo.server.application"), 8 | CLIENT_APPLICATION("dubbo.client.application"), 9 | GROUP("dubbo.group"), 10 | ARGS("dubbo.args"), 11 | RESULT("dubbo.result"), 12 | ; 13 | 14 | public final String name; 15 | 16 | DubboTraceTags(String name) { 17 | this.name = name; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugins/dubbo/src/main/java/com/megaease/easeagent/plugin/dubbo/advice/AlibabaDubboResponseFutureAdvice.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.dubbo.advice; 2 | 3 | import com.megaease.easeagent.plugin.Points; 4 | import com.megaease.easeagent.plugin.matcher.ClassMatcher; 5 | import com.megaease.easeagent.plugin.matcher.IClassMatcher; 6 | import com.megaease.easeagent.plugin.matcher.IMethodMatcher; 7 | import com.megaease.easeagent.plugin.matcher.MethodMatcher; 8 | 9 | import java.util.Set; 10 | 11 | public class AlibabaDubboResponseFutureAdvice implements Points { 12 | private static final String RESPONSE_FUTURE_CLASS_NAME = "com.alibaba.dubbo.remoting.exchange.ResponseFuture"; 13 | private static final String SET_CALLBACK_METHOD = "setCallback"; 14 | 15 | @Override 16 | public IClassMatcher getClassMatcher() { 17 | return ClassMatcher.builder() 18 | .hasSuperClass(RESPONSE_FUTURE_CLASS_NAME) 19 | .build(); 20 | } 21 | 22 | @Override 23 | public Set getMethodMatcher() { 24 | return MethodMatcher.builder() 25 | .named(SET_CALLBACK_METHOD) 26 | .build() 27 | .toSet(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugins/dubbo/src/main/java/com/megaease/easeagent/plugin/dubbo/interceptor/DubboBaseInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.dubbo.interceptor; 2 | 3 | import com.megaease.easeagent.plugin.api.config.AutoRefreshPluginConfigRegistry; 4 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 5 | import com.megaease.easeagent.plugin.api.config.IPluginConfig; 6 | import com.megaease.easeagent.plugin.dubbo.config.DubboTraceConfig; 7 | import com.megaease.easeagent.plugin.interceptor.Interceptor; 8 | 9 | public abstract class DubboBaseInterceptor implements Interceptor { 10 | 11 | public static volatile DubboTraceConfig DUBBO_TRACE_CONFIG; 12 | 13 | @Override 14 | public void init(IPluginConfig config, String className, String methodName, String methodDescriptor) { 15 | DUBBO_TRACE_CONFIG = AutoRefreshPluginConfigRegistry.getOrCreate(ConfigConst.OBSERVABILITY, ConfigConst.Namespace.DUBBO, this.getType(), DubboTraceConfig.SUPPLIER); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /plugins/dubbo/src/main/java/com/megaease/easeagent/plugin/dubbo/interceptor/trace/apache/ApacheDubboTraceCallback.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.dubbo.interceptor.trace.apache; 2 | 3 | import com.megaease.easeagent.plugin.api.trace.Span; 4 | import com.megaease.easeagent.plugin.dubbo.ApacheDubboCtxUtils; 5 | import org.apache.dubbo.rpc.Result; 6 | 7 | import java.util.function.BiConsumer; 8 | 9 | public class ApacheDubboTraceCallback implements BiConsumer { 10 | private Span span; 11 | 12 | public ApacheDubboTraceCallback(Span span) { 13 | this.span = span; 14 | } 15 | 16 | @Override 17 | public void accept(Result result, Throwable throwable) { 18 | ApacheDubboCtxUtils.doFinishSpan(span, result, throwable); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /plugins/dubbo/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | ## dubbo arguments collect switch 2 | plugin.observability.dubbo.tracing.args.collect.enabled=true 3 | plugin.observability.dubbo.tracing.result.collect.enabled=true 4 | -------------------------------------------------------------------------------- /plugins/elasticsearch/src/main/java/com/megaease/easeagent/plugin/elasticsearch/interceptor/ElasticsearchBaseTraceInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.elasticsearch.interceptor; 19 | 20 | import com.megaease.easeagent.plugin.enums.Order; 21 | 22 | public abstract class ElasticsearchBaseTraceInterceptor extends ElasticsearchBaseInterceptor { 23 | 24 | @Override 25 | public String getType() { 26 | return Order.TRACING.getName(); 27 | } 28 | 29 | @Override 30 | public int order() { 31 | return Order.TRACING.getOrder(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/healthy/src/main/java/com/megaease/easeagent/plugin/healthy/HealthPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.healthy; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class HealthPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.HEALTH; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/httpclient/src/main/java/com/megaease/easeagent/plugin/httpclient/ForwardedPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.httpclient; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class ForwardedPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.FORWARDED; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/httpclient/src/main/java/com/megaease/easeagent/plugin/httpclient/HttpClientPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.httpclient; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class HttpClientPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.HTTPCLIENT; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/httpclient/src/test/java/com/megaease/easeagent/plugin/httpclient/interceptor/TestConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.httpclient.interceptor; 19 | 20 | public class TestConst { 21 | public static final String FORWARDED_NAME = "X-Forwarded-For"; 22 | public static final String FORWARDED_VALUE = "testForwarded"; 23 | public static final String RESPONSE_TAG_NAME = "X-EG-Test"; 24 | public static final String RESPONSE_TAG_VALUE = "X-EG-Test-Value"; 25 | } 26 | -------------------------------------------------------------------------------- /plugins/httpclient/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | easeagent.progress.forwarded.headers=X-Forwarded-For 2 | observability.tracings.tag.response.headers.eg.0=X-EG-Test 3 | -------------------------------------------------------------------------------- /plugins/httpservlet/src/main/java/com/megaease/easeagent/plugin/httpservlet/utils/SpringWebUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.httpservlet.utils; 19 | 20 | public class SpringWebUtils { 21 | 22 | public static String getBestMatchingPatternAttribute(){ 23 | return org.springframework.web.servlet.HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugins/httpservlet/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | name=test-httpservlet-service 2 | system=test-httpservlet-system 3 | easeagent.progress.forwarded.headers=X-Forwarded-For 4 | observability.tracings.tag.response.headers.eg.0=X-EG-Test 5 | # plugin.observability.httpServlet.metric.enabled=true 6 | plugin.observability.httpServlet.metric.interval=1 7 | -------------------------------------------------------------------------------- /plugins/httpurlconnection/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023, MegaEase 3 | # All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | easeagent.progress.forwarded.headers=X-Forwarded-For 19 | observability.tracings.tag.response.headers.eg.0=X-EG-Test 20 | -------------------------------------------------------------------------------- /plugins/jdbc/src/main/java/com/megaease/easeagent/plugin/jdbc/JdbcTracingPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.jdbc; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class JdbcTracingPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.JDBC; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/jdbc/src/main/java/com/megaease/easeagent/plugin/jdbc/common/SQLCompression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.jdbc.common; 19 | 20 | public interface SQLCompression { 21 | 22 | SQLCompression DEFAULT = origin -> origin; 23 | 24 | String compress(String origin); 25 | } 26 | -------------------------------------------------------------------------------- /plugins/jdbc/src/main/java/com/megaease/easeagent/plugin/jdbc/common/SQLCompressionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.jdbc.common; 19 | 20 | public class SQLCompressionFactory { 21 | 22 | public static SQLCompression getSqlCompression() { 23 | return SQLCompressionWrapper.INSTANCE; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugins/jdbc/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | name=test-jdbc-service 2 | system=test-jdbc-system 3 | -------------------------------------------------------------------------------- /plugins/kafka/src/main/java/com/megaease/easeagent/plugin/kafka/KafkaPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.kafka; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class KafkaPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.KAFKA; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/kafka/src/main/java/com/megaease/easeagent/plugin/kafka/KafkaRedirectPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.kafka; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class KafkaRedirectPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.KAFKA; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/kafka/src/main/java/com/megaease/easeagent/plugin/kafka/interceptor/tracing/KafkaTags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.kafka.interceptor.tracing; 19 | 20 | /** 21 | * Tagging policy is not yet dynamic. The descriptions below reflect static policy. 22 | * 23 | * copy from zipkin.kafka.brave 24 | */ 25 | final class KafkaTags { 26 | static final String KAFKA_KEY_TAG = "kafka.key"; 27 | static final String KAFKA_TOPIC_TAG = "kafka.topic"; 28 | static final String KAFKA_BROKER_TAG = "kafka.broker"; 29 | } 30 | -------------------------------------------------------------------------------- /plugins/kafka/src/test/java/com/megaease/easeagent/plugin/kafka/interceptor/TestConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.kafka.interceptor; 19 | 20 | public class TestConst { 21 | public static final String URIS = "127.0.0.1:9090,127.0.0.2:9090"; 22 | public static final String REDIRECT_URIS = "192.168.0.12:9090,192.168.0.13:9090"; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /plugins/kafka/src/test/java/com/megaease/easeagent/plugin/kafka/interceptor/initialize/ConsumerRecordInterceptorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.kafka.interceptor.initialize; 19 | 20 | import com.megaease.easeagent.plugin.enums.Order; 21 | import org.junit.Test; 22 | 23 | import static org.junit.Assert.assertEquals; 24 | 25 | public class ConsumerRecordInterceptorTest { 26 | 27 | @Test 28 | public void order() { 29 | assertEquals(Order.LOWEST.getOrder(), new ConsumerRecordInterceptor().order()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /plugins/kafka/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | plugin.observability.kafka.metric.interval=100 2 | plugin.observability.kafka.metric.intervalUnit=MILLISECONDS 3 | -------------------------------------------------------------------------------- /plugins/logback/src/main/java/com/megaease/easeagent/logback/LogbackPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.logback; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class LogbackPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return "logback"; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/mongodb/src/main/java/com/megaease/easeagent/plugin/mongodb/MongoPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.mongodb; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class MongoPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return "mongodb"; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/mongodb/src/main/java/com/megaease/easeagent/plugin/mongodb/MongoRedirectPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.mongodb; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class MongoRedirectPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return "mongodb"; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/mongodb/src/main/java/com/megaease/easeagent/plugin/mongodb/interceptor/InterceptorHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.mongodb.interceptor; 19 | 20 | public class InterceptorHelper { 21 | } 22 | -------------------------------------------------------------------------------- /plugins/mongodb/src/main/java/com/megaease/easeagent/plugin/mongodb/interceptor/MongoBaseTraceInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.mongodb.interceptor; 19 | 20 | import com.megaease.easeagent.plugin.enums.Order; 21 | 22 | public abstract class MongoBaseTraceInterceptor extends MongoBaseInterceptor { 23 | 24 | @Override 25 | public String getType() { 26 | return Order.TRACING.getName(); 27 | } 28 | 29 | @Override 30 | public int order() { 31 | return Order.TRACING.getOrder(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/mongodb/src/main/java/com/megaease/easeagent/plugin/mongodb/interceptor/listener/MongoBaseTraceCommandListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.mongodb.interceptor.listener; 19 | 20 | import com.megaease.easeagent.plugin.api.config.AutoRefreshPluginConfigImpl; 21 | 22 | public abstract class MongoBaseTraceCommandListener extends MongoBaseCommandListener { 23 | 24 | public MongoBaseTraceCommandListener(AutoRefreshPluginConfigImpl config) { 25 | super(config); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/MotanPlugin.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan; 2 | 3 | import com.megaease.easeagent.plugin.AgentPlugin; 4 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 5 | 6 | public class MotanPlugin implements AgentPlugin { 7 | 8 | @Override 9 | public String getNamespace() { 10 | return ConfigConst.Namespace.MOTAN; 11 | } 12 | 13 | @Override 14 | public String getDomain() { 15 | return ConfigConst.OBSERVABILITY; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/advice/MotanConsumerAdvice.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.advice; 2 | 3 | import com.megaease.easeagent.plugin.Points; 4 | import com.megaease.easeagent.plugin.matcher.ClassMatcher; 5 | import com.megaease.easeagent.plugin.matcher.IClassMatcher; 6 | import com.megaease.easeagent.plugin.matcher.IMethodMatcher; 7 | import com.megaease.easeagent.plugin.matcher.MethodMatcher; 8 | 9 | import java.util.Set; 10 | 11 | public class MotanConsumerAdvice implements Points { 12 | private static final String ENHANCE_CLASS = "com.weibo.api.motan.rpc.AbstractReferer"; 13 | 14 | private static final String ENHANCE_METHOD = "doCall"; 15 | 16 | @Override 17 | public IClassMatcher getClassMatcher() { 18 | return ClassMatcher.builder().hasSuperClass(ENHANCE_CLASS) 19 | .build(); 20 | } 21 | 22 | @Override 23 | public Set getMethodMatcher() { 24 | return MethodMatcher.multiBuilder() 25 | .match( 26 | MethodMatcher.builder() 27 | .named(ENHANCE_METHOD) 28 | .build() 29 | ) 30 | .build(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/advice/MotanProviderAdvice.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.advice; 2 | 3 | import com.megaease.easeagent.plugin.Points; 4 | import com.megaease.easeagent.plugin.matcher.IClassMatcher; 5 | import com.megaease.easeagent.plugin.matcher.IMethodMatcher; 6 | import com.megaease.easeagent.plugin.matcher.MethodMatcher; 7 | import com.megaease.easeagent.plugin.tools.matcher.ClassMatcherUtils; 8 | import com.megaease.easeagent.plugin.tools.matcher.MethodMatcherUtils; 9 | 10 | import java.util.Set; 11 | 12 | public class MotanProviderAdvice implements Points { 13 | private static final String ENHANCE_CLASS = "com.weibo.api.motan.transport.ProviderMessageRouter"; 14 | 15 | private static final String ENHANCE_METHOD = "call"; 16 | 17 | @Override 18 | public IClassMatcher getClassMatcher() { 19 | return ClassMatcherUtils.name(ENHANCE_CLASS); 20 | } 21 | 22 | @Override 23 | public Set getMethodMatcher() { 24 | return MethodMatcher.multiBuilder() 25 | .match( 26 | MethodMatcherUtils.name(ENHANCE_METHOD) 27 | ) 28 | .build(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/MotanClassUtils.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor; 2 | 3 | import com.megaease.easeagent.plugin.utils.ClassUtils.TypeChecker; 4 | import com.weibo.api.motan.rpc.DefaultResponseFuture; 5 | 6 | public enum MotanClassUtils { 7 | DefaultResponseFutureTypeChecker(new DefaultResponseFutureTypeChecker()), 8 | ; 9 | 10 | private TypeChecker typeChecker; 11 | 12 | MotanClassUtils(TypeChecker typeChecker) { 13 | this.typeChecker = typeChecker; 14 | } 15 | 16 | public TypeChecker getTypeChecker() { 17 | return typeChecker; 18 | } 19 | 20 | public static class DefaultResponseFutureTypeChecker extends TypeChecker { 21 | 22 | public DefaultResponseFutureTypeChecker() { 23 | super("com.weibo.api.motan.rpc.DefaultResponseFuture"); 24 | } 25 | 26 | @Override 27 | protected boolean isType(Object o) { 28 | return o instanceof DefaultResponseFuture; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/metrics/MotanBaseMetricsInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor.metrics; 2 | 3 | import com.megaease.easeagent.plugin.api.config.IPluginConfig; 4 | import com.megaease.easeagent.plugin.api.metric.ServiceMetricRegistry; 5 | import com.megaease.easeagent.plugin.api.metric.name.Tags; 6 | import com.megaease.easeagent.plugin.enums.Order; 7 | import com.megaease.easeagent.plugin.interceptor.Interceptor; 8 | 9 | public abstract class MotanBaseMetricsInterceptor implements Interceptor { 10 | public static volatile MotanMetric MOTAN_METRIC; 11 | 12 | @Override 13 | public int order() { 14 | return Order.METRIC.getOrder(); 15 | } 16 | 17 | @Override 18 | public String getType() { 19 | return Order.METRIC.getName(); 20 | } 21 | 22 | @Override 23 | public void init(IPluginConfig config, String className, String methodName, String methodDescriptor) { 24 | Tags tags = new Tags(MotanMetricTags.CATEGORY.name, MotanMetricTags.TYPE.name, MotanMetricTags.LABEL_NAME.name); 25 | MOTAN_METRIC = ServiceMetricRegistry.getOrCreate(config, tags, MotanMetric.MOTAN_METRIC_SUPPLIER); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/metrics/MotanMetricTags.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor.metrics; 2 | 3 | public enum MotanMetricTags { 4 | CATEGORY("application"), 5 | TYPE("motan"), 6 | LABEL_NAME("interface"), 7 | ; 8 | 9 | public final String name; 10 | 11 | MotanMetricTags(String name) { 12 | this.name = name; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/trace/MotanBaseInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor.trace; 2 | 3 | import com.megaease.easeagent.plugin.api.config.AutoRefreshPluginConfigRegistry; 4 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 5 | import com.megaease.easeagent.plugin.api.config.IPluginConfig; 6 | import com.megaease.easeagent.plugin.interceptor.Interceptor; 7 | import com.megaease.easeagent.plugin.motan.config.MotanPluginConfig; 8 | 9 | public abstract class MotanBaseInterceptor implements Interceptor { 10 | 11 | public static volatile MotanPluginConfig MOTAN_PLUGIN_CONFIG = null; 12 | 13 | @Override 14 | public void init(IPluginConfig config, String className, String methodName, String methodDescriptor) { 15 | MOTAN_PLUGIN_CONFIG = AutoRefreshPluginConfigRegistry.getOrCreate(ConfigConst.OBSERVABILITY, ConfigConst.Namespace.MOTAN, this.getType(), MotanPluginConfig.SUPPLIER); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/trace/MotanTags.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor.trace; 2 | 3 | public enum MotanTags { 4 | APPLICATION("motan.application"), 5 | GROUP("motan.group"), 6 | MODULE("motan.module"), 7 | SERVICE("motan.service"), 8 | SERVICE_VERSION("motan.service.version"), 9 | METHOD("motan.method"), 10 | ARGUMENTS("motan.args"), 11 | RESULT("motan.result"), 12 | ; 13 | 14 | public final String name; 15 | 16 | MotanTags(String tagName) { 17 | this.name = tagName; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/trace/consumer/MotanConsumerRequest.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor.trace.consumer; 2 | 3 | import com.megaease.easeagent.plugin.api.trace.Request; 4 | import com.megaease.easeagent.plugin.api.trace.Span; 5 | import com.megaease.easeagent.plugin.motan.interceptor.MotanCtxUtils; 6 | 7 | public class MotanConsumerRequest implements Request { 8 | private com.weibo.api.motan.rpc.Request request; 9 | 10 | public MotanConsumerRequest(com.weibo.api.motan.rpc.Request request) { 11 | this.request = request; 12 | } 13 | 14 | @Override 15 | public Span.Kind kind() { 16 | return Span.Kind.CLIENT; 17 | } 18 | 19 | @Override 20 | public String header(String name) { 21 | return request.getAttachments().get(name); 22 | } 23 | 24 | @Override 25 | public String name() { 26 | return MotanCtxUtils.name(request); 27 | } 28 | 29 | @Override 30 | public boolean cacheScope() { 31 | return false; 32 | } 33 | 34 | @Override 35 | public void setHeader(String name, String value) { 36 | request.getAttachments().put(name, value); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/trace/consumer/TraceFutureListener.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor.trace.consumer; 2 | 3 | import com.megaease.easeagent.plugin.api.Cleaner; 4 | import com.megaease.easeagent.plugin.api.context.AsyncContext; 5 | import com.megaease.easeagent.plugin.bridge.EaseAgent; 6 | import com.megaease.easeagent.plugin.motan.interceptor.MotanCtxUtils; 7 | import com.weibo.api.motan.rpc.Future; 8 | import com.weibo.api.motan.rpc.FutureListener; 9 | 10 | public class TraceFutureListener implements FutureListener { 11 | private AsyncContext asyncContext; 12 | 13 | public TraceFutureListener(AsyncContext asyncContext) { 14 | this.asyncContext = asyncContext; 15 | } 16 | 17 | @Override 18 | public void operationComplete(Future future) throws Exception { 19 | try(Cleaner cleaner = asyncContext.importToCurrent()){ 20 | MotanCtxUtils.finishConsumerSpan(future, EaseAgent.getContext()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /plugins/motan/src/main/java/com/megaease/easeagent/plugin/motan/interceptor/trace/provider/MotanProviderRequest.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.motan.interceptor.trace.provider; 2 | 3 | import com.megaease.easeagent.plugin.api.trace.Request; 4 | import com.megaease.easeagent.plugin.api.trace.Span; 5 | import com.megaease.easeagent.plugin.motan.interceptor.MotanCtxUtils; 6 | 7 | public class MotanProviderRequest implements Request { 8 | 9 | private final com.weibo.api.motan.rpc.Request request; 10 | 11 | public MotanProviderRequest(com.weibo.api.motan.rpc.Request request) { 12 | this.request = request; 13 | } 14 | 15 | @Override 16 | public Span.Kind kind() { 17 | return Span.Kind.SERVER; 18 | } 19 | 20 | @Override 21 | public String header(String name) { 22 | return request.getAttachments().get(name); 23 | } 24 | 25 | @Override 26 | public String name() { 27 | return MotanCtxUtils.name(request); 28 | } 29 | 30 | @Override 31 | public boolean cacheScope() { 32 | return false; 33 | } 34 | 35 | @Override 36 | public void setHeader(String name, String value) { 37 | request.getAttachments().put(name, value); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /plugins/motan/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | # 2 | # -------------------- motan --------------------- 3 | # motan tracing 4 | plugin.observability.motan.tracing.enabled=true 5 | plugin.observability.motan.tracing.args.collect.enabled=true 6 | plugin.observability.motan.tracing.result.collect.enabled=true 7 | # motan metric 8 | plugin.observability.motan.metric.enabled=true 9 | plugin.observability.motan.metric.interval=30 10 | plugin.observability.motan.metric.topic=platform-metrics 11 | plugin.observability.motan.metric.url=/platform-metrics 12 | # plugin.observability.motan.metric.appendType=kafka 13 | -------------------------------------------------------------------------------- /plugins/okhttp/src/main/java/com/megaease/easeagent/plugin/okhttp/ForwardedPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.okhttp; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class ForwardedPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.FORWARDED; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/okhttp/src/main/java/com/megaease/easeagent/plugin/okhttp/OkHttpPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.okhttp; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class OkHttpPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.OK_HTTP; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/okhttp/src/test/java/com/megaease/easeagent/plugin/okhttp/interceptor/TestConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.okhttp.interceptor; 19 | 20 | public class TestConst { 21 | public static final String FORWARDED_NAME = "X-Forwarded-For"; 22 | public static final String FORWARDED_VALUE = "testForwarded"; 23 | public static final String RESPONSE_TAG_NAME = "X-EG-Test"; 24 | public static final String RESPONSE_TAG_VALUE = "X-EG-Test-Value"; 25 | } 26 | -------------------------------------------------------------------------------- /plugins/okhttp/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | easeagent.progress.forwarded.headers=X-Forwarded-For 2 | observability.tracings.tag.response.headers.eg.0=X-EG-Test 3 | -------------------------------------------------------------------------------- /plugins/rabbitmq/src/main/java/com/megaease/easeagent/plugin/rabbitmq/RabbitMqPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.rabbitmq; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class RabbitMqPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.RABBITMQ; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/rabbitmq/src/main/java/com/megaease/easeagent/plugin/rabbitmq/RabbitMqRedirectPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.rabbitmq; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class RabbitMqRedirectPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.RABBITMQ; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/rabbitmq/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | plugin.observability.rabbitmq.metric.interval=200 2 | plugin.observability.rabbitmq.metric.intervalUnit=MILLISECONDS 3 | -------------------------------------------------------------------------------- /plugins/redis/src/main/java/com/megaease/easeagent/plugin/redis/RedisPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.redis; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class RedisPlugin implements AgentPlugin { 24 | 25 | @Override 26 | public String getNamespace() { 27 | return ConfigConst.Namespace.REDIS; 28 | } 29 | 30 | @Override 31 | public String getDomain() { 32 | return ConfigConst.OBSERVABILITY; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/redis/src/main/java/com/megaease/easeagent/plugin/redis/RedisRedirectPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.redis; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class RedisRedirectPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.REDIS; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /plugins/redis/src/main/java/com/megaease/easeagent/plugin/redis/interceptor/initialize/RedisClientInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.redis.interceptor.initialize; 19 | 20 | import com.megaease.easeagent.plugin.annotation.AdviceTo; 21 | import com.megaease.easeagent.plugin.redis.RedisPlugin; 22 | import com.megaease.easeagent.plugin.redis.advice.LettuceRedisClientAdvice; 23 | 24 | @AdviceTo(value = LettuceRedisClientAdvice.class, qualifier = "default", plugin = RedisPlugin.class) 25 | public class RedisClientInterceptor extends CommonRedisClientInterceptor { 26 | } 27 | -------------------------------------------------------------------------------- /plugins/redis/src/test/java/com/megaease/easeagent/plugin/redis/interceptor/TestConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.redis.interceptor; 19 | 20 | public class TestConst { 21 | public static final String REDIRECT_HOST = "192.168.0.12"; 22 | public static final int REDIRECT_PORT = 16379; 23 | public static final String REDIRECT_PASSWORD = "abcdef"; 24 | } 25 | -------------------------------------------------------------------------------- /plugins/redis/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | plugin.observability.redis.metric.interval=200 2 | plugin.observability.redis.metric.intervalUnit=MILLISECONDS 3 | -------------------------------------------------------------------------------- /plugins/servicename/src/test/java/com/megaease/easeagent/plugin/servicename/interceptor/TestConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.servicename.interceptor; 19 | 20 | public class TestConst { 21 | public static final String FORWARDED_NAME = "X-Forwarded-For"; 22 | public static final String FORWARDED_VALUE = "testForwarded"; 23 | } 24 | -------------------------------------------------------------------------------- /plugins/servicename/src/test/java/org/springframework/web/reactive/function/client/MockClientRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package org.springframework.web.reactive.function.client; 19 | 20 | import org.springframework.http.HttpMethod; 21 | 22 | import java.net.URI; 23 | 24 | public class MockClientRequest { 25 | public static ClientRequest build(URI url) { 26 | return new DefaultClientRequestBuilder(HttpMethod.GET, url).build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /plugins/servicename/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | easeagent.progress.forwarded.headers=X-Forwarded-For 2 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/main/java/com/megaease/easeagent/plugin/sofarpc/SofaRpcMetricsTags.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.sofarpc; 2 | 3 | public enum SofaRpcMetricsTags { 4 | 5 | CATEGORY("application"), 6 | TYPE("sofarpc"), 7 | LABEL_NAME("interface"), 8 | ; 9 | 10 | public final String name; 11 | 12 | SofaRpcMetricsTags(String name) { 13 | this.name = name; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/main/java/com/megaease/easeagent/plugin/sofarpc/SofaRpcPlugin.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.sofarpc; 2 | 3 | import com.megaease.easeagent.plugin.AgentPlugin; 4 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 5 | 6 | public class SofaRpcPlugin implements AgentPlugin { 7 | @Override 8 | public String getNamespace() { 9 | return ConfigConst.Namespace.SOFARPC; 10 | } 11 | 12 | @Override 13 | public String getDomain() { 14 | return ConfigConst.OBSERVABILITY; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/main/java/com/megaease/easeagent/plugin/sofarpc/SofaRpcTraceTags.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.sofarpc; 2 | 3 | public enum SofaRpcTraceTags { 4 | SERVICE("sofa.rpc.service"), 5 | METHOD("sofa.rpc.method"), 6 | SERVICE_UNIQUE_ID("sofa.rpc.service.uniqueId"), 7 | SERVER_APPLICATION("sofa.rpc.server.application"), 8 | CLIENT_APPLICATION("sofa.rpc.client.application"), 9 | GROUP("sofa.rpc.group"), 10 | ARGS("sofa.rpc.args"), 11 | RESULT("sofa.rpc.result"), 12 | ; 13 | 14 | public final String name; 15 | 16 | SofaRpcTraceTags(String name) { 17 | this.name = name; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/main/java/com/megaease/easeagent/plugin/sofarpc/interceptor/metrics/callback/SofaRpcResponseCallbackMetricsInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.sofarpc.interceptor.metrics.callback; 2 | 3 | import com.alipay.sofa.rpc.core.invoke.SofaResponseCallback; 4 | import com.megaease.easeagent.plugin.annotation.AdviceTo; 5 | import com.megaease.easeagent.plugin.api.Context; 6 | import com.megaease.easeagent.plugin.interceptor.MethodInfo; 7 | import com.megaease.easeagent.plugin.sofarpc.SofaRpcPlugin; 8 | import com.megaease.easeagent.plugin.sofarpc.adivce.ResponseCallbackAdvice; 9 | import com.megaease.easeagent.plugin.sofarpc.interceptor.metrics.SofaRpcMetricsBaseInterceptor; 10 | 11 | @AdviceTo(value = ResponseCallbackAdvice.class, plugin = SofaRpcPlugin.class) 12 | public class SofaRpcResponseCallbackMetricsInterceptor extends SofaRpcMetricsBaseInterceptor { 13 | 14 | @Override 15 | public void before(MethodInfo methodInfo, Context context) { 16 | SofaResponseCallback sofaResponseCallback = (SofaResponseCallback) methodInfo.getArgs()[2]; 17 | methodInfo.changeArg(2, new SofaRpcResponseCallbackMetrics(sofaResponseCallback, context.exportAsync())); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/test/java/com/megaease/easeagent/plugin/sofarpc/interceptor/MockBoltResponseFuture.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.sofarpc.interceptor; 2 | 3 | import com.megaease.easeagent.plugin.field.DynamicFieldAccessor; 4 | 5 | public class MockBoltResponseFuture implements DynamicFieldAccessor { 6 | private Object data; 7 | 8 | @Override 9 | public void setEaseAgent$$DynamicField$$Data(Object data) { 10 | this.data = data; 11 | } 12 | 13 | @Override 14 | public Object getEaseAgent$$DynamicField$$Data() { 15 | return data; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/test/java/com/megaease/easeagent/plugin/sofarpc/interceptor/metrics/callback/MockSofaResponseCallback.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.sofarpc.interceptor.metrics.callback; 2 | 3 | import com.alipay.sofa.rpc.core.exception.SofaRpcException; 4 | import com.alipay.sofa.rpc.core.invoke.SofaResponseCallback; 5 | import com.alipay.sofa.rpc.core.request.RequestBase; 6 | 7 | public class MockSofaResponseCallback implements SofaResponseCallback { 8 | private Object result; 9 | 10 | public Object getResult() { 11 | return result; 12 | } 13 | 14 | @Override 15 | public void onAppResponse(Object appResponse, String methodName, RequestBase request) { 16 | this.result = appResponse; 17 | } 18 | 19 | @Override 20 | public void onAppException(Throwable throwable, String methodName, RequestBase request) { 21 | this.result = throwable; 22 | } 23 | 24 | @Override 25 | public void onSofaException(SofaRpcException sofaException, String methodName, RequestBase request) { 26 | this.result = sofaException; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/test/java/com/megaease/easeagent/plugin/sofarpc/interceptor/trace/callback/MockSofaResponseCallback.java: -------------------------------------------------------------------------------- 1 | package com.megaease.easeagent.plugin.sofarpc.interceptor.trace.callback; 2 | 3 | import com.alipay.sofa.rpc.core.exception.SofaRpcException; 4 | import com.alipay.sofa.rpc.core.invoke.SofaResponseCallback; 5 | import com.alipay.sofa.rpc.core.request.RequestBase; 6 | 7 | public class MockSofaResponseCallback implements SofaResponseCallback { 8 | private Object result; 9 | 10 | public Object getResult() { 11 | return result; 12 | } 13 | 14 | @Override 15 | public void onAppResponse(Object appResponse, String methodName, RequestBase request) { 16 | this.result = appResponse; 17 | } 18 | 19 | @Override 20 | public void onAppException(Throwable throwable, String methodName, RequestBase request) { 21 | this.result = throwable; 22 | } 23 | 24 | @Override 25 | public void onSofaException(SofaRpcException sofaException, String methodName, RequestBase request) { 26 | this.result = sofaException; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /plugins/sofarpc/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | ## sofarpc arguments collect switch 2 | plugin.observability.sofarpc.tracing.args.collect.enabled=true 3 | plugin.observability.sofarpc.tracing.result.collect.enabled=true 4 | -------------------------------------------------------------------------------- /plugins/spring-gateway/src/main/java/easeagent/plugin/spring/gateway/AccessPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package easeagent.plugin.spring.gateway; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class AccessPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.ACCESS; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/spring-gateway/src/main/java/easeagent/plugin/spring/gateway/ForwardedPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package easeagent.plugin.spring.gateway; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class ForwardedPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.FORWARDED; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/spring-gateway/src/main/java/easeagent/plugin/spring/gateway/interceptor/GatewayCons.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package easeagent.plugin.spring.gateway.interceptor; 19 | 20 | public interface GatewayCons { 21 | String SPAN_KEY = GatewayCons.class.getName() + ".SPAN"; 22 | String CHILD_SPAN_KEY = GatewayCons.class.getName() + ".CHILD_SPAN"; 23 | String CLIENT_RECEIVE_CALLBACK_KEY = GatewayCons.class.getName() + ".CLIENT_RECEIVE_CALLBACK"; 24 | } 25 | -------------------------------------------------------------------------------- /plugins/spring-gateway/src/test/java/easeagent/plugin/spring/gateway/TestConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package easeagent.plugin.spring.gateway; 19 | 20 | public class TestConst { 21 | public static final String FORWARDED_NAME = "X-Forwarded-For"; 22 | public static final String FORWARDED_VALUE = "testForwarded"; 23 | } 24 | -------------------------------------------------------------------------------- /plugins/spring-gateway/src/test/java/easeagent/plugin/spring/gateway/interceptor/metric/MockRouteBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package easeagent.plugin.spring.gateway.interceptor.metric; 19 | 20 | import org.springframework.cloud.gateway.route.Route; 21 | 22 | public class MockRouteBuilder extends Route.Builder { 23 | public MockRouteBuilder() { 24 | predicate = serverWebExchange -> true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /plugins/spring-gateway/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | name=test-gateway-service 2 | system=test-gateway-system 3 | plugin.observability.springGateway.metric.interval=200 4 | plugin.observability.springGateway.metric.intervalUnit=MILLISECONDS 5 | easeagent.progress.forwarded.headers=X-Forwarded-For 6 | -------------------------------------------------------------------------------- /plugins/springweb/src/main/java/com/megaease/easeagent/plugin/springweb/ForwardedPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.springweb; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class ForwardedPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.FORWARDED; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.INTEGRABILITY; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugins/springweb/src/main/java/com/megaease/easeagent/plugin/springweb/SpringWebPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.springweb; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class SpringWebPlugin implements AgentPlugin { 24 | 25 | @Override 26 | public String getNamespace() { 27 | return "springweb"; 28 | } 29 | 30 | @Override 31 | public String getDomain() { 32 | return ConfigConst.OBSERVABILITY; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/springweb/src/main/java/com/megaease/easeagent/plugin/springweb/WebClientPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.springweb; 19 | 20 | import com.megaease.easeagent.plugin.AgentPlugin; 21 | import com.megaease.easeagent.plugin.api.config.ConfigConst; 22 | 23 | public class WebClientPlugin implements AgentPlugin { 24 | @Override 25 | public String getNamespace() { 26 | return ConfigConst.Namespace.WEB_CLIENT; 27 | } 28 | 29 | @Override 30 | public String getDomain() { 31 | return ConfigConst.OBSERVABILITY; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /plugins/springweb/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | feign: 2 | client: 3 | config: 4 | default: 5 | connectTimeout: 5000 6 | readTimeout: 5000 7 | loggerLevel: basic 8 | -------------------------------------------------------------------------------- /plugins/springweb/src/test/java/com/megaease/easeagent/plugin/springweb/interceptor/TestConst.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.springweb.interceptor; 19 | 20 | public class TestConst { 21 | public static final String FORWARDED_NAME = "X-Forwarded-For"; 22 | public static final String FORWARDED_VALUE = "testForwarded"; 23 | public static final String RESPONSE_TAG_NAME = "X-EG-Test"; 24 | public static final String RESPONSE_TAG_VALUE = "X-EG-Test-Value"; 25 | } 26 | -------------------------------------------------------------------------------- /plugins/springweb/src/test/java/com/megaease/easeagent/plugin/springweb/reactor/MockMono.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.plugin.springweb.reactor; 19 | 20 | import org.springframework.web.reactive.function.client.ClientResponse; 21 | import reactor.core.CoreSubscriber; 22 | import reactor.core.publisher.Mono; 23 | 24 | public class MockMono extends Mono { 25 | @Override 26 | public void subscribe(CoreSubscriber coreSubscriber) { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugins/springweb/src/test/java/org/springframework/web/reactive/function/client/MockClientRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package org.springframework.web.reactive.function.client; 19 | 20 | import org.springframework.http.HttpMethod; 21 | 22 | import java.net.URI; 23 | 24 | public class MockClientRequest { 25 | public static ClientRequest build(URI url) { 26 | return new DefaultClientRequestBuilder(HttpMethod.GET, url).build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /plugins/springweb/src/test/resources/mock_agent.properties: -------------------------------------------------------------------------------- 1 | plugin.integrability.global.forwarded.enabled=true 2 | easeagent.progress.forwarded.headers=X-Forwarded-For 3 | observability.tracings.tag.response.headers.eg.0=X-EG-Test 4 | -------------------------------------------------------------------------------- /release: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # After `mvn clean package -am -pl build`, this script can help you to release `easeagent-dep.jar` to github. 3 | 4 | RELEASE_ID=41698268 5 | LIST_RELEASE_URL="https://api.github.com/repos/megaease/easeagent/releases" 6 | RELEASE_URL="https://api.github.com/repos/megaease/easeagent/releases/${RELEASE_ID}" 7 | UPLOAD_URL="https://uploads.github.com/repos/megaease/easeagent/releases/${RELEASE_ID}/assets?name=easeagent.jar" 8 | TOKEN="" 9 | AUTH_HEAD="Authorization: token $TOKEN" 10 | LIB_PATH="build/target/easeagent-dep.jar" 11 | ASSET_URL=`curl -X GET -H "$AUTH_HEAD" "$RELEASE_URL" | jq --raw-output '.assets[0].url'` 12 | 13 | echo "Delete last asset is $ASSET_URL" 14 | 15 | curl -X DELETE -H "$AUTH_HEAD" "$ASSET_URL" 16 | 17 | MD5=`md5 -q $LIB_PATH` 18 | 19 | echo "Update easeagent hash: $MD5" 20 | 21 | curl -X PATCH -H "$AUTH_HEAD" -H "Content-Type: application/json" -d "{\"body\":\"MD5(easeagent.jar) = \`$MD5\`\"}" "$RELEASE_URL" > /dev/null 22 | 23 | echo "Upload easeagent.jar" 24 | 25 | curl -X POST -H "$AUTH_HEAD" -H "Content-Type: application/java-archive" --progress-bar --data-binary @$LIB_PATH "$UPLOAD_URL" -------------------------------------------------------------------------------- /report/src/main/java/com/megaease/easeagent/report/AgentReportAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.report; 19 | 20 | import com.megaease.easeagent.plugin.report.AgentReport; 21 | 22 | public interface AgentReportAware { 23 | void setAgentReport(AgentReport report); 24 | } 25 | -------------------------------------------------------------------------------- /report/src/main/java/com/megaease/easeagent/report/ReportConfigChange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.report; 19 | 20 | import java.util.Map; 21 | 22 | public interface ReportConfigChange { 23 | void updateConfigs(Map outputProperties); 24 | } 25 | -------------------------------------------------------------------------------- /report/src/main/java/com/megaease/easeagent/report/async/zipkin/WithSizeConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.report.async.zipkin; 19 | 20 | public interface WithSizeConsumer { 21 | /** Returns true if the element could be added or false if it could not due to its size. */ 22 | boolean offer(S next, int nextSizeInBytes); 23 | } 24 | -------------------------------------------------------------------------------- /report/src/main/java/com/megaease/easeagent/report/encoder/span/GlobalExtrasSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.report.encoder.span; 19 | 20 | public interface GlobalExtrasSupplier { 21 | String service(); 22 | 23 | String system(); 24 | } 25 | -------------------------------------------------------------------------------- /report/src/main/java/com/megaease/easeagent/report/metric/MetricItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.report.metric; 19 | 20 | public class MetricItem { 21 | private final String key; 22 | private final String content; 23 | 24 | public MetricItem(String key, String content) { 25 | this.key = key; 26 | this.content = content; 27 | } 28 | 29 | public String getKey() { 30 | return key; 31 | } 32 | 33 | public String getContent() { 34 | return content; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /report/src/main/java/com/megaease/easeagent/report/sender/metric/log4j/LoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.report.sender.metric.log4j; 19 | 20 | import org.apache.logging.log4j.core.LoggerContext; 21 | 22 | public class LoggerFactory { 23 | private LoggerFactory() {} 24 | 25 | // Independent logger context as an anchor for loggers in the metrics 26 | private static final LoggerContext loggerContext = new LoggerContext("ROOT"); 27 | 28 | public static LoggerContext getLoggerContext() { 29 | return loggerContext; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /report/src/main/java/com/megaease/easeagent/report/util/TextUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package com.megaease.easeagent.report.util; 19 | 20 | public class TextUtils { 21 | private TextUtils() {} 22 | 23 | public static boolean hasText(String content) { 24 | return content != null && content.trim().length() > 0; 25 | } 26 | 27 | public static boolean isEmpty(String value) { 28 | return !hasText(value); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /report/src/main/java/zipkin2/reporter/TracerConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package zipkin2.reporter; 19 | 20 | import java.util.List; 21 | 22 | public interface TracerConverter { 23 | 24 | List converter(List nextMessage); 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /report/src/main/java/zipkin2/reporter/kafka11/SDKSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package zipkin2.reporter.kafka11; 19 | 20 | public interface SDKSender { 21 | 22 | boolean isClose(); 23 | } 24 | -------------------------------------------------------------------------------- /resources/rootfs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM megaease/easeimg-javabuild:latest AS builder 2 | 3 | ARG REPOSITORY1 4 | ARG REPOSITORY2 5 | ARG REPOSITORY3 6 | ARG MIRROR1 7 | ARG MIRROR2 8 | ARG MIRROR3 9 | ARG SERVER1 10 | ARG SERVER2 11 | ARG SERVER3 12 | 13 | COPY ./ /easeagent/ 14 | WORKDIR /easeagent 15 | 16 | RUN /bin/rewrite-settings.sh && cd /easeagent/ && mvn clean package && cd build/target/ && jar xf easeagent.jar easeagent-log4j2.xml 17 | 18 | FROM alpine:latest 19 | RUN apk --no-cache add curl wget 20 | 21 | 22 | COPY --from=builder /easeagent/build/target/easeagent-dep.jar /easeagent-volume/easeagent.jar 23 | COPY --from=builder /easeagent/build/target/easeagent-log4j2.xml /easeagent-volume/easeagent-log4j2.xml 24 | -------------------------------------------------------------------------------- /resources/scripts/Jenkinsfile: -------------------------------------------------------------------------------- 1 | package resources.scripts 2 | 3 | @Library(value='JenkinsHelper', changelog=false) _ 4 | 5 | updateJavaBuild() -------------------------------------------------------------------------------- /zipkin/src/main/resources/META-INF/services/com.megaease.easeagent.plugin.bean.BeanProvider: -------------------------------------------------------------------------------- 1 | com.megaease.easeagent.zipkin.TracingProviderImpl 2 | -------------------------------------------------------------------------------- /zipkin/src/test/java/brave/TracerTestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package brave; 19 | 20 | import brave.internal.collect.WeakConcurrentMapTestUtils; 21 | import brave.internal.recorder.PendingSpans; 22 | 23 | public class TracerTestUtils { 24 | public static void clean(Tracer tracer) { 25 | PendingSpans pendingSpans = tracer.pendingSpans; 26 | WeakConcurrentMapTestUtils.runExpungeStaleEntries(pendingSpans); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /zipkin/src/test/java/brave/internal/collect/WeakConcurrentMapTestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, MegaEase 3 | * All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | package brave.internal.collect; 19 | 20 | public class WeakConcurrentMapTestUtils { 21 | public static void runExpungeStaleEntries(WeakConcurrentMap weakConcurrentMap) { 22 | weakConcurrentMap.expungeStaleEntries(); 23 | } 24 | } 25 | --------------------------------------------------------------------------------