Skip to content

Modify Auto-Discovery Configuration



POST /api/v1/issue_auto_discovery/{cfg_uuid}/modify

Overview

Modify the Issue auto-discovery configuration and the overall Issue template.

Before Calling and Usage Steps

This module is the original Incident Issue auto-discovery configuration. It is not Incident Center Incidents on-call scheduling/auto-aggregation, nor is it an Error Center ErrorTrack rule. Currently, the only publicly writable dqlNamespace is keyevent; legacy rum/tracing examples do not match the current declaration. Workspaces already migrated in the backend with issueUpgrade=true skip this v2 auto-discovery task; a successful configuration does not guarantee that the workspace will generate new Issues.

The permission must match one of trace.issueDiscovery/rum.issueDiscovery/anomaly.issueDiscovery. The rule name and the config.name of the generated Issue are two separate fields. every accepts only 300/600/900/1800/3600; although 60 appears in the legacy enum, the minimum value 300 also applies, so it is rejected. For dimensions, explicitly provide non-empty field names; for config, explicitly provide description, channelUUIDs, and extend.text. Otherwise, even after a successful save, the task may still fail due to missing keys or invalid queries.

name/dqlNamespace/every/config are still publicly required. config is replaced as a whole each time, and old subkeys are not automatically retained. At the top level, omitting description/conditions/dimensions preserves them; explicitly setting description/conditions to empty clears them; dimensions cannot be [] when present. After the first-round commit, changing the conditions value triggers a separate submission that resets Issue.eventCount to 0 for associated Issues with statusType=10 and status0; changing only dimensions/frequency does not automatically perform the same reset, nor does it write back old titles/historical replies. If the second round/synchronous audit fails, the configuration may already have been saved; check it first.

config.extend.manager is normalized; unknown accounts/targets may be silently removed. Although explicit null is declared as allowed, the current audit/processing calls .get directly and returns 500, so do not pass it. Using dutyPerson uses the original Incident notification schedule, not Incident Center on-call scheduling. Template variables are replaced only by word keys for grouping tags/aggregate count; unknown variables are left as-is, and no arbitrary template code is executed.

Saving the configuration does not immediately execute a query or return a generated task; scheduled jobs process the previous every-second window aligned to the Asia/Shanghai calendar, and task queue/query time may delay execution. keyevent aggregates from monitor events and produces at most 1000 groups by dimensions; complete coverage over a wide range is not guaranteed. The sorted JSON of grouping dimensions generates a deduplication identifier, and the rule UUID is not part of this identifier. Multiple rules in the same workspace with the same dimension values may be associated with the same existing Issue. Changing dimensions/filters may change grouping results; do not treat it as a per-rule independent Issue set that never intersects. For Open/Pending, replies are appended; Resolved can be reopened and return; Closed is not reused; legacy Working branches are handled according to the actual implementation, and complete isolation during work is not guaranteed. Notifications are asynchronous; HTTP 200 does not mean the data query succeeded, a new Issue was generated, or the notification was delivered.

Route Parameters

Parameter Type Required Description
cfg_uuid string Y An undeleted rule in the current Key workspace; it can be read/modified whether status is 0 (enabled) or 2 (disabled). If missing, the legacy-compatible ft.LogIndexCfgNoExists is used; although the message refers to a log index, actually verify this rule UUID.
Example: iatdc_example
How to obtain or enter: Get content.data[].uuid (iatdc_) from the Issue auto-discovery rule list; do not use an Issue UUID or ErrorTrack rule UUID.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace.

Body Request Parameters

Parameter Type Required Description
dimensions[*] string A single field name string; the source declaration does not constrain subitems; a non-string causes a 500 when concatenating synchronous audit data: add usually fails before commit, while modify may fail after the first-round commit. If it is a string but the field does not exist, the backend query may fail or return no data. Do not use backticks/full query fragments as field names.
Example: service
How to obtain or enter: An event field/tag name; confirm that all target data has this field.
config.channelUUIDs[*] string A single active channel UUID; it is not a dimension field/team UUID; unknown or disabled channels return 404.
Example: chan_example
How to obtain or enter: The uuid in the current workspace's channel quick list.
config.extend.text string Explicitly specifying a string is recommended. The task reads it and performs template replacement; missing/non-string values may fail asynchronously; it and config.description are separately stored text fields.
Example: 服务{{service}}发现{{count}}条事件
How to obtain or enter: Build the Issue body template based on dimensions tags and aggregate count.
config.extend.manager array Optional array of assignee strings. Valid acnt_/teams in the current workspace/email addresses/dutyPerson are retained; unknown accounts/unknown values may be silently removed, and per-item errors are not guaranteed. Free/Free Plan workspaces do not support external email addresses and may return 400. A missing assignee may enter the unassigned escalation process.
Example: []
How to obtain or enter: Get acnt_ from Workspace Members and group_ from the Team List; or use a member/allowed external email address. To use the original Incident's on-call person for today, use the literal value dutyPerson; for configuration, see Notification Schedule.
config.extend.manager[*] string A valid principal, email address, or dutyPerson; a non-string may cause a 500 during string startswith processing.
Example: acnt_example
How to obtain or enter: Get acnt_ from Workspace Members and group_ from the Team List; or use a member/allowed external email address. To use the original Incident's on-call person for today, use the literal value dutyPerson; for configuration, see Notification Schedule.
config.extend.conditionsInputFilters any Optional arbitrary JSON used to supplement filter display when navigating from historical Issues/notification events; actual queries still use the top-level conditions, and changing only this key cannot replace it.
Example: {}
How to obtain or enter: The display structure can be provided by the Incident condition editor.
config.extend.variable json Not recommended for requests; the task overwrites this object with actual query columns; count is commonly the number of records in the window.
Example: {"count": 8}
How to obtain or enter: Aggregate variables are calculated when the generated task runs.
config.extend.variable.count integer Occurrence count at runtime; caller input does not take effect as a reliable fixed value.
Example: 8
How to obtain or enter: The backend calculates it by querying count(*) for this window.
config.extend.tags json Not recommended for requests; the task overwrites it with actual grouping tags, which participate in Issue deduplication and template variables.
Example: {"service": "payment"}
How to obtain or enter: The generated task obtains it from grouping tags.
config.extend.tags.字段 any Dynamic JSON tag value; caller-entered values cannot be used to fix generated groups.
Example: payment
How to obtain or enter: Comes from the event tag value corresponding to dimensions.
config.extend.channelUUIDs array At runtime, it is overwritten with valid configured channels; do not use this extension field to replace config.channelUUIDs.
Example: []
How to obtain or enter: The task writes it after filtering currently valid channels by config.channelUUIDs.
config.extend.channelUUIDs[*] string A valid channel identifier at runtime.
Example: chan_example
How to obtain or enter: A valid channel uuid in the current workspace.
config.extend.自定义键 any Arbitrary JSON value that is saved; no additional execution guarantees are publicly documented on this page; do not put credentials in it.
Example: value
How to obtain or enter: Caller-defined extension for business display.
name string Y Required string, up to 256 characters; the declaration does not enforce non-emptiness, but a non-empty value is recommended. Names of undeleted rules in the same workspace cannot be duplicated. It is still required when modifying; this is the rule name, not the generated Issue title.
Allowed null: False
Maximum length: 256
Example: 生产事件自动发现
How to obtain or enter: The maintainer enters a rule name unique within the workspace.
description string Optional string; empty is allowed. When omitted on creation, it is empty; when omitted on modification, it is preserved; an explicit empty value clears it; it is not used as the Issue body template.
Allowed null: False
Empty string allowed: True
Example: 按服务聚合生产告警
How to obtain or enter: The caller enters a description of the rule's purpose.
dqlNamespace string Y Required; keyevent is the only public enum value; it is not rum/tracing, and you cannot pass other values just because legacy entities/examples allowed them.
Allowed null: False
Allowed values: ['keyevent']
Example: keyevent
How to obtain or enter: Currently, the public scope is fixed to the keyevent event range.
every integer Y Required integer; only 300/600/900/1800/3600 are allowed. Although the legacy enum includes 60, the minimum value 300 also applies; 60 returns 406 on public routes, so a 1-minute interval cannot be selected.
Allowed null: False
$minValue: 300
$maxValue: 3600
Allowed values: [60, 300, 600, 900, 1800, 3600]
Example: 300
How to obtain or enter: Choose the interval in seconds based on discovery latency and query volume.
conditions string Optional string that contains only a filter expression, not full DQL/JSON. When omitted on creation, it is empty; on modification, omitting it preserves the value and an empty value clears it; saving does not currently parse DQL, so syntax/fields are not guaranteed to be valid, and asynchronous task failures are not converted into errors for this API call. The entity column is 48 characters; the declaration has no length limit, so short expressions are recommended and administrators should confirm the deployment column limit.
Allowed null: False
Empty string allowed: True
Example: `df_status` = 'error'
How to obtain or enter: Build the DQL filter condition from real fields of the target monitor events; you can first verify it in a query tool with the same time range.
dimensions array Optional array; when present, it must contain at least one item. Omitting it on creation still saves [], but the task may construct an invalid by statement, so always provide non-empty real fields. Omitting it on modification preserves the value; [] returns 406 before processing and cannot be used to clear it. These are field names, not channel UUIDs; field order/set affects grouping queries, and df_label is aggregated as a set.
Allowed null: False
Minimum length: 1
Example: ["service"]
How to obtain or enter: Select field names used for grouping deduplication from actual event tag fields, such as service, host, or df_label.
config json Y Required object; each modification replaces it entirely without recursive merging; only the five declared keys name/level/channelUUIDs/description/extend are allowed. For reliable execution of subsequent tasks, explicitly provide description, the channelUUIDs array, the extend object, and the extend.text string even though they are optional; missing values may still save successfully but cause task failures.
Allowed null: False
Example: {"name": "服务{{service}}告警", "description": "本窗口{{count}}条事件", "channelUUIDs": [], "extend": {"text": "服务{{service}}发现{{count}}条事件", "manager": []}}
How to obtain or enter: Configure the Issue title, body, channels, and assignees according to the template configuration on this page.
config.name string Y Required string, up to 256 characters; the Issue title template is different from the rule name. Supports word variable names such as {{service}}/{{count}}; unknown variables are left as-is; arbitrary Python/Jinja expressions are not supported, and fields containing dots/hyphens are not guaranteed to be replaced.
Allowed null: False
Maximum length: 256
Example: 服务{{service}}告警
How to obtain or enter: Build the title template based on dimensions fields and the aggregate variable count.
config.level string Optional level UUID or empty string; a non-empty value must be currently valid, otherwise 406; omitting it means no level is specified. It is not a general replacement field for Incident Center level UUIDs.
Allowed null: False
Empty string allowed: True
Example: system_level_0
How to obtain or enter: Get uuid from the Issue level list; if global levels are enabled in the backend, the administrator configuration takes precedence.
config.channelUUIDs array Optional array of channel UUIDs; explicit items must be currently active; it is recommended to always pass [] or a valid array. Although omission can be saved, the task may fail when iterating over None. The task automatically adds a default channel association; saving itself still requires the workspace to have at least one active channel, even for [].
Allowed null: False
Example: []
How to obtain or enter: Get an active chan_ UUID in the current workspace from the Channel Quick List.
config.description string Declared as an optional string, but subsequent tasks read this key directly, so always provide it explicitly (it can be an empty string). Modifying config replaces it entirely, and omitting a subkey does not retain the old value.
Allowed null: False
Example: 本窗口{{count}}条事件
How to obtain or enter: Use the same template variables to build the Issue description.
config.extend json Optional object or null; actual creation/modification audit data calls extend.get directly, so an explicit null returns 500. Creation usually fails before commit, while modification historical audits may fail after commit. It is recommended to always pass an object containing text; omission may also save successfully but cause the task to fail due to missing extend/text. When the object is present, it is replaced entirely, and any subvalues must remain structurally valid.
Allowed null: True
Example: {"text": "服务{{service}}发现{{count}}条事件", "manager": []}
How to obtain or enter: Refer to the display extension in Create Issue, and use the consumed fields verified on this page as the source of truth.

Additional Parameter Notes

The current public scope is keyevent; configuration saving, scheduled execution, and notification delivery are different stages. See below for parameters and the complete response/error boundaries.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/issue_auto_discovery/iatdc_example/modify' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"生产事件自动发现","description":"按服务聚合生产告警","dqlNamespace":"keyevent","every":300,"conditions":"`df_status` = '"'"'error'"'"'","dimensions":["service"],"config":{"name":"服务{{service}}告警","description":"本窗口{{count}}条事件","channelUUIDs":[],"extend":{"text":"服务{{service}}发现{{count}}条事件","manager":[]}}}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content object Configuration snapshot before submission; does not include creation/update identity summaries or generated Issues/execution results.
content.id integer Database ID of the existing configuration; subsequent API calls locate it by uuid.
content.uuid string Auto-discovery rule UUID, with the iatdc_ prefix.
content.status integer 0 enabled, 2 disabled, 3 soft-deleted; reads exclude 3.
content.creator string Creator principal UUID; the current public entry point usually uses wsak_.
content.updator string or null Updater principal; may be empty or null in the creation snapshot.
content.createAt integer Creation time in Unix seconds.
content.updateAt integer or null Update time in Unix seconds; the pre-submission creation snapshot may be null, while subsequent database default/updated values may be -1 or an actual time.
content.deleteAt integer Deletion time in Unix seconds; usually -1 if not deleted.
content.workspaceUUID string Workspace to which the current Key belongs.
content.name string Rule name.
content.description string Rule description; not the Issue body template.
content.dqlNamespace string Public writes currently use keyevent; historical records may have other namespaces, which does not mean they can be written back through the public API.
content.every integer Interval in seconds.
content.conditions string Saved DQL filter expression; this does not mean execution has been verified as successful.
content.dimensions array<string> Array of grouping field names; legacy incorrect types must be tolerated.
content.dimensions[] string An event field name.
content.config object Template for defining generated Issues.
content.config.name string Required string, up to 256 characters; the Issue title template is different from the rule name. Supports word variable names such as {{service}}/{{count}}; unknown variables are left as-is; arbitrary Python/Jinja expressions are not supported, and fields containing dots/hyphens are not guaranteed to be replaced.
content.config.level string Optional level UUID or empty string; a non-empty value must be currently valid, otherwise 406; omitting it means no level is specified. It is not a general replacement field for Incident Center level UUIDs.
content.config.channelUUIDs array Optional array of channel UUIDs; explicit items must be currently active; it is recommended to always pass [] or a valid array. Although omission can be saved, the task may fail when iterating over None. The task automatically adds a default channel association; saving itself still requires the workspace to have at least one active channel, even for [].
content.config.channelUUIDs[] string A single active channel UUID; it is not a dimension field/team UUID; unknown or disabled channels return 404.
content.config.description string Declared as an optional string, but subsequent tasks read this key directly, so always provide it explicitly (it can be an empty string). Modifying config replaces it entirely, and omitting a subkey does not retain the old value.
content.config.extend.text string Explicitly specifying a string is recommended. The task reads it and performs template replacement; missing/non-string values may fail asynchronously; it and config.description are separately stored text fields.
content.config.extend.manager array Optional array of assignee strings. Valid acnt_/teams in the current workspace/email addresses/dutyPerson are retained; unknown accounts/unknown values may be silently removed, and per-item errors are not guaranteed. Free/Free Plan workspaces do not support external email addresses and may return 400. A missing assignee may enter the unassigned escalation process.
content.config.extend.manager[] string A valid principal, email address, or dutyPerson; a non-string may cause a 500 during string startswith processing.
content.config.extend.conditionsInputFilters any Optional arbitrary JSON used to supplement filter display when navigating from historical Issues/notification events; actual queries still use the top-level conditions, and changing only this key cannot replace it.
content.config.extend.variable json Not recommended for requests; the task overwrites this object with actual query columns; count is commonly the number of records in the window.
content.config.extend.variable.count integer Occurrence count at runtime; caller input does not take effect as a reliable fixed value.
content.config.extend.tags json Not recommended for requests; the task overwrites it with actual grouping tags, which participate in Issue deduplication and template variables.
content.config.extend.tags.字段 any Dynamic JSON tag value; caller-entered values cannot be used to fix generated groups.
content.config.extend.channelUUIDs array At runtime, it is overwritten with valid configured channels; do not use this extension field to replace config.channelUUIDs.
content.config.extend.channelUUIDs[] string A valid channel identifier at runtime.
content.config.extend.自定义键 any Arbitrary JSON value that is saved; no additional execution guarantees are publicly documented on this page; do not put credentials in it.
content.config.extend object or null Saved extension; new requests should use an object, as null causes synchronous audit or subsequent task exceptions.
content.declaration object or null Public declaration of the current workspace.
{
  "code": 200,
  "content": {
    "id": 7,
    "uuid": "iatdc_example",
    "status": 0,
    "creator": "wsak_example",
    "updator": "wsak_example",
    "createAt": 1785427200,
    "updateAt": 1785427260,
    "deleteAt": -1,
    "workspaceUUID": "wksp_example",
    "name": "生产事件自动发现",
    "description": "按服务聚合生产告警",
    "dqlNamespace": "keyevent",
    "every": 300,
    "conditions": "`df_status` = 'error'",
    "dimensions": [
      "service"
    ],
    "config": {
      "name": "服务{{service}}告警",
      "description": "本窗口{{count}}条事件",
      "channelUUIDs": [],
      "extend": {
        "text": "服务{{service}}发现{{count}}条事件",
        "manager": []
      }
    },
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed A request field is missing, or a field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The top level of the request JSON is not an object Partial json file format error Submit a parameter object.
400 ft.IssueAutoDiscoveryCfgNameExists Duplicate name among undeleted rules in the current workspace A rule with the same name already exists Choose an unused name; upon failure/timeout, check the existing configuration first.
406 ft.IssueLevelNotExists config.level is non-empty and not among currently effective Issue levels The level configuration does not exist Verify the uuid against the Issue level list; do not mix display names/Incident Center levels.
404 ft.NotFoundChannel The workspace has no active channel, or a specified channelUUIDs item is not in the active channels The specified channel was not found Ensure the workspace has an active channel and select a UUID from the channel quick list; [] does not bypass the requirement that the workspace have at least one channel.
400 ft.UnsupportFreeIssueManager An assignee in a Free/Free Plan workspace uses an external email address that is not a member Free Plan workspaces do not support external email addresses as Incident assignees Use a member of the current workspace, or have an administrator confirm the product plan.
500 ft.InternalServerError Unhandled exception in template/assignee/dimensions, event count reset after configuration saving, or synchronous audit data construction Internal error First read back the configuration and the associated Issue event count; the configuration may already have been committed in the first round, and subsequent errors are not guaranteed to roll back; retain the traceId.
404 ft.LogIndexCfgNoExists The undeleted auto-discovery rule in the current workspace does not exist/has been deleted/is in another workspace The specified log index configuration does not exist Refresh the iatdc_ UUID from the auto-discovery list in this workspace; this is a reused legacy error message, so do not switch to creating a log index.

Feedback

Is this page helpful?