Commit Graph

56 Commits

Author SHA1 Message Date
Antoine Toulme 2449345456
[chore] update to mapstructure 2.0.0 (#10610)
#### Description
Reprises
https://github.com/open-telemetry/opentelemetry-collector/pull/10300

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Fixed a few tests that no longer make sense. One test will conflict if
https://github.com/open-telemetry/opentelemetry-collector/pull/10609 is
merged first.
2024-07-19 10:20:55 +02:00
Pablo Baeyens fead8fc530
[receiver/otlp] Promote `component.UseLocalHostAsDefaultHost` to beta (#10352)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number if applicable -->

Promotes `component.UseLocalHostAsDefaultHost` feature gate to beta.

#### Link to tracking issue

Updates #8510
2024-06-27 18:54:01 +02:00
Antoine Toulme 9a21643a54
[config] Deprecate component.UnmarshalConfig (#9750)
**Description:**
This PR removes the top level if/else in `component.UnmarshalConfig`,
handling recursive state in the confmap.Conf object instead.
This PR deprecates `component.UnmarshalConfig` in favor of calling
directly `Unmarshal` on the confmap.Conf object.

**Link to tracking Issue:**
Fixes #7102
Fixes #7101

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
2024-05-29 11:07:52 +02:00
Tyler Helmuth 1038b67c85
[configtls] Removed deprecated structs (#9786)
**Description:** <Describe what has changed.>
Removed deprecated structs

**Link to tracking Issue:** <Issue number if applicable>
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/9428
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/9474
Closes
https://github.com/open-telemetry/opentelemetry-collector/issues/9548
2024-03-27 19:14:07 +01:00
Tyler Helmuth e70b5ab377
[confignet] Change `Transport` from `string` to `TransportType` (#9385)
**Description:** 
Changes `Transport` from a `string` to a new `TransportType`. Implements
`UnmarshalText` for `TransportType` to enforce values.

This PR may be too much - it introduces a breaking change a lot of new
public APIs that may not be worth it for such a small module. If we
don't like the surface area this creates or the breaking change, but we
still want to enforce transport type values, I think implementing
`Validate` keeps the API footprint smaller and isn't breaking.

**Link to tracking Issue:** <Issue number if applicable>

Closes
https://github.com/open-telemetry/opentelemetry-collector/issues/9364

**Documentation:** <Describe the documentation added.>

Added godoc comments

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
2024-03-15 13:06:21 +01:00
Arjun Mahishi 9a83b0aa44
[configtls] Rename config structs for consistency (#9495)
**Description:** 
Simply renames a few structs in the `configtls` package for consistence.

`TLSClientSetting` to `ClientConfig`
`TLSServerSetting` to `ServerConfig`
`TLSSetting` to `Config`

**Link to tracking Issue:** Fixes #9474
2024-02-28 20:57:43 -08:00
Pablo Baeyens 5cfc68fc27
[confignet] Rename NetAddr and TCPAddr to follow conventions (#9529)
**Description:** 

Rename types in `confignet` to adapt to conventions (avoid stuttering
and end in `Config`)

**Link to tracking Issue:** Updates #9509
2024-02-13 10:45:58 -08:00
Dmitrii Anoshin 7abb962231
[chore] Update httpconfig API to not include HTTP prefix (#9453)
Following discussion
https://github.com/open-telemetry/opentelemetry-collector/pull/9403#discussion_r1471644409
2024-02-02 09:06:12 -08:00
Antoine Toulme 421c655efe
[configgrpc] Deprecate GRPCServerSettings, use ServerConfig instead (#9403)
**Description:**
Deprecate GRPCServerSettings, use ~GRPC~ServerConfig instead

**Link to tracking Issue:**
#6767
2024-02-01 13:45:36 -08:00
Antoine Toulme 8b95295f0c
[confighttp] Deprecate HTTPServerSettings, use HTTPServerConfig instead (#9405)
**Description:**
Deprecate HTTPServerSettings, use HTTPServerConfig instead

**Link to tracking Issue:**
#6767
2024-01-26 10:22:05 -08:00
Antoine Toulme 9082cb16c1
[config/confighttp] Deprecate CORSSettings, use CORSConfig instead (#9392)
**Description:**
Deprecate CORSSettings, use CORSConfig instead

**Link to tracking Issue:**
#6767
2024-01-25 21:04:38 -08:00
Luiz Henrique Pegoraro 56ed34318d
[receiver/otlp] Export HTTPConfig (#8176)
**Description:** Make the configuration for the OTLP Receiver
httpServerSettings to be public
Fixing the bug opened  #8175 

**Link to tracking Issue:**#8175

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2023-08-15 11:08:33 -07:00
Fred Thomsen 5f1144308b
Add path prefix for otlp http receiver (#7570)
Supports multiple otlp http receivers running behind a reverse
proxy/ingress.

Fixes #7511 

Updated existing tests to account for new parameter.
2023-07-21 13:50:12 -07:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <aboten@lightstep.com>

* make goporto

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-18 13:11:17 -07:00
Bogdan Drutu 7cb2d7622d
Remove deprecated comonent.Config.[ID|SetIDName]; Deprecate config.*Settings (#6718)
* Remove deprecated comonent.Config.[ID|SetIDName]; Deprecate config.*Settings

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update .chloggen/rmcfgid-1.yaml

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
2022-12-12 14:35:45 -08:00
Bogdan Drutu 30c9c7154b
Deprecate Unmarshal[*]Config in favor of UnmarshalConfig (#6613)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-23 10:15:39 -08:00
Bogdan Drutu 86d886cdc7
Deprecate Config.Validate() in favor of component.ValidateConfig (#6572)
* Deprecate Config.Validate() in favor of component.ValidateConfig

This PR is "split" from https://github.com/open-telemetry/opentelemetry-collector/pull/6544, to avoid breaking changes and go via deprecation.

It is a bit hacky, but better than breaking everyone who uses this interface.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update config/receiver.go

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2022-11-17 13:50:30 -08:00
Bogdan fbf1e2a09c Revert changes to config.[Receiver|Processor|Exporter|Extension]Settings
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-11-05 10:04:50 -07:00
Bogdan d6ed8246b6 Deprecate all types and funcs in config package
The main reason is to remove the circular dependency between the config (including sub-packages) and component. Here is the current state:
* component depends on config
* config/sub-package[grpc, http, etc.] depends on config & component

Because of this "circular" dependency, we cannot split for example "config" into its own module, only if all the other config sub-packages are also split.

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-11-05 10:04:49 -07:00
Bogdan Drutu 7fa47b4927
Remove impossible conditions from Unmarshaler, and validation from Unmarshal (#6284)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-10-20 13:42:50 -07:00
Bogdan Drutu f64389d15f
[chore] change config tests to unmarshal only the config for that component (#5895)
The main motivation for this is to allow components (including tests) to not depend on the "service" configuration and be reusable without the otelcol service.

Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-11 06:57:13 -07:00
Pablo Baeyens 2851998017
[receiver/otlp] Add two edge testcases for YAML configuration (#5236) 2022-04-20 09:38:55 -07:00
Shree Prakash 0e02722729
Otel-4633 Replace path.Join method with filepath.Join method (#4638)
* Otel-4633 Replace path.Join method with filepath.Join method

* Otel-4633 Replace path.Join method with filepath.Join method
2022-01-05 11:08:42 -08:00
Bogdan Drutu 7de98eb669
Move test funcs that load entire config to servicetest (#4606)
Updates https://github.com/open-telemetry/opentelemetry-collector/issues/4605

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-12-21 15:11:40 -08:00
Lyra Naeseth fb1539f7e5
Support CORS Max-Age on OTLP/HTTP receiver (#4492)
* Support CORS Max-Age on oltphttp receiver

* Encapsulate CORS config in its own struct

* Update changelog

* Fixes to CORS docs

* Use CORSSettings in TestHttpCors

* Clarify behavior when cors.max_age is unset

* Move changelog updates to the unreleased section
2021-12-08 10:16:04 -08:00
Bogdan Drutu 61d3a34fbc
Small nits in default config unmarshaler (#4355)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-04 09:55:08 -07:00
alrex afad36e378
rename NewIDWithName -> NewComponentIDWithName (#4151) 2021-09-29 17:09:17 -07:00
James 85b8094e26
Rename `config.NewID` to `config.NewComponentID` and `config.NewIDFromString` to `config.NewComponentIDFromString` (#4137)
This PR is to rename `config.NewID` to `config.NewComponentID` and `config.NewIDFromString` to `config.NewComponentIDFromString` for naming consistency.  

**Link to tracking Issue:** 
Fixes #4105
2021-09-29 10:28:07 -04:00
Tigran Najaryan 3218d8a33d
Change default OTLP/HTTP port number (#3743)
This implements specification change https://github.com/open-telemetry/opentelemetry-specification/pull/1839

To make transition to new port numbers less painful OTLP receiver will
also accept data on the legacy port numbers when it is configured to
use the default endpoint. Users who use the default Collector config
can continue sending data to the legacy ports and have a graceful period
to update their senders to start sending to the new ports.
2021-08-03 13:52:45 +04:00
Ryan Fitzpatrick e035ad166c
Replace Viper with Koanf to add map case sensitivity (#3337) 2021-06-13 23:20:14 -07:00
Bogdan Drutu ba91818866
Rename configtest.LoadConfigFile to configtest.LoadConfigAndValidate (#3306)
Add a new configtest.LoadConfig to simplify testing errors on Validate.

Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com
2021-05-28 11:48:26 -04:00
Bogdan Drutu faa78aa7f6
Use config.ComponentID for Receivers config (#2870)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-30 16:29:10 -07:00
Pablo Baeyens 671bf0a4bb
Move some unmarshaling errors to the Validate method (#2929)
* Move some unmarshaling errors to the Validate method

* Empty commit to retrigger CI
2021-04-14 12:49:15 -07:00
Bogdan Drutu e7c74eb2fd
Move configmodels to config (#2808)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-26 12:14:35 -07:00
Bogdan Drutu c4cf7ebef3
Add new clean nop components and use them in config tests (#2655)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-10 10:45:18 -08:00
Przemek Maciolek 07a0face4b
Add cors_allowed_headers option to confighttp (#2454)
* Add cors_allowed_headers option to confighttp

* Enable CORS only when origin is defined

* Remove WithLogger option

The capability is out of scope of the PR
2021-02-22 10:50:24 -08:00
Tigran Najaryan 29859f2053
Change default OTLP/gRPC port number (#2104)
This implements specification change https://github.com/open-telemetry/opentelemetry-specification/pull/1221

To make transition to new port numbers less painful OTLP receiver will
also accept data on the legacy port numbers when it is configured to
use the default endpoint. Users who use the default Collector config
can continue sending data to the legacy ports and have a graceful period
to update their senders to start sending to the new ports.

Note that OTLP/HTTP continues using a separate port number from OTLP/gRPC.
There is separate work in progress to use one port for both.
2020-11-19 09:14:18 -08:00
Jay Camp 1e65674799
Update copyright (#1597)
* Update copyright

* rebase
2020-08-19 18:25:44 -07:00
Bogdan Drutu f954863531
Improve error messages coming from config. Code is not useful for humans. (#1460)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-29 18:29:08 -07:00
Bogdan Drutu 2b3744a7f8
Move test LoadConfigFile to configtest (#1421)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-23 15:18:35 -07:00
Bogdan Drutu 2c3bca6dca
Move example factories to componenttest (#1300)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-22 14:08:41 -07:00
Bogdan Drutu 2195bbc09d
Add helper component to reduce boilerplate (#1334)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-13 21:32:06 -07:00
Bogdan Drutu d46ce1e149
Add unix socket support for gRPC server settings (#1242)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-01 06:51:45 -07:00
Bogdan Drutu 28d10c8de5
Use tls_settings consistently between gRPC and HTTP (#1233)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-30 10:57:27 -07:00
Bogdan Drutu 144127fb44
Split OTLP receiver by protocols, allow mTLS support (#1223)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-29 13:39:49 -07:00
Bogdan Drutu 7ef6c533d4
Allow to tune the read/write buffers for gRPC server (#1218) 2020-06-29 12:34:01 -04:00
Bogdan Drutu 99d6040c4f
Do not embed ProtocolSettings in gRPC (#1210)
Adding `ProtocolServerSettings` was a bit of a rush. We determined that `endpoint` has different meaning based on protocol, also not all the protocols support TLS.

In this PR we revert embedding `ProtocolServerSettings` in the GRPCServerSettings and make it consistent with HttpServerSettings.

Work left: Consistent config name for TLS settings `tls_settings` or `tls_credentials`.
2020-06-26 16:10:51 -04:00
Bogdan Drutu 5211772652
Add a generic grpc server settings config, cleanup client config (#1183)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-25 16:37:30 -07:00
Bogdan Drutu cddc04f027
Add protocol server settings and remove endpoint from ReceiverSettings (#1172)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-24 12:59:05 -07:00
Steve Flanders 3c93591492
Switch from localhost to 0.0.0.0 by default for all receivers (#1006)
Switch from localhost to 0.0.0.0 by default

Link to tracking Issue: Addresses #592
2020-06-10 14:57:56 -04:00