Commit Graph

20 Commits

Author SHA1 Message Date
Roger Coll b288271b77
[componentstatus] Add attributes map to Event (#13348)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds a `pcommon.Map` to the Event struct to represent additional
metadata from the producer. These attributes can be interpreted by
consumers, such as `Watcher` implementations like the healthcheckv2
extension.

Since the long-term goal is to replace Event with a pdata.Log
(OpenTelemetry Event), introducing attributes serves as an intermediary
step. This allows for experimentation with subcomponents and more
fine-grained events without immediately committing to a full migration.

It extends the `NewEvent` constructor in a backward compatible approach
with a new optional `...EventBuilderOption` parameter. The
EventBuilderOption is a sealed interface which is implemented with new
methods like `WithAttributes`.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #
https://github.com/open-telemetry/opentelemetry-collector/issues/13210

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Constructor unit tests, calls to generate Events from the internal graph
have not been modified.

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
2025-08-07 09:02:36 +00:00
Paulo Janotti c9e3f4037f
[chore] Fix Test_ComponentStatusReporting_SharedInstance (#11806)
#### Description
Fix
[#17574](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/17574)
- The [state
table](d0f5bda31d/service/internal/status/status.go (L50-L82))
shows that it is possible to not reach the `StatusOK` state. Setting the
expected states accordingly.


#### Link to tracking issue

[#17574](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/17574)

#### Testing

Run test thousands of times on a Windows box without issues.
2024-12-05 17:33:43 +00:00
Bogdan Drutu 65dcab1568
[chore] Remove unused parameter for sharedcomponent (#11439)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-14 15:36:22 -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
Bogdan Drutu 9701538c89
Deprecate funcs that repeate extension in name (#11413)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-10 16:10:02 -07:00
Tyler Helmuth e69f2f38ff
[componentstatus] Continue DataType rename (#11313)
#### Description
Continues the DataType rename process for
`NewInstanceIDWithPipelineIDs`, `AllPipelineIDsWithPipelineIDs`, and
`WithPipelineIDs`.

#### Link to tracking issue
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/9429
2024-10-01 17:27:59 +02:00
Tyler Helmuth 8ced6eb6e1
[service] Remove deprecations and continue renames around DataType (#11303)
#### Description

Continues deprecation/rename processor for
`Config.PipelinesWithPipelineID`, `pipelines.ConfigWithPipelineID` and
`GetExportersWithSignal`.


#### Link to tracking issue
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/9429
2024-09-30 11:31:26 -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
Tyler Helmuth ec4a7f1359
[chore] Skip flaky test (#11195)
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/10927
2024-09-18 10:56:08 +02:00
Matthieu MOREL 6925a306fa
[chore]: enable len and empty rules from testifylint (#11021)
#### Description

Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[len](https://github.com/Antonboom/testifylint?tab=readme-ov-file#len)
and
[empty](https://github.com/Antonboom/testifylint?tab=readme-ov-file#empty)
rules from [testifylint](https://github.com/Antonboom/testifylint)

It also adds testifylint as tool to use with a make command

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-09 09:57:58 -07:00
Tyler Helmuth e2aaa77d7a
[chore] Fix flaky Test_ComponentStatusReporting_SharedInstance test (#11078)
#### Description
Try adding wait group to ensure `StatusOk` is reported before the call
to `Shutdown`.

Passed with `go test status_test.go --count 2000` 

#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/10927
2024-09-06 12:47:49 -07:00
Pablo Baeyens 46d0f7361e
[extension] Move optional interfaces to extensioncapabilities (#11000)
<!--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 -->

Moves extension optional interfaces to a new module,
`extensioncapabilities`.

The intent is to be able to evolve these interfaces independently from
the core interfaces on core.

These are used by at most one component/project, so I think they are not
mature yet for 1.0

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
2024-09-04 12:37:27 +02:00
Tyler Helmuth a80ce1a605
[chore] Try fixing flaky SharedInstance e2e test (#10929)
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/10927.

` go test status_test.go --count 100` passed.
2024-08-26 16:21:05 -07:00
Damien Mathieu 18d5c02ade
Move processor builders into internal service (#10782)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This moves the processor builder out of the `processor` package, and
into `service/internal/builders`.
There's no real reason for this struct to be public (folks shouldn't
call it), and making it private will allow us to add profiling support
to it.

<!-- Issue number if applicable -->
#### Link to tracking issue

https://github.com/open-telemetry/opentelemetry-collector/pull/10375#pullrequestreview-2144929463
2024-08-22 12:22:23 +02:00
Damien Mathieu 7cd1579d1f
Move exporter builder into internal service (#10783)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This moves the exporter builder out of the `exporter` package, and into
`service/internal/builders`.
There's no real reason for this struct to be public (folks shouldn't
call it), and making it private will allow us to add profiling support
to it.

<!-- Issue number if applicable -->
#### Link to tracking issue

https://github.com/open-telemetry/opentelemetry-collector/pull/10375#pullrequestreview-2144929463
2024-08-22 11:43:35 +02:00
Damien Mathieu 549ee7220f
Move extension builder into internal service (#10785)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This moves the connector builder out of the `connector` package, and
into `service/internal/builders`.
There's no real reason for this struct to be public (folks shouldn't
call it), and making it private will allow us to add profiling support
to it.

<!-- Issue number if applicable -->
#### Link to tracking issue

https://github.com/open-telemetry/opentelemetry-collector/pull/10375#pullrequestreview-2144929463

While this is not technically required for the profiles work (there is
no notion of signals in extensions), this PR is here to keep things
consistent.
2024-08-22 11:04:43 +02:00
Damien Mathieu cde1055559
Move connector builder into internal service (#10784)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This moves the connector builder out of the `connector` package, and
into `service/internal/builders`.
There's no real reason for this struct to be public (folks shouldn't
call it), and making it private will allow us to add profiling support
to it.

<!-- Issue number if applicable -->
#### Link to tracking issue

https://github.com/open-telemetry/opentelemetry-collector/pull/10375#pullrequestreview-2144929463
2024-08-22 10:35:19 +02:00
Damien Mathieu 454432e06f
Move receiver builder into internal service (#10781)
#### Description

This moves the receiver builder out of the `receiver` package, and into
`service/internal/builders`.
There's no real reason for this struct to be public (folks shouldn't
call it), and making it private will allow us to add profiling support
to it.

#### Link to tracking issue

https://github.com/open-telemetry/opentelemetry-collector/pull/10375#pullrequestreview-2144929463
2024-08-21 07:59:38 -07:00
Matthew Wear 98fb888dfe
[component] Make InstanceID immutable (#10495)
#### Description
This PR makes component.InstanceID immutable. Previously it was a struct
with all fields exported. Technically this is a breaking change, but the
only thing using the InstanceID is the in-progress
healthcheckv2extension.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #10494

<!--Describe what testing was performed and which tests were added.-->
#### Testing
units

<!--Describe the documentation added.-->
#### Documentation
code comments
<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Antoine Toulme <antoine@toulme.name>
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-08-21 10:41:55 +02:00
Tyler Helmuth cb24d0c7d7
[component] Remove ReportStatus from component.TelemetrySettings (#10777)
#### Description

This PR removes `ReportStatus` from `component.TelemetrySettings` and
instead expects components to check if their `component.Host` implements
a new `componentstatus.Reporter` interface.

<!-- Issue number if applicable -->
#### Link to tracking issue
Related to
https://github.com/open-telemetry/opentelemetry-collector/pull/10725
Related to
https://github.com/open-telemetry/opentelemetry-collector/pull/10413

<!--Describe what testing was performed and which tests were added.-->
#### Testing
unit tests and a sharedinstance e2e test.

The contrib tests will fail because this is a breaking change. If we
merge this I and @mwear can commit to updating contrib before the next
release.

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-08-16 09:27:01 +02:00