/
doc.go
63 lines (62 loc) · 2.21 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Package config manages helpers to generate opentelemetry-collector configuration.
//
// Currently the Config struct is the overarching configuration that is generated and marshaled to a confmap
// to be used by the providers in the otel/collector package.
//
// type Config struct {
// Receivers telemetryComponents `mapstructure:"receivers"`
// Exporters telemetryComponents `mapstructure:"exporters"`
// Processors telemetryComponents `mapstructure:"processors"`
// Connectors telemetryComponents `mapstructure:"connectors"`
// Extensions telemetryComponents `mapstructure:"extensions"`
// Service service.Config `mapstructure:"service"`
// }
//
// First off we setup our extensions. Then we define our pipelines and from those definitions we
// can build pipeline configuration. The service config below shows how the Pipelines are defined in map of id -> pipeline. Each pipeline
// is just a list of receivers, exporters and processors that are dynamically built from that list.
//
// Ex: "hcpPipeline"->pipelineConfig of receivers, exporters, processors.
// /*
// // Service Configuration
// type Config struct {
// Telemetry telemetry.Config `mapstructure:"telemetry"`
// Extensions []component.ID `mapstructure:"extensions"`
// Pipelines map[component.ID]*PipelineConfig `mapstructure:"pipelines"`
// }
//
// type PipelineConfig struct {
// Receivers []component.ID `mapstructure:"receivers"`
// Processors []component.ID `mapstructure:"processors"`
// Exporters []component.ID `mapstructure:"exporters"`
// }
// */
//
// All of this is marshaled to a configuration that the otel collector sdk will run. The goal of this package is to help
// build a configuration that the marshaller will run with our defaults. We setup specific IDs for each pipeline
//
// /*
// receivers:
// otlp:
// protocols:
// http: {}
//
// processors:
// memory_limiter:
// check_interval: 1s
// limit_percentage: 50
// spike_limit_percentage: 30
// batch:
//
// exporters:
// logging: {}
//
// service:
// pipelines:
// traces:
// receivers: [otlp]
// exporters: [logging]
// */
package config