Documentation

KapacitorLoopbackNode

This page documents an earlier version of Kapacitor. Kapacitor v1.6 is the latest stable version. View this page in the v1.6 documentation.

The kapacitorLoopback node writes data back into the Kapacitor stream. To write data to a remote Kapacitor instance use the InfluxDBOutNode.

Example:

|kapacitorLoopback()
  .database('mydb')
  .retentionPolicy('myrp')
  .measurement('errors')
  .tag('kapacitor', 'true')
  .tag('version', '0.2')

Beware of infinite loops

It is possible to create infinite loops using the KapacitorLoopback node. Take care to ensure you do not chain tasks together creating a loop.

Avoid name collisions with multiple subscriptions

When using the KapacitorLoopback node, don’t subscribe to identically named databases and retention policies in multiple InfluxDB instances or clusters. If Kapacitor is subscribed to multiple instances of InfluxDB, make each database and retention policy combination unique. For example:

influxdb_1
  └─ db1/rp1

influxdb_2
  └─ db2/rp2

Available Statistics:

  • points_written: number of points written back to Kapacitor

Constructor

Chaining MethodDescription
kapacitorLoopback ( )Create an kapacitor loopback node that will send data back into Kapacitor as a stream.

Property Methods

SettersDescription
database ( value string)The name of the database.
measurement ( value string)The name of the measurement.
quiet ( )Suppress all error logging events from this node.
retentionPolicy ( value string)The name of the retention policy.
tag ( key stringvalue string)Add a static tag to all data points. Tag can be called more than once.

Chaining Methods

Deadman, Stats


Properties

Property methods modify state on the calling node. They do not add another node to the pipeline, and always return a reference to the calling node. Property methods are marked using the . operator.

Database

The name of the database.

kapacitorLoopback.database(value string)

Measurement

The name of the measurement.

kapacitorLoopback.measurement(value string)

Quiet

Suppress all error logging events from this node.

kapacitorLoopback.quiet()

RetentionPolicy

The name of the retention policy.

kapacitorLoopback.retentionPolicy(value string)

Tag

Add a static tag to all data points. Tag can be called more than once.

kapacitorLoopback.tag(key string, value string)

Chaining Methods

Chaining methods create a new node in the pipeline as a child of the calling node. They do not modify the calling node. Chaining methods are marked using the | operator.

Deadman

Helper function for creating an alert on low throughput, a.k.a. deadman’s switch.

  • Threshold: trigger alert if throughput drops below threshold in points/interval.
  • Interval: how often to check the throughput.
  • Expressions: optional list of expressions to also evaluate. Useful for time of day alerting.

Example:

    var data = stream
        |from()...
    // Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
    data
        |deadman(100.0, 10s)
    //Do normal processing of data
    data...

The above is equivalent to this example:

    var data = stream
        |from()...
    // Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
    data
        |stats(10s)
            .align()
        |derivative('emitted')
            .unit(10s)
            .nonNegative()
        |alert()
            .id('node \'stream0\' in task \'{{ .TaskName }}\'')
            .message('{{ .ID }} is {{ if eq .Level "OK" }}alive{{ else }}dead{{ end }}: {{ index .Fields "emitted" | printf "%0.3f" }} points/10s.')
            .crit(lambda: "emitted" <= 100.0)
    //Do normal processing of data
    data...

The id and message alert properties can be configured globally via the ‘deadman’ configuration section.

Since the AlertNode is the last piece it can be further modified as usual. Example:

    var data = stream
        |from()...
    // Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
    data
        |deadman(100.0, 10s)
            .slack()
            .channel('#dead_tasks')
    //Do normal processing of data
    data...

You can specify additional lambda expressions to further constrain when the deadman’s switch is triggered. Example:

    var data = stream
        |from()...
    // Trigger critical alert if the throughput drops below 100 points per 10s and checked every 10s.
    // Only trigger the alert if the time of day is between 8am-5pm.
    data
        |deadman(100.0, 10s, lambda: hour("time") >= 8 AND hour("time") <= 17)
    //Do normal processing of data
    data...
kapacitorLoopback|deadman(threshold float64, interval time.Duration, expr ...ast.LambdaNode)

Returns: AlertNode

Stats

Create a new stream of data that contains the internal statistics of the node. The interval represents how often to emit the statistics based on real time. This means the interval time is independent of the times of the data points the source node is receiving.

kapacitorLoopback|stats(interval time.Duration)

Returns: StatsNode


Was this page helpful?

Thank you for your feedback!


Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

InfluxDB Cloud backed by InfluxDB IOx

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by IOx, this is the correct documentation.

If powered by TSM, see the TSM-based InfluxDB Cloud documentation.

InfluxDB Cloud backed by InfluxDB TSM

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine which enables nearly unlimited series cardinality and SQL query support. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by TSM, this is the correct documentation.

If powered by IOx, see the IOx-based InfluxDB Cloud documentation.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.