Commit Graph

21 Commits

Author SHA1 Message Date
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
Bogdan Drutu 9c7193555b
Add pipelines.Config to remove duplicate of the pipelines configuration (#7854)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-06-09 12:29:22 -07:00
Bogdan Drutu 2a7c92e6c2
[chore] use extensions.Config when refer to the serivce::extensions (#7853)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-06-07 16:57:09 -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 a2f0153679
[chore] replace the usage of interface{} with any (#7053)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-01-30 15:01:25 -08:00
Bogdan Drutu cfa49fca08 Improve service Config types name (#6787)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-15 10:38:44 -08:00
Bogdan Drutu 7ee940d53d
Remove deprecated service.Config (#6774)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-13 09:54:45 -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 fb0842a5a2
Improve config error messages, split Validate functionality (#6665)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-02 07:51:41 -08:00
Bogdan Drutu 1028e3d2a2
Deprecate special Configs for each component type, use a standard opaque Config (#6617)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-23 15:02:54 -08:00
Daniel Jaglowski c2055955c4
[pipelines] Change test to not reuse same processor twice in one pipeline (#6540)
* [pipelines] Change test to not reuse same processor twice in one pipeline

* Add note to documentation about reuse of processors within a pipeline

* can -> MUST
2022-11-17 07:59:58 -08:00
Bogdan Drutu 3899d3e73c
add validation for empty telemetry metric address when level not none (#5661) 2022-11-07 08:40:40 -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
Ziqi Zhao 445927208d add validation for empty telemetry metric address when metric level is not none
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
2022-10-28 14:49:23 +08:00
Bogdan Drutu 3262fd8f8b
Remove already deprecates config.Config (#6394)
* Remove already deprecates config.Config

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

* Update service/internal/configunmarshaler/defaultunmarshaler.go

Co-authored-by: Alex Boten <alex@boten.ca>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
Co-authored-by: Alex Boten <alex@boten.ca>
2022-10-26 15:01:35 -07:00
Bogdan Drutu 2118622701
[chore] move service pipeline id validation to main config Validate (#6281)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-10-12 15:56:53 -07:00
Bogdan Drutu 62d41a8ac4
[chore] use proper velidate error instead of a hacky way (#5916)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-23 10:40:33 -07:00
Bogdan Drutu de51f9e800
Remove deprecated funcs/types from service related to Config (#5755)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-07-26 17:26:02 -07:00
Bogdan Drutu d63aea3c5b
Fix initialization of the MetricProvider (#5571)
The problem was that the MetricProvider is initialized into the "service.telemetry.MetricProvider" after components were created. This change was not a trivial change because the process telemetry initialization requires the ballast size, which is available after the extensions are initialized, because of that I split the initialization of the MetricProvider/oc.Registry from the initialization of the process telemetry.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-06-29 05:54:47 -07:00
Bogdan Drutu f1ba384452
Move config tests to service to avoid using deprecated config types (#5466)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-06-08 12:39:03 -07:00