Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/collection_pipeline/plugin/PluginRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
#ifdef __ENTERPRISE__
#include "plugin/flusher/sls/EnterpriseFlusherSLSMonitor.h"
#endif
#include "provider/Provider.h"

DEFINE_FLAG_BOOL(enable_processor_spl, "", true);
DEFINE_FLAG_BOOL(enable_ebpf_network_observer, "", false);
Expand All @@ -83,6 +84,7 @@ void PluginRegistry::LoadPlugins() {
LoadStaticPlugins();
auto& plugins = AppConfig::GetInstance()->GetDynamicPlugins();
LoadDynamicPlugins(plugins);
RegisterExternalPlugins(); // external plugin registration
}

void PluginRegistry::UnloadPlugins() {
Expand Down
7 changes: 4 additions & 3 deletions core/collection_pipeline/plugin/PluginRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class PluginRegistry {
bool IsValidNativeFlusherPlugin(const std::string& name) const;
bool IsGlobalSingletonInputPlugin(const std::string& name) const;

void RegisterInputCreator(PluginCreator* creator, bool isSingleton = false);
void RegisterProcessorCreator(PluginCreator* creator);
void RegisterFlusherCreator(PluginCreator* creator, bool isSingleton = false);

private:
enum PluginCat { INPUT_PLUGIN, PROCESSOR_PLUGIN, FLUSHER_PLUGIN };

Expand All @@ -79,9 +83,6 @@ class PluginRegistry {

void LoadStaticPlugins();
void LoadDynamicPlugins(const std::set<std::string>& plugins);
void RegisterInputCreator(PluginCreator* creator, bool isSingleton = false);
void RegisterProcessorCreator(PluginCreator* creator);
void RegisterFlusherCreator(PluginCreator* creator, bool isSingleton = false);
PluginCreator* LoadProcessorPlugin(DynamicLibLoader& loader, const std::string pluginType);
void RegisterCreator(PluginCat cat, PluginCreator* creator, bool isSingleton);
std::unique_ptr<PluginInstance>
Expand Down
4 changes: 4 additions & 0 deletions core/provider/Provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ ProfileSender* GetProfileSender() {
return ProfileSender::GetInstance();
}


void RegisterExternalPlugins() {
}

} // namespace logtail
6 changes: 6 additions & 0 deletions core/provider/Provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@ std::vector<ConfigProvider*> GetRemoteConfigProviders();
void InitRemoteConfigProviders();

// GetProfileSender returns the ProfileSender instance.
// Self-monitor metrics are not sent via ProfileSender anymore.
ProfileSender* GetProfileSender();

// RegisterExternalPlugins registers the external cpp plugins.
// For example:
// PluginRegistry::GetInstance()->RegisterFlusherCreator(new StaticFlusherCreator<FlusherExternal>());
void RegisterExternalPlugins();
} // namespace logtail
Loading