fileintegrationextension

package module
v0.0.0-...-9b23849 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

Extension to provide integrations from local files

Status
Stability development
Distributions []
Issues Open issues Closed issues
Code coverage codecov
Code Owners @jsoriano

This extension allows to provide integrations installed on local files. These integrations can be then used with other components such as the integration receiver or the integration processor.

Configuration

path

Path to the directory containing integrations. Other components can use the name of each file, without extension, to reference them as integrations.

Example

Integrations are defined in YAML format, with a structure similar to the collector configuration. They can define receivers, processors, and pipelines.

For example the following integration would define a logs receiver based on the filelog receiver and the transform processor:

receivers:
  filelog:
    include: ${var:paths}
    start_at: beginning

processors:
  transform/resource:
    log_statements:
      - set(log.attributes["resource"], "${var:resource}")

pipelines:
  logs:
    receiver: filelog
    processors:
      - transform/resource

If this template would be installed for example in the /etc/opentelemetry/integrations/somelog.yaml file, it could be used with the following configuration, that creates two pipelines, one uses the integration as receiver, and another one uses it as a processor.

extensions:
  file_integrations:
    path: "/etc/opentelemetry/integrations"

receivers:
  integration:
    name: "somelog"
    pipelines: "logs"
    parameters:
      paths: "/var/log/somelog-*.log"
      resource: "example"

  filelog:
    include: "/var/log/otherlog-*.log"

processors:
  integration:
    name: "somelog"
    pipelines: "logs"
    parameters:
      resource: "other"

exporters: ...

service:
  extensions: [file_integrations]
  pipelines:
    logs/somelog:
      receivers: [integration]
      exporters: ...
    logs/otherlog:
      receivers: [filelog]
      processors: [integration]
      exporters: ...

Documentation

Overview

Package fileintegrationextension provides a source of integrations that obtain them from a local directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() extension.Factory

NewFactory creates a factory for ack extension.

Types

type Config

type Config struct {
	// Path is the directory containing integrations.
	Path string `mapstructure:"path"`
}

Config is the structured configuration of the extension.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration, it checks that the path is defined and is the path to a directory.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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