Commit Graph

19 Commits

Author SHA1 Message Date
Antoine Toulme 829157cef7
[chore] add checkapi to tools (#12954)
Adds checkapi to the tools and a make target to run it.

Fixes #12360

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-05-05 15:52:16 +00:00
Pablo Baeyens c1af501cf7
[connector,exporter,processor,receiver] Error out on mismatched type (#12381)
<!--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 -->

Error out on mismatched type for all component kinds. Same as #12305 but
for all component kinds.

#### Link to tracking issue

Requires #12357
Fixes #12221
2025-02-27 12:24:18 +00:00
Chao Weng 6de29ce169 Add `component.Type` parameter to `NewNopSettings` And deprecate `NewNopSettingsWithType` (#12452)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add `component.Type` parameter to `NewNopSettings` And deprecate
`NewNopSettingsWithType` cc @mx-psi

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

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

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

<!--Please delete paragraphs that you did not use before submitting.-->
2025-02-21 11:17:45 +00:00
Pablo Baeyens a4ae175111
[*test] Add NewNopSettingsWithType everywhere (#12357)
<!--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 -->

Creates `NewNopSettingsWithType` function on test modules and deprecates
the `NewNopSettings` functions on those modules. Replace all usages of
`NewNopSettings` with `NewNopSettingsWithType`.

Part of #12305 but applied to all component kinds.

#### Link to tracking issue
Updates #12221
2025-02-13 16:56:20 +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
Tyler Helmuth 2181bdc5f0
[receivertest] Continue DataType deprecations in receivertest (#11304)
#### Description

Continues deprecation/rename processor for
`NewNopFactoryForTypeWithSignal` and
`CheckConsumeContractParams.DataType`.

#### Link to tracking issue
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/9429
2024-09-30 12:57:31 -07:00
Bogdan Drutu bce1040a63
Deprecate funcs that repeate receiver in name (#11287)
This change makes the names to be more "Go" friendly. Also it will not
become an issue that types will try to implement different Factory types
(receiver,processor) because that is forbidden because of our design.
This also makes the names consistent with connector.Factory.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-30 09:19:33 -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
Matthieu MOREL 37f783308e
[chore]: enable require-error rule from testifylint (#11199)
#### Description

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

This PR enables
[require-error](https://github.com/Antonboom/testifylint?tab=readme-ov-file#require-error)
rule from [testifylint](https://github.com/Antonboom/testifylint)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-18 15:02:22 -07: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
Erik Westra 38c8f41878
chore (deps): migrate rand to rand/v2 (#10889)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Migrated rand dependency to rand/v2. We only use rand in tests and mocks
and the only two functions we use are float32 and float64 which still
exist in the new v2 API so nothing very exciting going on here.

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

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Ran `make test` successfully

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

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Erik Westra <e.s.westra.95@gmail.com>
2024-08-14 18:41:38 +02:00
Alex Boten 1e44a9c473
[receiver] deprecate CreateSettings -> Settings (#10333)
This deprecates CreateSettings in favour of Settings.
NewNopCreateSettings is also being deprecated in favour of
NewNopSettings

Part of #9428

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-05 13:57:23 -07:00
dockercui 6dfa6bc5d9
chore: fix function names in comment (#10027)
fix function names in comment


Signed-off-by: dockercui <dockercui@aliyun.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-26 06:43:17 -07:00
Antoine Toulme 6be5fe9fec
[receivertest] add metrics support to contract_checker (#9551)
**Description:**
add support for metrics in contract checker

---------

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2024-02-23 15:42:59 -08:00
Antoine Toulme a8b00dc1c0
[chore] apply some nits to contract_checker. (#9543)
The `idSet` struct used a mix of pointer and non-pointer receivers on
functions, this is now uniformly using non-pointer functions.
2024-02-16 15:33:39 -08:00
Alex Boten 062d0a7ffc
[chore] remove unnecessary underscores (#9580)
As per feedback from my previous PR

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-13 13:34:53 -08:00
Alex Boten 44356bd218
[chore] fix var naming (#9579)
Part of #9577

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-13 11:04:59 -08:00
Alex Boten 4688461318
[chore] fix unused params (#9578)
Related to #9577

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-13 11:04:48 -08:00
Tigran Najaryan deffd48920
Add receiver/consumer contract test helper (#7516)
- Added a CheckConsumeContract() helper func that can be used to test the contract that
  receivers are expected to maintain for Consume() calls.
- Added an example usage of CheckConsumeContract() helper.
2023-06-01 16:49:53 -07:00