httpreceiver

package module
v1.51.0 Latest Latest
Warning

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

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

README

HTTP Receiver

This receiver is capable of collecting logs for a variety of services, serving as a default HTTP log receiver. Anything that is able to send JSON structured logs to an endpoint using HTTP will be able to utilize this receiver.

Minimum Agent Versions

Supported Pipelines

  • Logs

How It Works

  1. The user configures this receiver in a pipeline.
  2. The user configures a supported component to route telemetry from this receiver.

Prerequisites

  • The log source can be configured to send logs to an endpoint using HTTP
  • The logs sent by the log source are JSON structured

Configuration

Field Type Default Required Description
endpoint string true The hostname and port the receiver should listen on for logs being sent as HTTP POST requests.
path string false Specifies a path the receiver should be listening to for logs. Useful when the log source also sends other data to the endpoint, such as metrics.
tls.key_file string false Configure the receiver to use TLS.
tls.cert_file string false Configure the receiver to use TLS.
Example Configuration
receivers:
  http:
    endpoint: "localhost:12345"
    path: "/api/v2/logs"
exporters:
  googlecloud:
    project: my-gcp-project

service:
  pipelines:
    logs:
      receivers: [http]
      exporters: [googlecloud]
Example Configuration With TLS
receivers:
  http:
    endpoint: "0.0.0.0:12345"
    path: "/logs"
    tls:
      key_file: "certs/server.key"
      cert_file: "certs/server.crt"
exporters:
  googlecloud:
    project: my-gcp-project

service:
  pipelines:
    logs:
      receivers: [http]
      exporters: [googlecloud]

Documentation

Overview

Package httpreceiver is a default HTTP receiver for log ingestion

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a new factory for the HTTP receiver

Types

type Config

type Config struct {
	Path                    string `mapstructure:"path"`
	confighttp.ServerConfig `mapstructure:",squash"`
}

Config defines the configuration for an HTTP receiver

func (*Config) Validate

func (c *Config) Validate() error

Validate ensures an HTTP receiver config is correct

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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