* add null conditional operators on these 3 files . To aviod some agent exception of Oracle jdbc.
* Add a line in Java Agent section of CHANGES.md file
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
* Avoided to interrupt the process of the application in the `SWExecutionHookWrapper` wrapper class.
* Polishing.
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
* Fix issue #5795
Fix the issue: nutz plugin throw NPE at afterMethod, cause traceid keep unchange for the thread
* fix the style and modify the CHANGES.md
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Co-authored-by: simonlei <simonlei@tencent.com>
Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
* Fix application start duration log "Failed to load class "org.slf4j.impl.StaticLoggerBinder"." when use kafka reporter. because kafka reporter use slf4j-api, but no implementor for slf4j.
* Polishing.
* Adapter slf4j Logger of agent used to skywalking agent Logger.
* Make the comments more accurate.
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations.
Co-authored-by: zhang-wei <pknfe@outlook.com>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
* modify witness class
* modify witness class & add test case
* replace DB_STATEMENT to DB_BIND_VARIABLES & remove executeMethod prefix
* fix ci
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
use the method httpMethod.setRequestHeader to set the new skywalking headers,so that it can override the exits headers if there is any
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Another thread could get the list which is still in the initialization stage, due to first element added. So we need a local variable to avoid this. Also, notice this happens only in concurrency class loader env.
* Add Mariadb JDBC plugin and provide tests
* Refactor component name
* Reformat plugin description and remove healthcheck span from the test
Co-authored-by: Efe Kaptan <Efe.Kaptan@webtrekk.com>
Co-authored-by: zhang-wei <pknfe@outlook.com>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
* fix to get 'peer' in SingleServerConfig, this method to throw exception in 'org.apache.skywalking.apm.agent.core.context.TracingContext#createExitSpan' because 'peer' is null. in sw 6 version, this also one of problem to throw 'NoSuchElementException' in 'org.apache.skywalking.apm.agent.core.context.ContextManager#capture'
* Polishing
Co-authored-by: gui.cao <gui.cao@zhangmen.com>
Co-authored-by: hanfei <zifeihan@foxmail.com>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
* vertx web plugin re-impl attempt
* added license
* update test for new plugin structure
* got rid of registryItems
* remove unnecessary dependencies
* re-impl eventbus scenario
* more precise naming
* fix expected data
* removed unsupported versions and removed vertx caching (avoids permission error)
* rewrote to remove copied code
* Update plugins-test.3.yaml
* fixes issue of .vertx files remaining on v3.0.0
* only present in v3.0.0
* consistency
* add more supported versions
* track status code
* spelling fix
* track status code
* more correct naming
* reverts 213f5a69 (status code isn't sent at this point)
* made HttpServerResponseImplEndInstrumentation more strict based on version
added status code tracking
fixes issue not finishing async spans
* works 3.0.0,3.7.0
* increase compatibility
* 3.9.0 default
* versioned witness classes (advice from wu-sheng)
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Co-authored-by: zhang-wei <pknfe@outlook.com>
Here are the list of changes we made in this pull request. Top 3 are the principle changes, others are following these principles.
1. New agent and mesh report protocol.
2. New agent header protocol.
3. Service register, instance register and network address register have been removed permanently.
4. Service traffic, instance traffic and network alias metrics are added to replace the service, instance and network address inventory.
5. Register process has been removed.
6. Metrics stream process supports insert only mode, especially for traffic entities.
7. Metrics stream process supports no-downsampling mode for traffic entities and network alias.
8. Remove all register mechanism and cache in the java agent.
9. Remove MONTH step in GraphQL query.
10. Update UI to remove MONTH step query, the max query range is 60 days now.
11. Simplify the TTL to metrics and record. And the unit has been formatted in Day unit. No specific TTL for ElasticSearch storage.
12. Buffer mechanism of trace receiver and mesh receiver has been removed due to no register.
13. New service id, instance id and endpoint id rules, including service relation, instance relation and endpoint relation id rules.
14. Java agent support `keep tracing` mode, meaning, agent generating tracing context even the backend is unconnected/unavailable.
15. Plugin test tool up to date, in order to support new protocol.
16. Plugin tests expected data files updated.
17. E2E tests updated.
18. Telemetry of Grafana config has been merged into one.
19. Documentation updates.
20. [TBD] InfluxDB storage implementation is not available, need @dmsolr to fix later, in order to reduce the master change block by this PR.
* Set the endpoint name length to 150, to keep safe and avoid over-length.
* Set endpointNameMaxLength in the application.yml
* Fix a mischange.
* Correct the endpoint name length control logic
Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
* Finish step one, source and entity changed.
* Step 2, finish the basic and core DAO changes.
* Step 3. Change all source codes of backend, and make project compiling successfully.
* Make startup successful and persistence works.
* Fix dead codes in the MySQLTableInstaller.
* Fix mischange.
* Fix MySQL storage bootstrap error.
* Rollback dependency change.
* Simply enable tailing logs from container no mater it's in CI or not
* Fix segment table issue.
* Fix MySQL Instanller.
* Support Influxdb implementation of new endpoint traffic.
* Set and modify timeout to 90mins
* Remove unnecessary entity in the EndpointTraffic.
* Fix wrong entity builder and make name more clear.
* Fix 2 equal methods bug.
* Fix InfluxDB identifier(name) conflict issue.
* Fix endpoint topology query, endpoint id should be changed as a string.
* Fix a missing change.
* Fix a wrong commit.
* Column name can't be changed, due to it affect the hybrid metadb(h2/mysql) query, change it explicitly with double quotation marks.
* Fix formats.
* Remove endpoint/operation register from the agent. and change the plugin tests(without local tests). operationId relation codes have been removed from agent too.
* Try to fix the hytrix case.
* Fix 3 cases.
* Try to fix cases.
* Fix 2.
* Fix one.
* Fix the serviceId type mis-change.
* Fix int query
* Fix hystrix case.
* Fix a case.
* Fix EndpointCallRelationDispatcher set the source/dest endpoint without id encoding.
* Update documentation and add 2 test cases.
Co-authored-by: kezhenxu94 <kezhenxu94@163.com>
* up ui
* up ui
* fix elasticsearch-5.x-plugin on es6.x TransportClient error, Found class org.elasticsearch.common.transport.TransportAddress, but interface was expected
up elasticsearch-6.x-plugin support TransportClient
* fix elasticsearch-5.x-plugin on es6.x TransportClient error, Found class org.elasticsearch.common.transport.TransportAddress, but interface was expected
up elasticsearch-6.x-plugin support TransportClient
* fix elasticsearch-5.x-plugin on es6.x TransportClient error, Found class org.elasticsearch.common.transport.TransportAddress, but interface was expected
up elasticsearch-6.x-plugin support TransportClient
* const string witnesses
add some unit test
recommended to change ; to ,
* const string witnesses
add some unit test
recommended to change ; to ,
* up ES6.X test-plugin
* up es6.x test-plugin
* up es6.x test-plugin
* up es6.x test-plugin
* add DeleteIndexRequest
* up es6.x test-plugin
* remove TransportCaseController.java
* fix TransportActionNodeProxyExecuteMethodsInterceptorTest
Co-authored-by: yi.liang <yi.liang@zhangmen.cn>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Co-authored-by: 梁懿 <liangyi@xforceplus.com>
Co-authored-by: aderm <394102339@qq.com>
* Provide active HTTP parameter collection automatically in the profiling context
* Fix style check
* fix style error
* Add profile status, storage it into TracingContext. simplify to get profiling method
* Change the profile status field name in TracingContext
* Replace gone images
* resolve issues
* resole description issues
Co-authored-by: Mrproliu <mrproliu@lagou.com>
Co-authored-by: kezhenxu94 <kezhenxu94@163.com>
Motivation:
According the feedback from the community, the e2e tests are hard for
them to understand and get them started, so this pull request aims to
rewrite the e2e tests with some improvements:
- debuggable locally, now you can run every individual case directly
inside the IDE, just like running a plain unit test.
- same functionalities of multiple counterparts share the same codes,
cases like different storages and cluster coordinators share the same
codes, easy to add more similar cases.
- the "end" now extends to the Doccker images, meaning that some bugs
like #4483 and #4471 can be more easily and early to be discovered.
- codes style and license headers are checked
Modifications:
- adopt jupeter (a.k.a junit 5), testcontainers as the new test
framework, all containers are orchestrated by docker-compose.yml,
well-known technology that developers should be familiar with.
- rewrite all test cases and verify them.
- reorganize the workflows in GitHub Actions.
Result:
- new e2e test should be easy to add.
- closes https://github.com/apache/skywalking/issues/4472
* Support lazy ContextCarrier injection and lazy peer id setting for exit span
* Close the set component id for exit and local spans
* Follow the review.
* Remove `void inject(AbstractSpan exitSpan, ContextCarrier carrier)` from AbstractTracerContext
Motivation:
Support Armeria 0.98.0 in its plugin.
Modifications:
Add an intercept point that is refactored in Armeria 0.98.
Result:
Now Armeria plugin supports 0.98.0, and 0.98.1
* extract duplicated method
* change while loop to if since once rs.next() return false, it will never return true for the following calls
* simplify if() return true; return false pattern
* fix compilation
Signed-off-by: liqiang.clq <liqiang.clq@alibaba-inc.com>
Motivation:
Review code styles with some bots automatically.
Modifications:
Set up ReviewDog in GitHub Action to review code style.
Add more check rules to checkstyle plugin.
Result:
Obvious code styles can be reviewed and commented automatically.
### Motivation:
Reduce footprint when tagging spans with the deprecated API: `AbstractSpan#tag(String, String)`.
### Modifications:
- Adopt [prototype pattern](https://en.wikipedia.org/wiki/Prototype_pattern) to create `Tag`, prevent from creating too many `StringTag` instances and `GC`ed.
- Replace `AbstractSpan#tag(String, String)` with `AbstractSpan#tag(AbstractTag, String)`.
### Result:
- Footprint is reduced.
### Motivation:
Codes clean up
### Modifications:
- Remove v1 header, follow up #4244
- Use built-in Base64 class (since JDK8)
### Result:
- No more legacy v1 headers
- No unnecessary codes concerns by using built-in ability
Motivation:
Reduce unnecessary memory allocation in frequently used class.
Modifications:
Replace the `AtomicInteger` with `AtomicIntegerFieldUpdater`
Result:
We can save 4 bytes (for the reference to `AtomicInteger` itself) for each `TracingContext`, which saves credible memory in a high-concurrent agent service.
* sniffer processing profile task and report status and snapshot
* resolve testServiceDependencies test case error, use same register with `TraceSegmentServiceClient`
* resolve names
* change profile to single one thread run.
* 1. change to the ArrayList, because known the max size
2. rename issue resolved
* add profiling status enum
* change sniffer use full name issue
* 1. remove `prepareProfiling` method, build profiling status when construct `TracingContext`
2. add `TracingThreadListenerManager`, notify when tracing main thread finish
3. change ProfileThread start when process new profile task
* remove unnecessary getter
* add test assert error message
* adding `AgentServiceRule`
* revert original assert
* remove unnecessary getter
* resolve issues
* reduce findService invoke
* resolve style error
* recheck profiling when change first span operatin name
* resolve issues
1. remove `ContextManager#profilingRecheck`, only check on `TracingContext`
2. rename comments
3. resolve volatile array setting
* remove article link
* add `ProfileTask#maxSamplingCount` check
* resolve conflict (Downstream -> Commands)
* 1. change profilingSegmentSlots init on construct
2. if is profiling, recheck dont need to stop
3. total profiling count increment on first dump
* remove unused return val
* remove some `@param` and `@return`
* add profile task check result data bean
* change profiler slot to `AtomicReferenceArray`
* resolved java doc error
* fix doc error, remove meaningless descriptions
* resolve missed profile receiver on oap starter
* resolve method invoke error
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Co-authored-by: kezhenxu94 <kezhenxu94@163.com>
* Provide profile task downstream to sniffer
* fix agent unit testcase issue
* add profile switch config on sniffer
* fix es error
* 1. add @DefaultImplementor on the sniffer profile task service
2. change ProfileTaskExecutionService#PROFILE_TASK_READY_SCHEDULE to final and remove volatile
2. fix style error
* change timeFromStartMills use `<` to compare
* 1. add `maxSamplingCount` to profile task
2. make profile task limit to the common package
* 1. change `agent.active_profile` to `profile.active` and make true on default
2. add `maxSamplingCount` in profile task
3. use `createTime` to check has new command list
4. add task re-check before process profile task
* 1. add `profile-receiver` document
2. change `ProfileTaskExecutionService` use single schedule thread pool
3. cache dont need fetch data when no data, use auto-fresh mechanism only
* remove navigate time judge, fix comment wrong meaning
* Add service type from register and support browser as service type
* Add service type at agent side.
* Fix format.
* Fix a test.
* Fix formats.
Co-authored-by: kezhenxu94 <kezhenxu94@163.com>
* [Feature] Add tag annotation to allow tagging span with annotation
* Use repeatable annotation syntax and add docs and example codes
* Fix failed unit test
* Add play-scenario
* Set play plugin as default
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Co-authored-by: Weiyi Liu <liuweiyi@cmss.chinamobile.com>
* Update JDK compiling level to 8, and remove zip dist.
* Exclude annotation and shade API.
* Fix more exclusion.
* 1. Update grava and gson 2. Fix compile issue. 3. Keep protoc and maven plugin in old version. Some incompatible of 3rd party grpc proto.
* Fix dependency conflicts, license and notice issue, and dependency check script issue
Co-authored-by: kezhenxu94 <kezhenxu94@163.com>
* Remove the local span and exit span register mechanism in Java agent scenario.
* Fix config, plugin, and document, as exit span is not required register anymore.
* Try to fix the test case expected data due to no register for exit span.
* Fix toolkit case.
* Remove exit span from plugin test framework document.
* Update protocol, FAQ, and CHANGELOG documents to highlight this change.
* Fix NPE when no entry span in the whole segment. Set endpoint to null in segment entity.
* Fix the snapshot and add inexistence operation name id.
* Fix several async cases.
* Fix undertow test case.
* Fix wrong error log name.
* Keep name consistent with 6.x concepts.
* Try to fix 3 async scenarios.
* Fix okhttp case.
* Fix Spring Async case.
* Fix another NPE
* Fix NPE when first span has no endpoint id when it is local or exit span.
* Still fill first operation name when no endpoint id.
* Intercept feign RequestTemplate resolve args method ,get the url without parameters
* fix ci warnings
* optimize import
* fix: miss path in feign target url like "http://localhost:8080/feign-scenario"
fix feign-scenario test use pathVariable
* Add testcase to DefaultHttpClientInterceptorTest
* Clean ThreadLocal
* User one ThreadLocal replace two. User try/final remove ThreadLocal .
* Code Optimize
When using kryo, Byte-buddy occurs exception when match type.
> java.lang.IllegalStateException: Cannot resolve type description for com.esotericsoftware.reflectasm.PublicConstructorAccess