Commit Graph

27 Commits

Author SHA1 Message Date
Bogdan Drutu dfc232e4b0
[chore] Move component.Type to identifiable, fix small comments (#11523)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-25 14:58:32 -07:00
renovate[bot] 49f657f6a7
fix(deps): update module github.com/golangci/golangci-lint to v1.61.0 (#10935)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/golangci/golangci-lint](https://redirect.github.com/golangci/golangci-lint)
| `v1.60.1` -> `v1.61.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgolangci%2fgolangci-lint/v1.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgolangci%2fgolangci-lint/v1.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgolangci%2fgolangci-lint/v1.60.1/v1.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgolangci%2fgolangci-lint/v1.60.1/v1.61.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>golangci/golangci-lint
(github.com/golangci/golangci-lint)</summary>

###
[`v1.61.0`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1610)

[Compare
Source](https://redirect.github.com/golangci/golangci-lint/compare/v1.60.3...v1.61.0)

1.  Enhancements
    -   Add `junit-xml-extended` format
    -   Exclude Swagger Codegen files by default
2.  Updated linters
    -   `dupword`: from 0.0.14 to 0.1.1
    -   `fatcontext`: from 0.4.0 to 0.5.2
    -   `gci`: from 0.13.4 to 0.13.5 (new option `no-lex-order`)
- `go-ruleguard`: from 0.4.2 to
[`0fe6f58`](https://redirect.github.com/golangci/golangci-lint/commit/0fe6f58b47b1)
(fix panic with custom linters)
    -   `godot`: from 1.4.16 to 1.4.17
    -   `gomodguard`: from 1.3.3 to 1.3.5
    -   `gosec`: disable temporarily `G407`
- `gosec`: from
[`ab3f6c1`](https://redirect.github.com/golangci/golangci-lint/commit/ab3f6c1c83a0)
to 2.21.2 (partially fix `G115`)
    -   `intrange`: from 0.1.2 to 0.2.0
    -   `nolintlint`: remove the empty line in the directive replacement
3.  Misc.
    -   Improve runtime version parsing
4.  Documentation
    -   Add additional info about `typecheck`

###
[`v1.60.3`](https://redirect.github.com/golangci/golangci-lint/compare/v1.60.2...v1.60.3)

[Compare
Source](https://redirect.github.com/golangci/golangci-lint/compare/v1.60.2...v1.60.3)

###
[`v1.60.2`](https://redirect.github.com/golangci/golangci-lint/compare/v1.60.1...v1.60.2)

[Compare
Source](https://redirect.github.com/golangci/golangci-lint/compare/v1.60.1...v1.60.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMTE1LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyIsInJlbm92YXRlYm90Il19-->

---------

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com>
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-12 16:13:55 -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
Pablo Baeyens 72c7d7f29a
[component] Bump maximum length for component names to 1024 characters (#10818)
#### Description

Bumps component name length limit to 1024 characters.

#### Link to tracking issue

Fixes #10816

#### Testing

Added some unit tests.
2024-08-07 06:59:59 -07:00
Matthew Wear 95902c19f5
[component] Restrict character set for component.ID name (#10674)
#### Description
While working on
https://github.com/open-telemetry/opentelemetry-collector/pull/10495 we
discovered that there are not any restrictions on the `name` field of a
`component.ID`. There are restrictions on the `type` field introduced in
#9208. This PR adds similar restrictions to `name`.

A type must
- have at least one character,
- start with an ASCII alphabetic character and
- can only contain ASCII alphanumeric characters and '_'.

I found that we need a slightly different set of rules for name as some
tests use a digit and others use a uuid as a name. A name is still
optional, but if it's provided it must:
- have at least one character,
- start with an ASCII alphanumeric character and
- can only contain ASCII alphanumeric characters, '_', and '-'.

I'd be willing to adjust these restrictions if anyone has any opinions
on what should or should not be allowed.

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

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

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

<!--Please delete paragraphs that you did not use before submitting.-->
2024-07-25 19:36:29 +02:00
Antoine Toulme 1912879c19
[component] Remove deprecated `component.UnmarshalConfig` (#10340)
#### Description
Remove deprecated `component.UnmarshalConfig`

#### Link to tracking issue
Fixes #7102

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-06 10:05:26 -07:00
Antoine Toulme b6bdc4ee5b
[chore] fix some typos and a use of deprecated Go API (#10347) 2024-06-06 08:04:30 -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
Ankit Patel 65cdb184f3
Add length limit to component (#9901)
Changes component.Type validation regex to only allow a max of 63
characters in a type name.

Fixes #9872

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-04-10 09:22:10 -07:00
Tyler Helmuth 9c5bf54880
[component] make Type implement MarshalText (#9856)
**Description:**
Adds `MarshalText` function so that `Type` can be properly marshaled as yaml.

**Link to tracking Issue:** Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/9855
2024-03-27 13:22:52 -07:00
Pablo Baeyens b2693620ef
[component] Change component.Type underlying type to a struct (#9472)
**Description:** 

Follow up to #9414 and
open-telemetry/opentelemetry-collector-contrib/pull/31038.

**Link to tracking Issue:** Fixes #9208.
2024-03-06 12:56:32 +01: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 6155cc25dd
Make the option `WithErrorUnused` enabled by default when unmarshaling configuration (#9154)
**Description:**
Make the option `WithErrorUnused` enabled by default when unmarshaling
configuration
The option `WithErrorUnused` is now enabled by default, and a new option
`WithIgnoreUnused` is introduced to ignore
errors about unused fields.

**Link to tracking Issue:**
This relates to #7102 to some extent.

**Testing:**
N/A

**Documentation:**
N/A
2023-12-22 11:11:39 -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
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 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 b4ff8ba397
[chore] remove unnecessary commment, Validate is no longer implemented by Settings (#6676)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-05 08:22:21 -08:00
Bogdan Drutu d0fe772781
Deprecate component.Config.ID(), add helper for obsreporttest (#5870)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-29 14:35:49 -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 bd269df482
Add connector factory (#6611) 2022-11-23 10:15:54 -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 Drutu 5376db4058
Add recursive validation check for configs (#6545)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-22 10:18:38 -08:00
Bogdan Drutu ae6cd6500c
Remove Validate() from Config interfaces and make it optional interface (#6544)
The reason is to remove every Config to include the "config.*Settings" structs, which is one of the functionality they offer.

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

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-21 12:24:13 -08:00
Bogdan Drutu 86d886cdc7
Deprecate Config.Validate() in favor of component.ValidateConfig (#6572)
* Deprecate Config.Validate() in favor of component.ValidateConfig

This PR is "split" from https://github.com/open-telemetry/opentelemetry-collector/pull/6544, to avoid breaking changes and go via deprecation.

It is a bit hacky, but better than breaking everyone who uses this interface.

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

* Update config/receiver.go

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2022-11-17 13:50:30 -08:00
Bogdan Drutu 0b08d53164
Change component.DataType enum value names to be consistent with other in the repo (#6488)
No deprecation, they were added in this cycle. Deprecated old formats are in config package.

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-11-07 17:48:05 -08: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