Commit Graph

14 Commits

Author SHA1 Message Date
Bogdan Drutu e707d3a4fe
[chore] Fix test usage of featuregate where errors are not checked (#13214)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-06-16 18:19:09 +00:00
Bogdan Drutu 249e5d55ad
[pipeline] Dreprecate MustNewID and MustNewIDWithName (#12835)
Updates
https://github.com/open-telemetry/opentelemetry-collector/issues/12831

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-05-26 14:11:50 +00:00
Evan Bradley 8ebe098ef7
[service] Allow running the Collector without any pipelines (#12613)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds a feature gate that allows starting the Collector without running
any pipelines. This will mainly be used for OpAMP, where the Collector
may need to be started with only extensions
2025-03-17 12:39:03 +00:00
Evan Bradley 0ac887e6b7
[xconfmap] Create module and add validation facilities (#12226)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Builds on
https://github.com/open-telemetry/opentelemetry-collector/pull/12224 and
starts the move of config validation from component to confmap. We can
keep this in `xconfmap` while we determine whether to add the ability to
validate using struct field tags.

I think this has the following advantages:
1. Everything configuration-related is now in confmap instead of split
between confmap and component.
2. We can share things like the mapstructure tag and config key
separator as constants between unmarshaling and validation without
creating dependencies between confmap and component.

~The one uncertainty this creates is what to do with `component.Config`,
which would now be used as a thin alias for `any` without any meaningful
usage in component.~

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/11524
2025-02-04 22:25:59 +00:00
Evan Bradley 13470870db
[chore] Remove manual calls to `Validate` (#12224)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Follow-up to
https://github.com/open-telemetry/opentelemetry-collector/pull/12108.

This calls `component.ValidateConfig` on `otelcol.Config`, which causes
`Validate` to be recursively called on all eligible structs in the
config.

This has the following benefits:
1. `Validate` will now automatically be called instead of config structs
needing to call it on member structs.
2. Paths to the exact key that caused a validation error in the config
are now consistently printed.
3. If there are multiple errors in the config, they are now all returned
to the user instead of just the first error encountered.
2025-01-31 17:31:16 +00:00
Dmitrii Anoshin 9206c68ec2
Deprecate pipelineprofiles module in favor of xpipeline (#11888)
to allow adding more experimental data types.

Updates
https://github.com/open-telemetry/opentelemetry-collector/issues/11778
2024-12-13 23:23:06 +00:00
Matthieu MOREL 96e860b9cb
[chore]: enable gofumpt linter in receiver, scraper, semconv and service (#11856)
#### Description

[gofumpt](https://golangci-lint.run/usage/linters/#gofumpt) is a
stricter format than gofmt, while being backwards compatible.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-12-12 17:59:26 +00:00
Damien Mathieu 3456b432dd
Hide profiles behind a feature gate (#11477)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This hides profiles support behind a feature gate, so folks have to
enable them explicitly to be able to use them.
2024-10-17 08:46:04 -07:00
Bogdan Drutu c8005ec855
[chore] Pass the signal constant instead of the string (#11420)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-13 13:21:03 -07:00
Tyler Helmuth dfa6b6ee62
[component] Remove deprecated DataType (#11253)
#### Description

Continues the switch to use `pipeline.ID` and `pipeline.Signal`.
- Removes deprecated code
- Continues rename process for function/type changes.

#### Link to tracking issue
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/9429
2024-10-01 13:27:29 -07:00
Tyler Helmuth 77bb849aa0
[component] Refactor to use pipeline.ID and pipeline.Signal (#11204)
#### Description
Depends on
https://github.com/open-telemetry/opentelemetry-collector/pull/11209

This PR is a non-breaking implementation of
https://github.com/open-telemetry/opentelemetry-collector/pull/10947. It
adds a new module, `pipeline`, which houses a `pipeline.ID` and
`pipeline.Signal`. `pipeline.ID` is used to identify a pipeline within
the service. `pipeline.Signal` is uses to identify the signal associated
to a pipeline.

I do this work begrudgingly. As the PR shows, this is a huge refactor
when done in a non-breaking way, will require 3 full releases, and
doesn't benefit our [End Users or, in my opinion, our Component
Developers or Collector Library
Users](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md#target-audiences).
I view this refactor as a Nice-To-Have, not a requirement for Component
1.0.

<!-- Issue number if applicable -->
#### Link to tracking issue
Works towards
https://github.com/open-telemetry/opentelemetry-collector/issues/9429
2024-09-23 07:38:59 -07:00
Alex Boten fbffbb0820
[chore] small test improvements (#11211)
Clean up some inconsistencies in the test code across the components.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-18 13:47:25 -07: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
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