converter

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package converter exposes utilities to convert config files from other programs to Grafana Alloy configurations.

Index

Constants

This section is empty.

Variables

Functions

func Convert

func Convert(in []byte, kind Input, extraArgs []string) ([]byte, diag.Diagnostics)

Convert generates a Grafana Alloy config given an input configuration file.

extraArgs are supported to be passed along to a converter such as enabling integrations-next for the static converter. Converters that do not support extraArgs will return a critical severity diagnostic if any are passed.

Conversions are made as literally as possible, so the resulting config files may be unoptimized (i.e., lacking component reuse). A converted config file should just be the starting point rather than the final destination.

Note that not all functionality defined in the input configuration may have an equivalent in Grafana Alloy. If the conversion could not complete because of mismatched functionality, an error is returned with no resulting config. If the conversion completed successfully but generated warnings, an error is returned alongside the resulting config.

Types

type Input

type Input string

Input represents the type of config file being fed into the converter.

const (
	// InputOtelCol indicates that the input file is an OpenTelemetry Collector YAML file.
	InputOtelCol Input = "otelcol"
	// InputPrometheus indicates that the input file is a prometheus YAML file.
	InputPrometheus Input = "prometheus"
	// InputPromtail indicates that the input file is a promtail YAML file.
	InputPromtail Input = "promtail"
	// InputStatic indicates that the input file is a grafana agent static YAML file.
	InputStatic Input = "static"
)

Directories

Path Synopsis
Package diag exposes error types used throughout converter and a method to pretty-print them to the screen.
Package diag exposes error types used throughout converter and a method to pretty-print them to the screen.
internal

Jump to

Keyboard shortcuts

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