Manage projects

更新时间:
复制 MD 格式

A project in Simple Log Service (SLS) is the basic unit for resource management, providing resource isolation, access control, and an entry point to SLS resources.

What is a project?

A project provides resource isolation and access control in SLS.

A project contains Logstores, MetricStores, machine groups, and other resources. Use separate projects to manage data from different applications, products, or environments:

  • Organize and manage different Logstores or MetricStores: Separate logs by application, product, or environment into different projects for easier consumption, export, and analysis.

  • Isolate access control: Grant RAM users permissions on specific projects.

  • Provide an entry point to SLS resources: Each project has a dedicated endpoint for writing, reading, and managing logs over the network. Service endpoints.

Permissions (expandable)

  • An Alibaba Cloud account has full permissions on all projects by default.

  • RAM users can request the following SLS system policies from the account owner:

    • AliyunLogFullAccess: Grants full permission to manage SLS.

    • AliyunLogReadOnlyAccess: Grants read-only permission for SLS.

    If the system policies do not meet your requirements, Create a custom policy for fine-grained permission management.

    Operation

    Required permissions

    Create a project

    • log:ListProject

    • log:CreateProject

    Delete a project

    • log:ListProject

    • log:GetProject

    • log:DeleteProject

    Perform operations on a project in the recycle bin

    • log:ListProjectsInRecycleBin

    • log:CreateProject

    • log:DeleteProject

    • log:UpdateProject

    View a specific project

    • log:ListProject

    • log:GetProject

    • log:ListLogStores

    • log:ListSavedSearch

    • log:ListDashboard

    • log:ListDomains

    • log:GetSqlInstance

    • log:ListTagResources

    Manage resource quotas

    You can view the specified project.

    Configure transfer acceleration

    • log:ListProject

    • log:GetProject

    • log:ListLogStores

    • log:ListSavedSearch

    • log:ListDashboard

    • log:ListDomains

    • log:GetSqlInstance

    • log:ListTagResources

    • log:PutProjectTransferAcceleration

    Configure a resource group

    • log:ListProject

    • log:GetProject

    • log:ListLogStores

    • log:ListSavedSearch

    • log:ListDashboard

    • log:ListDomains

    • log:GetSqlInstance

    • log:ListTagResources

    • log:ChangeResourceGroup

    Configure tags

    • log:ListProject

    • log:GetProject

    • log:ListLogStores

    • log:ListSavedSearch

    • log:ListDashboard

    • log:ListDomains

    • log:GetSqlInstance

    • log:ListTagResources

    • log:TagResources

    • log:UntagResources

    Configure a custom domain name

    • log:ListProject

    • log:GetProject

    • log:ListLogStores

    • log:ListSavedSearch

    • log:ListDashboard

    • log:ListDomains

    • log:GetSqlInstance

    • log:ListTagResources

    • log:CreateDomain

    Monitor project resources

    • log:ListProject

    • log:GetProject

    • log:ListLogStores

    • log:ListSavedSearch

    • log:ListDashboard

    • log:ListDomains

    • log:GetSqlInstance

    • log:ListTagResources

    • log:GetLogging

    • log:CreateLogStore

    • log:CreateIndex

    • log:UpdateIndex

    • log:CreateDashboard

    • log:UpdateDashboard

    • log:GetLogStore

    • log:UpdateLogStore

    • log:UpdateLogging

    • log:GetLogStoreLogs

All project parameters (expandable)

Parameter

Description

Region

Select a region based on your log source location. The region cannot be changed after creation, and cross-region migration is not supported. To collect ECS logs over the internal network, select the same region as the ECS instances.

Project name

Must be globally unique within a region. Cannot be changed after creation.

Project recycle bin

Enable the recycle bin to prevent accidental deletion of important projects. Deleted projects move to the recycle bin, where they are inactive with no read or write access. You can restore a recycled project if needed. Only data storage fees apply to recycled projects.

Project comment

A comment for the project. The comment can contain up to 64 characters. It cannot contain angle brackets (<>), apostrophes ('), backslashes (\), double quotation marks ("), or two consecutive backslashes (\\).

Resource group

  • A resource group is a container that lets you manage a group of related resources under a single Alibaba Cloud account.

  • A resource can belong to only one resource group.

  • Map resource groups to concepts such as projects, applications, or organizations as needed.

Enable service logs

Enabling service logs creates a Logstore and dashboard in the selected storage location. The operation log Logstore is billed as a standard Logstore. Other log Logstores are free of charge.

  • Detailed logs: Complete operation logs, billed on a pay-as-you-go basis.

  • Important logs: Metering logs, consumer group latency logs, and Logtail heartbeat logs. Free of charge.

  • Task execution logs: Execution logs of data import, scheduled SQL, and data shipping jobs. Free of charge.

Log storage location

A project named log-service-{user-ID}-{region} is automatically created. Save all logs from the same region to this project.

Create a project

Create a project to manage logs and log sources for an application.

Console

  1. Log on to the Simple Log Service console. In the Projects section, click Create Project.

  2. Configure the project:

    1. Region: Select a region based on your log source location. The region cannot be changed after creation. To collect ECS logs over the internal network, select the same region as the ECS instances.

    2. Project name: Must be globally unique within Alibaba Cloud. Cannot be changed after creation.

    3. Leave the other parameters at their default values.

API

CreateProject.

Identify the project source

SLS may automatically create projects when associated with other Alibaba Cloud services. Trace a project's source to identify its origin, stored data, and costs.

  1. Log on to the Simple Log Service console. In the Projects section, find the target project.

  2. Check for an icon next to the project name or review the Description column to identify the project's source:

    • If an icon appears before the project name, hover over the icon. The name of the associated cloud service is displayed.

    • The Description column specifies the source of the project.

    • If neither of these conditions is met, the project was created manually.

  3. After identifying the associated cloud service, check Collection of Alibaba Cloud service logs for details on stored data.

    If the associated cloud service is still in use, do not delete the automatically created project.
  4. Use CloudLens for SLS to analyze resource usage and estimate costs.

Enable project deletion protection

Enable the recycle bin to protect important projects from accidental deletion. Deleted projects move to the recycle bin, where they are inactive with no read or write access. You can restore a recycled project at any time. Only data storage fees apply to recycled projects.

Note

Projects are retained in the recycle bin for 7 days by default and automatically deleted afterward.

Console

Enable the recycle bin feature

  1. Log on to the Simple Log Service console. In the Projects section, click the name of the target project.

  2. On the Project Overview page, in the Basic Information section, locate the Recycle Bin and click Enable if it is disabled.

API

Modify the recycleBinEnabled parameter in the UpdateProject operation.

Delete and restore project resources

Deleting a project permanently removes all data in its Logstores, MetricStores, and EventStores. Ensure the data is no longer needed or has been backed up before proceeding.

Note

Storage and other fees are still incurred on the day you delete a Project, and billing stops on the following day. This means that you will no longer receive a bill for Simple Log Service starting from the third day after you delete the Project.

Console

  1. Clear resources before deletion

    • No associated resources:

      • When you enable log analysis for Alibaba Cloud services (elastic computing, storage, security, databases, etc.), SLS automatically creates a corresponding project and Logstore. To remove these logs, disable log analysis in the respective service console. Verify that the project is not associated with other services.

    • No billing dependencies: Ensure any associated paid resources, such as storage plans or provisioned capacity, are released or unsubscribed from.

  2. Steps to delete a project

    1. Back up important data (optional)

      • Back up Logstore data: If the project contains log data that you need to retain, export the data first using the Download logs feature.

      • Back up configuration information: Record key configurations such as the project name, storage capacity, and access control settings.

    • Delete the project

      • In the project list, find the project to delete and click Delete.

      • In the Delete Project dialog box, enter the project name, select a reason, and click OK.

        Warning

        All log data and configuration in the project are permanently deleted and cannot be restored. Proceed with caution.

      • Confirm by entering the project name when prompted.

  3. If the recycle bin feature is enabled for a project, you can find a deleted project on the Recycle Bin Projects tab in the project list. By default, a project is retained in the recycle bin for 7 days. During this period, you can restore or permanently delete it.

API

DeleteProject.

Manage resource quotas

Adjust quotas for project-level resources such as Logstores, shards, Logtail configurations, and machine groups.

You can create a maximum of 150 projects under an Alibaba Cloud account. To request a higher quota, submit a ticket.

Console

  1. Log on to the Simple Log Service console. In the Projects section, click the name of the target project.

  2. In the Basic Information section of the Project Overview page, find Resource Quotas and click Manage. In the Resource Quotas panel, adjust the quota for the desired resource and click Save. The change takes effect in about one hour.

Supported parameters

Quota metric

Description

Default value

Upper limit

Maximum Logstores

The maximum number of Logstores that can be created in a project.

200

400

Maximum shards

The maximum number of shards that can be created in a project.

400

800

Maximum Logtail configurations

The maximum number of Logtail configurations that can be created in a project.

200

400

Maximum machine groups

The maximum number of machine groups that can be created in a project.

200

400

Dashboard limit

The maximum number of dashboards that can be created in a project.

100

400

Maximum charts per dashboard

The maximum number of charts that can be included in a dashboard.

200

400

Maximum saved searches

The maximum number of saved searches that can be created in a project.

100

400

Maximum data export jobs

The maximum number of export tasks that can be created in a project.

100

400

Maximum data import jobs

The maximum number of import tasks that can be created in a project.

100

400

Maximum scheduled SQL jobs

The maximum number of scheduled SQL jobs that can be created in a project.

100

400

Maximum transformation jobs

The maximum number of data transformation jobs that can be created in a project.

100

400

Alert Threshold

The maximum number of alerts that can be created in a project.

100

400

Maximum subscription jobs

The maximum number of tracking tasks that can be created in a project.

100

400

Maximum write traffic per project (GB/minute)

The total write traffic of all Logstores in a project within 1 minute.

100

200

Maximum writes per project (10,000 writes/minute)

The total number of write operations on all Logstores in a project within 1 minute.

60

200

Maximum reads per project (10,000 reads/minute)

The total number of read operations on all Logstores in a project within 1 minute.

60

200

Accelerate cross-region log transfer

Enable transfer acceleration for long-distance log transfers, such as from regions outside the Chinese mainland to regions inside. Transfer acceleration routes requests to the nearest SLS access point through a global network with optimized paths and protocols. You are charged based on the amount of data transferred.

Console

Enable transfer acceleration

  1. Log on to the Simple Log Service console. In the Projects section, click the name of the target project.

  2. On the Project Overview page, in the Endpoint section, locate the Acceleration Endpoint and click Enable. Read the message in the dialog box and click Modify.

  3. Transfer acceleration improves speeds for Logtail log collection and data transformation jobs.

API

  1. Configure transfer acceleration.

  2. Set the endpoint parameter to an acceleration endpoint. Acceleration endpoints support only HTTP and HTTPS, not Kafka or gRPC. When acceleration is not needed, use standard endpoints to reduce costs.

        /**
             * This example obtains the AccessKey ID and AccessKey secret from environment variables.
             */String accessId = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID");
            String accessKey = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET");
            /**
             * The service endpoint of SLS. Use an acceleration endpoint.
             */String endpoint = "log-global.aliyuncs.com";
            /**
             * Create an SLS client.
             */static Client client = new Client(host, accessId, accessKey);

Manage resource groups

Group projects using tags (project-level) or resource groups (account-level).

Set resource groups

A project can belong to only one resource group.

Console

  1. Log on to the Simple Log Service console. In the Projects section, click the name of the target project.

  2. In the Resource Group Details section of the Project Overview page, hover over the resource group ID, click Modify, and then select a new resource group.

API

ChangeResourceGroup.

Set tags

Console

  1. Log on to the Simple Log Service console. In the Projects section, click the name of the target project.

  2. In the Tag section of the Project Overview page, click Edit, and then configure the tags.

API

Attach a tag.

View domain names and configure a custom domain name

View domain name information or replace a public domain name with a custom one for use as the API endpoint.

Console

  1. Log on to the Simple Log Service console. In the Projects section, click the name of the target project.

  2. In the Endpoint section of the Project Overview page, view the domain information for the project.

  3. Hover your mouse over Specify Custom Endpoint > Specify Custom Endpoint > Specify Custom Endpoint, then click Specify Custom Endpoint. In the Specify Custom Endpoint panel, click Bind. Register a domain name.

  4. In the Alibaba Cloud DNS console, create a CNAME record to bind your domain. Set Record Value to the Public Endpoint on the Project Overview page under Basic Information > Endpoint. CNAME record.

API

CreateDomain.

Monitor project resources

Use the service log feature to collect operation logs for resource changes, task execution logs for scheduled SQL, data import, and data shipping jobs, consumption latency logs for consumer groups, and error, heartbeat, and statistics logs for Logtail.

Console

  1. Log on to the Simple Log Service console. In the Projects section, click the name of the target project.

  2. On the Enable Detailed Logs page for the project, click Enable Detailed Logs. In the Modify Service Log Settings panel, select the service logs to enable and the target project.

    • Detailed logs: Provides complete operation logs. This is a pay-as-you-go feature.

    • Important logs: Provides metering logs, consumer group latency logs, and Logtail heartbeat logs. This feature is free of charge.

    • Job operational logs: Provides the execution logs of data import, scheduled SQL, and data shipping jobs. This feature is free of charge.

    • Log storage location: Choose an existing project or allow SLS to automatically create a new one to store these logs.

What's next

To store different types of data in a project, create different types of stores. Manage stores.