Commit Graph

58 Commits

Author SHA1 Message Date
Jade Guiton 6c2697c445
[exporterhelper] Rename Timeout/QueueSettings to Config (#11132)
#### Description

This PR renames `TimeoutSettings` and `QueueSettings` (as well as the
corresponding `NewDefault` functions) to `TimeoutConfig` and
`QueueConfig`, for naming consistency reasons.

The previous struct/function names are kept as deprecated aliases of the
new ones for now.

#### Link to tracking issue

Updates #6767  (edit: reworded by @mx-psi)

#### Testing

No behavior changes were made, so no additional testing should be
necessary.

The references to the aforementioned structs/functions in existing tests
have been renamed as well. This means the deprecated function aliases
are not tested, lowering the coverage a bit.

#### Documentation

The new functions are documented identically to the previous ones.
2024-09-11 18:27:12 +02:00
Sindy Li d2ed276a92
Enable batch sender in oltpexporter (#10846)
#### Description

This PR adds opt-in support to oltp exporter for the experimental batch
sender
(https://github.com/open-telemetry/opentelemetry-collector/issues/8122).
By default batch sender is not enabled.

Similar:
*
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34238
*
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32563

#### Link to tracking issue

Resolves
https://github.com/open-telemetry/opentelemetry-collector/issues/10834

#### Testing

`exporter/otlpexporter/config_test.go`

#### Documentation

Updated the `oltpexporter` README to point to `exporterhelper` README
for batching.

---------

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2024-08-16 19:46:40 -07:00
Alex Boten fd36d05133
[otlpexporter] support validation for dns:// and dns:/// (#10450)
This allows users to continue using the recommended
dns://authority/host:port notation when needing to specify a custom
authority.
    
Fixes #10449

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
2024-07-01 09:04:13 -07: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
Juraci Paixão Kröhling bb48107f42
[exporter/otlp] Allow DNS scheme to be used in endpoint (#10010)
Fixes #4274

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
2024-04-22 08:28:45 -07:00
Ben Mask 8dd42ec373
[otlp exporter] Validate exporter endpoint has port (#9632)
**Description:** This PR updates the otlp exporter config validation to
ensure that the "endpoint" specified for the exporter includes a port.
The goal of this is to fail fast if the configuration is invalid instead
of waiting for an error to arise. The PR adds a function to the
ClientConfig defined in configgrpc that parses the port defined in the
endpoint. The otlp exporter uses this port parsing to validate that

**Link to tracking Issue:** [Issue
9505](https://github.com/open-telemetry/opentelemetry-collector/issues/9505)
2024-03-27 14:57:37 -07: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 7f138124ec
[configgrpc] Deprecate SanitizedEndpoint (#9788)
**Description:** <Describe what has changed.>
Deprecates `configgrpc.SanitizedEndpoint()`.

**Link to tracking Issue:** <Issue number if applicable>
Works towards:
https://github.com/open-telemetry/opentelemetry-collector/issues/9482
2024-03-19 11:45:01 +01:00
molejnik88 d9e00e0bc0
[config/configtls] Validate MinVersion and MaxVersion (#9664)
**Description:**
Add `Validate()` method to `TLSSetting` and validate tls `min_version`
and `max_version`.

**Link to tracking Issue:** 
#9475
2024-03-07 14:20:26 -08: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
Antoine Toulme de6287de83
[otlpexporter] Validate the configuration explicitly (#9523)
**Description:**
Use `Config.Validate` to validate the presence of the gRPC endpoint
instead of making an assertion at creation time.
2024-02-09 08:24:36 -08:00
Pablo Baeyens 26c157e3bf
[component] Add MustNewType constructor for component.Type (#9414)
**Description:** 

- Adds `component.MustNewType` to create a type. This function panics if
the type has invalid characters. Add similar functions
`component.MustNewID` and `component.MustNewIDWithName`.
- Adds `component.Type.String` to recover the string
- Use `component.MustNewType`, `component.MustNewID`,
`component.MustNewIDWithName` and `component.Type.String` everywhere in
this codebase. To do this I changed `component.Type` into an opaque
struct and checked for compile-time errors.

Some notes:

1. All components currently on core and contrib follow this rule. This
is still breaking for other components.
2. A future PR will change this into a struct, to actually validate this
(right now you can just do `component.Type("anything")` to bypass
validation). I want to do this in two steps to avoid breaking contrib
tests: we first introduce this function, and after that we change into a
struct.

**Link to tracking Issue:** Updates #9208
2024-02-02 17:33:03 +01:00
Antoine Toulme 366573219e
[configgrpc] Deprecate GRPCClientSettings, use ClientConfig instead (#9402)
**Description:**
Deprecate GRPCClientSettings, use ClientConfig instead

**Link to tracking Issue:**
#6767
2024-02-01 16:08:58 -08:00
Bogdan Drutu 6b12cc3203
Deprecate exporterhelper.RetrySettings in favor of configretry.BackOffConfig (#9091)
Depends on
https://github.com/open-telemetry/opentelemetry-collector/pull/9089

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-12-14 21:31:20 -08: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
Gabriel Santos cdc9e15b2d
Allow configuration of fields, RandomizationFactor and Multiplier, for `retry_on_failure` (#7017)
* Allow configuration of fields, RandomizationFactor and Multiplier, for
`retry_on_failure`

* changelog entry
2023-01-27 15:37:35 -08:00
Pablo Baeyens d97f1eb5bf
[configgrpc] Change Headers field type to have opaque values (#6853)
* [configgrpc] Change Headers field type to have opaque values

* Add changelog entry
2023-01-20 10:29:39 -08: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 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 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
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
Hyunuk Lim afba043e72
Refactor configgrpc for compression methods (#4624)
* fix: refactored configgrpc and tests

* fix: dealt with zlib and deflate and add tests

* chore: add changelog

* fix: make getGRPCCompressionName private
2022-01-04 11:21:10 -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
Bogdan Drutu 108a49ec44
Use directly the ComponentID in configauth (#4238)
Depends on https://github.com/open-telemetry/opentelemetry-collector/pull/4237

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-10-22 08:35:38 -07:00
alrex 028fc46e66
Revert "Make TLSClient config to pointer type (#4104)" (#4196)
This reverts commit ebb0fbd6f2.
2021-10-13 11:31:58 -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
Min Xia ebb0fbd6f2
Make TLSClient config to pointer type (#4104)
Change TLSClient config to pointer type in `confighttp` and `configgrpc` config

**Related Issue**
https://github.com/open-telemetry/opentelemetry-collector/issues/4028
https://github.com/open-telemetry/opentelemetry-collector/pull/4063#discussion_r711974463
2021-09-27 15:30:05 -04:00
Bogdan Drutu 20ac40ae3c
Remove already moved extensions to contrib (#3883)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-08-24 13:06:52 -07:00
Pavan Krishna 5369d7e9e8
Updated configgrpc ToDialOptions and confighttp ToClient apis to take extensions configuration map (#3340)
This PR is a port of the configfrpc's ToDialOptions() and confighttp ToClient() from PR #3128  in a piece meal fashion. 

The following are the changes
- Refactored configgrpc.PerRPCAuth as extension implementing configauth.GrpcClientAuthenticator
- Plugged in extensions configuration to all the grpc based clients in the core (OTLP, OpenCensus, Jaeger, JaegerReceiver)
- Plugged in extensions configuration to all the HTTP based clients in the core (Zipkin, OTLPHTTP)

Link to tracking Issue:
 #3282 #3276

Testing:
Unit tests, [manual test described (for only oidc)](#3128 (comment))
2021-06-03 14:23:16 -04: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
Pavan Krishna a817b0f5a7
Refactor otlp exporter to upcoming auth changes (#3288)
* refactor otlp exporter to upcoming auth changes

* addressed review comments

* addressed review comments

* addressed review comments

* addressed review comments

* added suggestion from the review

* added suggestion from the review

* added suggestion from the review
2021-05-24 18:50:41 -07:00
Bogdan Drutu 86ea0a131f
Revert PR#3128 (#3276)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-24 13:19:35 -07:00
Pavan Krishna af711825a8
Support for Custom Exporter Authenticators as Extensions (#3128)
This PR adds support to add client side (exporter) authenticators for HTTP and gRPC clients through extension based authenticators. This is built of top of what was added  for receiver (server) side authenticators via extensions in #2603 

**Link to tracking Issue:** #3115

**Testing:** 
- Did a manual testing for static bearer token.
- Added unit tests
2021-05-20 13:46:40 -04:00
Bogdan Drutu e54cbb44df
Use config.ID for Exporters config (#3084)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-04 08:09:37 -07:00
Bogdan Drutu 1edaf40ced
Add New funcs for extension, exporter, processor config settings (#2872)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-31 16:50:05 -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
Jay Camp 1e65674799
Update copyright (#1597)
* Update copyright

* rebase
2020-08-19 18:25:44 -07:00
Bogdan Drutu 6a3557268a
Use enabled for queue and retry. More human readable (#1433)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-27 06:48:30 -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 4046234701
Add support for queued retry in the exporter helper. (#1386)
* Add support for queued retry in the exporter helper.

Changed only the OTLP exporter for the moment to use the new settings.

Timeout is enabled for all the exporters. Fixes #1193

There are some missing features that will be added in a followup PR:
1. Enforcing errors. For the moment added the Throttle error as a hack to keep backwards compatibility with OTLP.
2. Enable queued and retry for all exporters.
3. Fix observability metrics for the case when requests are dropped because the queue is full.

* First round of comments addressed
2020-07-17 14:07:03 -07:00
Bogdan Drutu 9a08d4de4a
Add helper exporter factory to reduce boilerplate (#1351)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-16 18:18:28 -07:00
Rashmi a509d72a24
Added round_robin balancer as an option to gRPC client settings (#1353)
* Added round_robin balancer as an option to gRPC client settings

* Added documentation changes`

* Changed the balancerName setting from bool to string to accomodate new balancers in future

Setting invalid balancer is panicking. Hence validated the same & thrown an error

* Fixed test

* Fixed tests

* Replaced grpc.WithBalancerName with grpc.WithDefaultServiceConfig

* Validated the balancerName using a var string array instead of error control flow

* Fixed lint errors

* Fixed lint errors

* typo fix in documentation
2020-07-15 12:24:11 -07:00
Juraci Paixão Kröhling 71392e5d54
Added PerRPCCredentials for gRPC settings (#1250)
* Added PerRPCCredentials for gRPC settings

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Changes based on the reviews

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Fixed per-RPC auth type in error message

Co-authored-by: Paulo Janotti <pjanotti@splunk.com>

* Removed support for reading bearer token from file

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
2020-07-14 22:06:17 -07:00
Bogdan Drutu df0ca7ec95
Cleanup OTLP config and readme (#1217)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-29 08:02:48 -07:00
Bogdan Drutu f06d74d139
Allow to tune the read/write buffers for gRPC clients (#1213)
* Allow to tune the read/write buffers for gRPC clients

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

* Increase the memory size since we increased the write buffer size

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-26 16:31:39 -07:00