← Back to Skills Marketplace
sdk-team

Alibabacloud Sls Data Agent

by alibabacloud-skills-team · GitHub ↗ · v0.0.1 · MIT-0
cross-platform ✓ Security Clean
44
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install alibabacloud-sls-data-agent
Description
Invoke SLS DataAgent to autonomously perform data acquisition, processing, analysis, and visualization for Alibaba Cloud SLS (Simple Log Service). Acts as a...
README (SKILL.md)

SLS DataAgent

SLS DataAgent is an AI assistant that autonomously understands natural language and automatically completes data acquisition, processing, analysis, and visualization. It acts as your "fully automated data analyst": you ask a question in natural language, and it fetches, cleans, analyzes the data, and returns conclusions and visualizations.

It is invoked through the SLS DataAgent OpenAPI; the session streams the analysis process and conclusions back over SSE.

Capabilities

  • Natural language understanding: turn colloquial data questions into well-defined analysis tasks.
  • Data acquisition: automatically locate and pull relevant data (logs, metrics, etc.) within the SLS project.
  • Data processing: cleaning, aggregation, transformation.
  • Data analysis: statistics, trends, comparisons, anomalies / insights.
  • Visualization: generate charts and structured conclusion reports.

Digital Employee (agentId)

A session is handled by a "digital employee" (digital employee / agentId).

  • Generic and customizable: --digital-employee \x3Cname> > SLS_DATA_AGENT_EMPLOYEE env var > script default apsara-ops.
  • The console assistantId is the digital employee in use.

Built-in Skill (capability routing)

Use --skill to select a DataAgent built-in skill; omit it to use the general capability.

Skill ID Description
builtin.sls.sls-sql-generation SQL generation
builtin.sls.spl-generation SPL generation
builtin.sls.sls-loongcollector LoongCollector ingestion ops
builtin.sls.sls-visualization Dashboard assistant

Logstore context

Use --logstore to specify the target logstore, giving the analysis an explicit data source scope.

Environment Variables

Variable Required Description
SLS_DATA_AGENT_PROJECT Yes SLS project name (the scope; can also be passed via --project).
SLS_DATA_AGENT_REGION Yes Region where the SLS project resides (e.g. cn-shanghai, cn-beijing).
SLS_DATA_AGENT_EMPLOYEE No Digital employee name (default apsara-ops).
SLS_DATA_AGENT_LOGSTORE No Default target logstore (can also be passed via --logstore).
SLS_DATA_AGENT_SKILL No Built-in skill ID (e.g. builtin.sls.sls-sql-generation). Omit to use the general capability.

Credentials — uses the Alibaba Cloud Credentials SDK default chain (STS / RAM role / CLI profile ~/.aliyun/config.json / env vars ALIBABA_CLOUD_ACCESS_KEY_ID+ALIBABA_CLOUD_ACCESS_KEY_SECRET).

Pre-flight check:

missing=""
[ -z "$SLS_DATA_AGENT_PROJECT" ] && missing="$missing SLS_DATA_AGENT_PROJECT"
[ -z "$SLS_DATA_AGENT_REGION" ]  && missing="$missing SLS_DATA_AGENT_REGION"
if [ -n "$missing" ]; then echo "ERROR: Missing required environment variables:$missing" >&2; exit 1; fi
echo "OK: PROJECT=$SLS_DATA_AGENT_PROJECT REGION=$SLS_DATA_AGENT_REGION"

If a required value is empty, stop and ask the user; do not substitute a placeholder such as example-project.

Invocation

--pipe is mandatory: it guarantees stdout emits the THREAD line and the === DATA AGENT ANSWER BEGIN/END === delimiters, so downstream can parse reliably.

pip3 install -r scripts/requirements.txt

# First question (auto-creates a session; most queries need --logstore)
python3 scripts/call_sls_data_agent.py \
  --logstore my_logstore \
  --question "\x3Cfull data-analysis request>" --pipe

# Follow-up (reuse the THREAD ID from the previous step to keep context)
python3 scripts/call_sls_data_agent.py \
  --thread "\x3Cthread_id>" --question "\x3Cfollow-up>" --pipe

# Specify a built-in skill
python3 scripts/call_sls_data_agent.py \
  --skill builtin.sls.sls-sql-generation \
  --logstore my_logstore \
  --question "number of error logs in the last 5 minutes" --pipe

Example output (pipe):

THREAD: thread-abc123-xyz
DATA_AGENT_URL: https://starops.console.aliyun.com/chat?threadId=thread-abc123-xyz&assistantId=apsara-ops
=== DATA AGENT ANSWER BEGIN ===
(analysis conclusion / visualization description)
=== DATA AGENT ANSWER END ===

Behavioral Notes

  1. A DataAgent call is a long task: a single session may trigger multi-step internal analysis and take several minutes; the default timeout is 30 minutes.
  2. Provide the full context in one go: SLS project, time range, target logstore/fields, the metrics to analyze, and the expected chart/conclusion form.
  3. Always reuse --thread for follow-ups, otherwise context and intermediate results are lost.
  4. Always pass --pipe: tool status and intermediate progress go to stderr; stdout keeps only the reusable thread id and the final answer.
  5. Conclusions must be based on the real return between the BEGIN / END delimiters: cite concrete data points, do not fabricate. If the answer is empty, retry once with the same --thread; if still empty, state plainly that DataAgent returned no valid data.

Troubleshooting

  1. HTTP 401/403 — credentials did not resolve to an authorized identity. Confirm the default chain resolves valid credentials and that the identity is allowed to call the SLS DataAgent OpenAPI. See references/ram-policies.md.
  2. HTTP 404 — the digital employee (--digital-employee, default apsara-ops) or the SLS project (SLS_DATA_AGENT_PROJECT) does not exist. Verify both.
  3. ConfigError: Missing required SLS DataAgent configuration — one of SLS_DATA_AGENT_PROJECT / SLS_DATA_AGENT_REGION is empty.
  4. CredentialError — the default chain found no valid credential source.
  5. Idle timeout — no SSE event within --idle-timeout seconds. Increase the value if needed, or retry with the same --thread.
  6. ModuleNotFoundError — run pip3 install -r scripts/requirements.txt first.

API Surface

The script calls the SLS DataAgent OpenAPI directly (ACS3-HMAC-SHA256 signing); the endpoint defaults to starops.cn-beijing.aliyuncs.com and can be overridden via SLS_DATA_AGENT_ENDPOINT:

  • Create a session (thread)
  • Start a conversation and stream the analysis process and conclusions (SSE)

See references/api-reference.md and references/ram-policies.md for details.

Observability

Every HTTP request carries a user-agent header for tracing:

AlibabaCloud-Agent-Skills/alibabacloud-sls-data-agent/{session-id}
  • alibabacloud-sls-data-agent — fixed skill identifier (matches the name field).
  • {session-id} — a 32-character hex string, read from the SKILL_SESSION_ID environment variable. If the env var is not set, the script falls back to generating uuid.uuid4().hex. The same session-id is shared across all requests in a single invocation (CreateThread + CreateChat), enabling correlation of API calls in server-side logs.
Usage Guidance
Install this only if you intend to use Alibaba Cloud SLS DataAgent. Use least-privilege Alibaba Cloud credentials limited to the needed DataAgent actions and SLS scope, confirm the project/logstore before each analysis, and do not include secrets, regulated data, or unrelated local/private content in questions sent through the skill.
Capability Assessment
Purpose & Capability
The documented purpose is remote SLS data analysis and visualization, and the code implements that by creating DataAgent threads and streaming chat results from Alibaba Cloud.
Instruction Scope
Most instructions are SLS-specific and require project and region scoping, but the activation terms include generic phrases like data analysis and charts, so users should invoke it only for Alibaba Cloud SLS work.
Install Mechanism
Installation uses a small Python script with pinned dependencies for Alibaba Cloud credentials and requests; no installer persistence, hidden downloaders, or extra package mutation were found.
Credentials
Network access, project/logstore context, natural-language prompts, and Alibaba Cloud default-chain credentials are proportionate for this integration and are documented, though they may expose sensitive operational context to Alibaba Cloud.
Persistence & Privilege
The skill creates remote DataAgent threads and reuses thread IDs for follow-ups, but it does not create local background workers, local persistence, or directly mutate cloud resources.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install alibabacloud-sls-data-agent
  3. After installation, invoke the skill by name or use /alibabacloud-sls-data-agent
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.0.1
alibabacloud-sls-data-agent 0.0.1 initial release - Introduces an autonomous assistant for Alibaba Cloud SLS that processes, analyzes, and visualizes data from natural language questions. - Supports automatic data acquisition, cleaning, analysis, and chart generation via SLS DataAgent OpenAPI. - Includes environment variable controls for SLS project, region, logstore, and digital employee. - Allows selection of built-in skills for SQL/SPL/Dashboard/LoongCollector operations. - Provides session management, context handling, and reliable output parsing using mandatory `--pipe` mode. - Outlines troubleshooting steps, API references, and observability via traceable user-agent headers.
Metadata
Slug alibabacloud-sls-data-agent
Version 0.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Alibabacloud Sls Data Agent?

Invoke SLS DataAgent to autonomously perform data acquisition, processing, analysis, and visualization for Alibaba Cloud SLS (Simple Log Service). Acts as a... It is an AI Agent Skill for Claude Code / OpenClaw, with 44 downloads so far.

How do I install Alibabacloud Sls Data Agent?

Run "/install alibabacloud-sls-data-agent" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Alibabacloud Sls Data Agent free?

Yes, Alibabacloud Sls Data Agent is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Alibabacloud Sls Data Agent support?

Alibabacloud Sls Data Agent is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Alibabacloud Sls Data Agent?

It is built and maintained by alibabacloud-skills-team (@sdk-team); the current version is v0.0.1.

💬 Comments