Commit Graph

16 Commits

Author SHA1 Message Date
Matthieu MOREL 564818fd7f
[chore]: fix testifylint rules (#12791)
#### Description

Fixes testifylint rules which where disabled with golangci-lint v2
upgrade

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-02 23:10:07 +00:00
Matthieu MOREL 869eec38f3
[chore]: enable partially thelper linter (#11895)
#### Description

[Thelper](https://golangci-lint.run/usage/linters/#thelper) detects
tests helpers which is not start with t.Helper() method.

This only enables rules for naming and paramter order

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-12-17 08:42:49 +00:00
Matthieu MOREL e053173aed
[chore]: enable perfsprint linter (#11599)
#### Description

[perfsprint](https://golangci-lint.run/usage/linters/#perfsprint) checks
that fmt.Sprintf can be replaced with a faster alternative.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-11-05 14:37:07 -08:00
Bogdan Drutu ebda8c1b80
[chore] remove duplicate code in testutil (#11210)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-18 12:33:12 -07:00
Alex Boten 168bba73f0
[service] fix proctelemetry registration bug (#11093)
This bug caused proctelemetry metrics to not be registered if a user
configured the Collector's internal telemetry via `readers` only and
disabled `address`. The check in the `if` statement is no longer needed
since a no-op meter provider will be configured unless the telemetry
level is set.

Mentioned in #10919

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-11 07:36:54 -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
Hajime Terasawa ee4eb85f58
[service] fix: use ipv6-aware host and port concatenation function (#10343)
#### Description
Fixing the bug: the latest version of otel-collector failed to start
with ipv6 metrics endpoint service telemetry.

This problem began to occur after
https://github.com/open-telemetry/opentelemetry-collector/pull/9037 with
the feature gate flag enabled was merged. This problem is probably an
implementation omission because the enabled codepath, which was
originally added by
https://github.com/open-telemetry/opentelemetry-collector/pull/7871, is
marked as WIP.

You can reproduce the issue with the config and the environment variable
(`MY_POD_IP=::1`).
```yaml
service:
  telemetry:
    logs:
      encoding: json
    metrics:
      address: '[${env:MY_POD_IP}]:8888'
```

#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/10011

---------

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
2024-06-28 12:09:26 -07:00
Alex Boten a82663e41b
remove generated jsonschema code (#8620)
This code will live in the opentelemetry-go-contrib repo in the future.

This depends on
https://github.com/open-telemetry/opentelemetry-go-contrib/pull/4376

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-11-16 11:01:08 -08:00
Alex Boten 929972873f
[wip] add ability to configure prometheus export via `readers` (#7871)
This enables end users to configure additional prometheus exporters for
the collector's telemetry
via the `readers` configuration option. Configuring prometheus through
the existing method
of setting the service::metrics::address will continue to work, and only
log a warning for users
who have enabled the
`telemetry.useOtelWithSDKConfigurationForInternalTelemetry` feature
gate.

Linked issue: #7641
---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
2023-07-14 10:03:47 -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 f477970736
testutil: Exclude port ranges for both TCP and UDP (#5510)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-06-16 14:27:03 -07:00
Bogdan Drutu 6749fc8a7e
Remove GetAvailablePort, change GetAvailableLocalAddress to handle windows reserved ports (#5275)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-04-27 12:59:11 -07:00
Bogdan Drutu 70271f24ab
Fix small nits in testutil, handle errors, initialize slices (#4845)
* Fix small nits in testutil, handle errors, initialize slices

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

* Update testutil.go
2022-02-18 11:37:38 -08:00
Bogdan Drutu eb3601a059
Avoid potential integer overflow (#4277)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-10-28 08:49:32 -07:00
José Carlos Chávez 9d3a8a4608
Adds vanity import check (#4180)
* chore: adds porto and fixes vanity imports.

* chore: fixes target overriding.

* chore: fixes install of porto.

* chore: includes porto as a tool.

* chore: upgrades porto to check internals.

* chore: rebase and update vanity import.

* chore: removes unnecessary space.

* chore: rollsback vanity import in generated files.
2021-10-12 13:47:36 -07:00
Bogdan Drutu f6f4b87050
Move testutil to internal, copied in contrib as well (#3905)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-08-27 09:51:09 -07:00