SkyWalking has already provided several storage solutions. In this document, you could learn how to implement a new storage easily.
- Define a class extends
org.apache.skywalking.oap.server.library.module.ModuleProvider
. - Set this provider targeting to Storage module.
@Override
public Class<? extends ModuleDefine> module() {
return StorageModule.class;
}
Here is the list of all DAO interfaces in storage
- IServiceInventoryCacheDAO
- IServiceInstanceInventoryCacheDAO
- IEndpointInventoryCacheDAO
- INetworkAddressInventoryCacheDAO
- IBatchDAO
- StorageDAO
- IRegisterLockDAO
- ITopologyQueryDAO
- IMetricsQueryDAO
- ITraceQueryDAO
- IMetadataQueryDAO
- IAggregationQueryDAO
- IAlarmQueryDAO
- IHistoryDeleteDAO
- IMetricsDAO
- IRecordDAO
- IRegisterDAO
- ILogQueryDAO
- ITopNRecordsQueryDAO
- IBrowserLogQueryDAO
In public void prepare()
, use this#registerServiceImplementation
method to do register binding your implementation with the above interfaces.
Take org.apache.skywalking.oap.server.storage.plugin.elasticsearch.StorageModuleElasticsearchProvider
or org.apache.skywalking.oap.server.storage.plugin.jdbc.mysql.MySQLStorageProvider
as a good example.
You don't have to clone the main repo just for implementing the storage. You could just easy depend our Apache releases. Take a look at SkyAPM/SkyWalking-With-Es5x-Storage repo, SkyWalking v6 redistribution with ElasticSearch 5 TCP connection storage implementation.