技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
datadog-api-synthetic-tests【数据与研究】Implements management and execution of Datadog Synthetic Tests using the API, focusing on setup, validation, and best practices.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: datadog-api-synthetic-tests description: Implements management and execution of Datadog Synthetic Tests using the API, focusing on setup, validation, and best practices. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: coding triggers: datadog synthetic tests, create synthetic tests, manage synthetic tests, datadog tests API, how do I use datadog synthetic tests role: implementation scope: implementation output-format: code related-skills: datadog-api-monitors, datadog-api-logs, datadog-api-metrics archetypes: [monitoring, synthetic testing] anti_triggers: [manual testing, performance bottlenecks] response_profile: verbosity: medium directive_strength: high
Implements the creation and management of Datadog Synthetic Tests through the API. This skill focuses on ensuring proper configurations and execution of synthetic monitoring for application performance.
Define Synthetic Test Configuration: Establish the configurations needed for synthetic tests, which include the type of test (API, browser), test frequency, and URLs. Checkpoint: Validate the configurations before creating the test.
Create Synthetic Tests: Utilize the Synthetic Tests API to create the test with the defined configurations. Checkpoint: Check API response for confirmation of test creation and log accordingly.
Monitor and Update Tests: Regularly review the status and performance of synthetic tests, updating configurations as necessary. Checkpoint: Log any modifications to keep an audit trail.
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi
from datadog_api_client.v2.model.synthetics_test import SyntheticsTest
import os
class SyntheticTestManager:
def __init__(self):
self.configuration = Configuration(api_key={"apiKeyAuth": os.environ["DD_API_KEY"]},
server_variables={"site": os.environ.get("DD_SITE", "datadoghq.com")})
self.api_client = ApiClient(self.configuration)
self.synthetics_api = SyntheticsApi(self.api_client)
def create_synthetic_test(self, test: SyntheticsTest) -> int:
response = self.synthetics_api.create_synthetic_test(test)
return response.id
def update_synthetic_test(test_id: int, new_url: str):
test = self.synthetics_api.get_synthetic_test(test_id)
test.config.request.url = new_url
self.synthetics_api.update_synthetic_test(test_id, test)
Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.