plugin

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

Blip Example: Copying Metric Metadata

This example demonstrates a TransformMetrics plugin that copies metric metadata from one domain to another.

Presume the replication topology is:

01 --> 02 --> 03

Node 01 is the source on which heartbeats are written. Node 02 is an intermediate replica. Node 03 is a replica of 02.

We are monitoring node 03.

The plan is:

level:
  collect:
    repl:
      metrics:
        - running
    repl.lag:
      # Defaults

Before transformation, metrics will be:

{
  repl: {
    {
      Name: "running"
      Value: 1
      Meta: {
        "source": "02"  // immediate source
      }
    }
  }
  repl.lag: {
    {
      Name: "current"
      Value: 75
      Meta: {
        "source": "01"  // heartbeat source
      }
    }
  }
}

The source meta value for each domain is different:

  • repl reports the immediate source: the configured source hostname as shown by SHOW REPLICA STATUS
  • repl.lag reports the heartbeat source: the source ID that wrote the heartbeat

These two are difference because of the multi-level replication topology: 02 is the immediate source of 03, but 01 is the heartbeat source.

This plugin sets repl.lag source meta value to the immediate source: 02.

See Integrate > Plugins to learn how to use plugins.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMeta

func CopyMeta(m *blip.Metrics) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL