tencent cloud

Configure Function Plug-Ins
Last updated: 2025-06-17 16:31:12
Configure Function Plug-Ins
Last updated: 2025-06-17 16:31:12

Feature Overview

The function platform now supports the "plug-in" feature, allowing users to upload auxiliary services such as log collection and metric reporting as plug-ins and bind them in the function. Complete the feature implementation similar to the Sidecar in the container ecosystem in this mode, decoupling the business function from the auxiliary services. At the same time, manage the lifecycle of the plug-in in combination with that of the function instance. Users can separately declare the running time of the plug-in after the main function returns the result to ensure the real-time data and integrity of the auxiliary services.

Working Mode

Create and Bind

The mirror file of a plug-in will be stored based on the name and version of the plug-in. When binding a plug-in to a function, it will be bound based on the specific plug-in version and function version. Currently, a maximum of 5 plug-in versions can be bound to one function version, and they must be unique.

Recommended Usage Method

We recommend that users focus on compiling the core business logic in the main function and decouple the core business logic from auxiliary components. These auxiliary components can collaborate with the main function by functioning in the form of function plugins. Common plugin usage scenarios include:
Log gathering: Collection, formatting, and submission of logs.
Metric reporting: Collect service performance metrics and send them to the monitoring system. Centralize monitoring logic management and reduce the burden on the main service.
APM tool: Real-time monitor and analyze application performance metrics, promptly discover and resolve potential performance bottlenecks and failures, and underwrite the stable operation of applications.
Tencent Cloud Mesh (TCM): Service communication, traffic management.
Configuration management: Dynamically manage service configurations, support hot updates, and avoid frequent service restarts to apply new configurations.
Probe health: Check whether specific components are working properly.
Other system integrations.

Loading and Accessing at Runtime

In Serverless Cloud Function (SCF), the plug-in feature is implemented through a dynamic loading mechanism, achieving capabilities similar to the Kubernetes Sidecar mode. When a function instance starts up, all plug-ins are started asynchronously, and the plug-in startup phase does not block the invocation of the main function. Plug-ins support running independent processes (such as log agents, monitoring services) and interact with the main function via the local network (127.0.0.1:port) or a shared file directory (/tmp). Unlike static dependencies in "layers", plug-ins emphasize dynamic service capabilities (such as traffic proxy, real-time security verification), allowing backend logic to run continuously within the function lifecycle, unifying feature expansion and resource isolation.

Related Documentation

You can create a plugin through the Serverless Console Create Plugin.
When creating or updating a function, bind a plugin.

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback