integrations

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Integrations

func Integrations(logs map[string]map[string]*pipelines.LogStats, Shipper exporter.Shipper)

Integrations iterates through configured external services to send aggregated log data via HTTP POST requests.

Parameters:

  • logs: map containing log statistics grouped by source and message.

  • Shipper: an interface of type exporter.Shipper used to format the data before sending.

The function performs:

  • Initializes an http.Client with a 10-second timeout.

  • Iterates through the 'options.Config.Integrations' slice.

  • For each integration, checks if 'OnAggregation' is enabled:

    -Calls Shipper.PrepareShip(logs) to get the formatted log data.

    -Creates a new HTTP POST request to the integration's URL using the encoded data.

    -Populates the request headers with the specific headers defined in the integration config.

    -Sets a custom 'User-Agent' header using the build information (goxe/version).

    -Executes the HTTP request using the client.

  • If an error occurs during data transformation, request creation, or execution, logs the error and continues with the next integration.

  • Upon successful execution, prints the HTTP status response to the console.

  • Ensures the response body is closed to prevent resource leaks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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