Influx

Description

This plugin enables you to send data to an InfluxDB in a pipeline.

Source Code: https://github.com/go-vela/vela-influx

Registry: https://hub.docker.com/r/target/vela-influx

Usage

NOTE:

Users should refrain from using latest as the tag for the Docker image.

It is recommended to use a semantically versioned tag instead.

Sample of emitting a pass/fail build metric:

steps:
  - name: write
    image: target/vela-influx:latest
    pull: always
    parameters:
      addr: https://influx.example.com
      database: vela
      name: build_report
      fields:
        build_status: ${VELA_BUILD_STATUS}

Sample of emitting a pass/fail build metric with custom tags:

steps:
  - name: write
    image: target/vela-influx:latest
    pull: always
    parameters:
      addr: https://influx.example.com
      database: vela
      name: build_report
      fields:
        build_status: ${BUILD_STATUS}
+     tags:
+       repo_name: ${VELA_REPO_FULL_NAME}
+       build_number: "${VELA_BUILD_NUMBER}"

Secrets

NOTE: Users should refrain from configuring sensitive information in your pipeline in plain text.

Internal

The plugin accepts the following parameters for authentication:

ParameterEnvironment Variable Configuration
passwordPARAMETER_PASSWORD, INFLUX_PASSWORD
usernamePARAMETER_USERNAME, INFLUX_USERNAME

Users can use Vela internal secrets to substitute these sensitive values at runtime:

steps:
  - name: write
    image: target/vela-influx:latest
    pull: always
+   secrets: [ influx_username, influx_password ]
    parameters:
-     username: superSecretUsername
-     password: superSecretPassword
      addr: https://influx.example.com
      database: vela
      name: build_report
      fields:
        build_status: ${VELA_BUILD_STATUS}

This example will add the secret to the trigger_hello-world step as environment variables:

  • DOWNSTREAM_TOKEN=<value>

External

The plugin accepts the following files for authentication:

ParameterVolume Configuration
password/vela/parameters/influx/password, /vela/secrets/influx/password
username/vela/parameters/influx/username, /vela/secrets/influx/username

Users can use Vela external secrets to substitute these sensitive values at runtime:

steps:
  - name: write
    image: target/vela-influx:latest
    pull: always
    parameters:
-     username: superSecretUsername
-     password: superSecretPassword
      addr: https://influx.example.com
      database: vela
      name: build_report
      fields:
        build_status: ${VELA_BUILD_STATUS}

This example will read the secret value in the volume stored at /vela/secrets/

Parameters

NOTE:

The plugin supports reading all parameters via environment variables or files.

Any values set from a file take precedence over values set from the environment.

The following parameters are used to configure the image:

NameDescriptionRequiredDefaultEnvironment Variables
addrInflux instance to communicate withtrueN/APARAMETER_ADDR
INFLUX_ADDR
databasedatabase name on Influx instance to communicate withtrueN/APARAMETER_DATABASE
INFLUX_DATABASE
fieldsdata fields to send along with the metrictrueN/APARAMETER_FIELDS
INFLUX_FIELDS
log_levelset the log level for the plugintrueinfoPARAMETER_LOG_LEVEL
INFLUX_LOG_LEVEL
namename of metric sent to database on Influx instancetruebuild_metricsPARAMETER_NAME
INFLUX_NAME
passwordpassword for communication with InfluxfalseN/APARAMETER_PASSWORD
INFLUX_PASSWORD
tagsextra metadata to send along with the metricfalseN/APARAMETER_TAGS
INFLUX_TAGS
usernameuser name for communication with InfluxfalseN/APARAMETER_USERNAME
INFLUX_USERNAME

Template

COMING SOON!

Troubleshooting

You can start troubleshooting this plugin by tuning the level of logs being displayed:

steps:
  - name: write
    image: target/vela-influx:latest
    pull: always
    parameters:
+     log_level: trace
      addr: https://influx.example.com
      database: vela
      name: build_report
      fields:
        build_status: ${VELA_BUILD_STATUS}

Below are a list of common problems and how to solve them: