influxdata / influxdata/kapacitor

Add node and edge sequence attributes to Kapacitor tasks and debug/vars output

Open
#2,348 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

## Feature Request
It is difficult to track and display Kapacitor task nodes in the ordering that will follow node position in the TICKscript. Node name includes numeric value indicating position, but it is hard to read and it is not possible to correctly sort by this field at all or without implementing overhead queries and/or regex extractors.

### Proposal:
Add additional node and edge sequence attributes to Kapacitor tasks and debug/vars output to indicate a node position in a sequence. This can be achieved by extracting node position from node name and store as sequence tag.
This will help to collect health data by Telegraf Kapacitor input, display nodes health information in a table or create diagram following real node positions in Kapacitor tasks.

### Desired behavior:
Include `sequence` tag to API output (see below).

### Use case:
Display node health information on dashboards for TICKscript development and quick analysis.

* List nodes in a table sorted in a same order as nodes executed
* Filter and display only entry and out points to help to identify inbound and outbound problems
* Show data flow diagrams as a diagram where all nodes connected in correct order

> I think this would be best done in Kapacitor, so that we can utilize an already split value in Telegraf:
> ```diff
> {
> "067d801e-48de-4fec-98fe-d6691d3db1fe": {
> "name": "nodes",
> "tags": {
> "cluster_id": "aaa1cb78-8277-4886-a8ea-4706bca20842",
> "host": "localhost",
> "kind": "sum",
> "node": "sum5",
> + "sequence": "5",
> "server_id": "81e38258-5f18-4201-8d47-db603bfceeff",
> "task": "derivative-test",
> "type": "stream"
> },
> "values": {
> "avg_exec_time_ns": "0s"
> }
> },
> }
> ```
>
> If you agree, can you open an issue on the Kapacitor issue tracker?
>
> _Originally posted by @danielnelson in https://github.com/influxdata/telegraf/issues/7580#issuecomment-634207276_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Kapacitor task and debug/vars API output paths mentioned in the request, then identify where node and edge metadata is assembled. Confirm how node positions are represented in task names and determine the expected sequence attributes for both nodes and edges. Done means the API and debug/vars output expose sequence data that supports ordering and dashboard use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.