Commit Graph

396 Commits

Author SHA1 Message Date
Damien Mathieu 8568c97b0d
Upgrade proto to 1.7.0 (#13075)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This upgrades protobuf/pdata to
[v1.7.0](https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v1.7.0).

Note: due to the move of the lookup tables, merging profiles required
more non-trivial work.
In order to facilitate this review, merging is therefore currently
disabled for profiles. We will bring it back in a separate PR.

Note: this needs its contrib counterpart before it can be moved out of
draft.
2025-06-02 08:15:14 +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
Daniel Jaglowski 178caa125e
[service/internal/graph] Add size throughput metrics (#13032)
Follows #12812

This PR adds the `size` metrics defined in the [Pipeline Component
Telemetry
RFC](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md).
2025-05-20 11:45:33 +00:00
Daniel Jaglowski 279752c11f
[service/internal/graph] Measure telemetry as it is passed between pipeline components (#12812)
Depends on
https://github.com/open-telemetry/opentelemetry-collector/pull/12856

Resolves #12676

This is a reboot of #11311, incorporating metrics defined in the
[component telemetry
RFC](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md)
and attributes added in #12617.

The basic pattern is:
- When building any pipeline component which produces data, wrap the
"next consumer" with instrumentation to measure the number of items
being passed. This wrapped consumer is then passed into the constructor
of the component.
- When building any pipeline component which consumes data, wrap the
component itself. This wrapped consumer is saved onto the graph node so
that it can be retrieved during graph assembly.

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2025-05-12 08:33:02 +00:00
Alex Boten 4ca0f1829e
update semconv dependency to otelgo's semconv package (#12991)
This updates the calls to the collector's internal semconv package with
otelgo's instead. The main difference is how the keys can be used, they
will need to be cast as strings where they key name is needed, otherwise
it's not a huge change. This would allow us to stop producing our own
semconv package once contrib is moved as well.

Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/10346,
https://github.com/open-telemetry/opentelemetry-collector/issues/11828,
https://github.com/open-telemetry/opentelemetry-collector/issues/11807

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-05-09 19:04:08 +00:00
Daniel Jaglowski 56c7da2107
[chore] Update obsconsumer to use new attribute name (#12959)
Implements new name for attribute as documented in #12951.

Note: The obsconsumer package is unused until #12812 is merged so this
is not a breaking change.
2025-05-05 15:27:26 +00:00
Pablo Baeyens 29aaad3dfe
[chore] Generate codecov badge for all READMEs (#12962)
<!--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 -->

Adds a CodeCov status badge unless explicitly disabled.

I have disabled this in core until we roll this out in contrib to show
the Go SIG and move codecovgen to build tools

#### Link to tracking issue

Updates open-telemetry/opentelemetry-collector-contrib/issues/39583
2025-05-05 15:26:50 +00:00
Daniel Jaglowski 08f03438ec
[chore] Clarify safety of cast from uint64 to int64 in graph (#12900) 2025-04-22 15:19:30 +00:00
Daniel Jaglowski dc8e2ddd9c
Permanently enable 'telemetry.newPipelineTelemetry' feature gate (#12856)
Discussed offline in relation to #12812

Introduction of this gate had some unintended side effects, such as
removing attributes from loggers.

---------

Co-authored-by: Jade Guiton <jade.guiton@datadoghq.com>
2025-04-17 15:57:35 +00:00
Daniel Jaglowski d804ef5910
Fix 'otelcol.component.kind' value capitalization (#12865)
This brings capitalization in line with the attributes defined in the
[Pipeline Component
Telemetry](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md#attributes)
RFC.
2025-04-16 03:18:27 +00:00
Daniel Jaglowski 55f569d83e
[chore] Create service/internal/obsconsumer package (#12817)
Subset of #12812

This internal package defines wrappers around consumers. These are
useful for instrumenting the component graph, so that we can generate
telemetry describing data as it is passed in between components.

Currently, this supports only a single counter metric, but in the near
future it can be enhanced to automatically capture multiple metrics
(e.g. item count & size), and potentially spans and/or logs as well.
2025-04-15 10:40:55 +00:00
Roger Coll 4fb7c24ebe
add GetFactory interface to hostcapabilities package (#12789)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

The GetFactory method is used by a few receivers in the contrib package
(e.g. receiver_creator). This PR adds a new interface to the
hostcapabilities package so it can be cast correctly from other
packages/components.

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

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

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

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

---------

Co-authored-by: Jade Guiton <jade.guiton@datadoghq.com>
2025-04-11 07:44:47 +00:00
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 cb5c3f4fb9
[chore]: fix staticcheck exclusions (#12792)
#### Description

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

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-02 20:07:55 +00:00
Jade Guiton 54c13a9217
Inject component-identifying scope attributes (#12617)
#### Description

Fork of #12384 to showcase how component attributes can be injected into
scope attributes instead of log/metric/span attributes. See that PR for
more context.

To see the diff from the previous PR, filter changes starting from the
"Prototype using scope attributes" commit.

#### Link to tracking issue
Resolves #12217 
Also incidentally resolves #12213 and resolves #12117

#### Testing
I updated the existing tests to check for scope attributes, and did some
manual testing with a debug exporter to check that the scope attributes
are added/removed properly.

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
2025-03-28 12:15:25 +00:00
Roger Coll af659fa1de
[service] Include component id/type in start error (#11837)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Wraps the component ID and type into the component's start retuned
error. If `telemetry::logs::level` is < error (e.g fatal), the service
error message does not give information about which pipeline component
failed:

Current error message:
```
 $ otelcontribcol --config config.yaml
Error: cannot start pipelines: start function error
2024/12/10 10:07:25 collector server run finished with error: cannot start pipelines: start function error
```
 
 With these changes:
 
 ```
 $ otelcontribcol --config config.yaml
Error: cannot start pipelines: failed to start geoip processor: start
function error
2024/12/10 09:58:29 collector server run finished with error: cannot
start pipelines: failed to start geoip processor: start function error
```
 

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

https://github.com/open-telemetry/opentelemetry-collector/issues/10426

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

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

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

---------

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
2025-03-07 14:58:09 +00:00
Matthew Sainsbury ab63cdff96
[chore] bump otel-go deps (#12575)
#### Description
Upgrading the collector to use opentelemetry-go-contrib
v1.35.0/v0.60.0/v0.29.0/v0.15.0/v0.10.0/v0.8.0/v0.7.0

See changelog here:
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.35.0

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

<!--Describe what testing was performed and which tests were added.-->
#### Testing
I ran `make all` but happy to run other targets if needed
2025-03-06 20:20:20 +00:00
John L. Peterson (Jack) 4d927b97e1
[service] create service/hostcapabilities package (#12375)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
create `service/hostcapabilities` package to expose `GetModuleInfos()`
from service/host. Also moves getExporters interface for
`GetExporters()` to this package.
<!-- Issue number if applicable -->
#### Link to tracking issue
Addresses planned work from #12296

<!--Describe what testing was performed and which tests were added.-->
#### Testing
none, creates interface for existing function

<!--Describe the documentation added.-->
#### Documentation
changelog yaml
<!--Please delete paragraphs that you did not use before submitting.-->
2025-02-24 11:36:45 +00:00
Sudipto Baral 18e18b21da
Add pipeline ID to the error message for unused connectors. (#12410)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
As mentioned in this
https://github.com/open-telemetry/opentelemetry-collector/issues/8721#issuecomment-1813468623,
the error message for unused connectors currently lacks specific
pipeline names, making debugging more difficult.

This PR enhances the error message by including pipeline names in the
`[signal/name]` format, consistent with how they appear in
`config.yaml`. This provides a better context for identifying
misconfigurations.

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

<!--Describe what testing was performed and which tests were added.-->
#### Testing
A few scenarios and example output are given below. I will do additional
testing and add unit tests if necessary.

**1. Used as a receiver but not used as an exporter with 1 signal**
<details>
  <summary><strong>config.yaml</strong></summary>

```yaml
receivers:
  otlp:
    protocols:
      grpc:
exporters:
  debug:
connectors:
  forward:
service:
  pipelines:
    logs/in:
      receivers: [otlp]
      processors: []
      exporters: [debug]
    logs/out:
      receivers: [forward]
      processors: []
      exporters: [debug]
```
</details>

Main Branch Output:
```
Error: failed to build pipelines: connector "forward" used as receiver in logs pipeline but not used in any supported exporter pipeline
```
Proposed Output:
```
Error: failed to build pipelines: connector "forward" used as receiver in [logs/out] pipeline but not used in any supported exporter pipeline
```

**2. Plain**
<details>
  <summary><strong>config.yaml</strong></summary>

```yaml
receivers:
  otlp:
    protocols:
      grpc:
exporters:
  debug:
connectors:
  forward:
service:
  pipelines:
    traces:
      receivers: [ otlp ]
      processors: [ ]
      exporters: [ forward ]
    metrics:
      receivers: [ forward ]
      processors: [ ]
      exporters: [ debug ]
```
</details>

Main Branch Output:
```
Error: failed to build pipelines: connector "forward" used as exporter in traces pipeline but not used in any supported receiver pipeline
```
Proposed Output:
```
Error: failed to build pipelines: connector "forward" used as exporter in [traces] pipeline but not used in any supported receiver pipeline
```
**3. Multiple pipeline**
<details>
  <summary><strong>config.yaml</strong></summary>

```yaml
receivers:
  otlp:
    protocols:
      grpc:
exporters:
  debug:
connectors:
  forward:
service:
  pipelines:
    logs/in:
      receivers: [otlp]
      processors: []
      exporters: [forward]
    logs/in2:
      receivers: [ otlp ]
      processors: [ ]
      exporters: [ forward ]
    logs/out:
      receivers: [otlp]
      processors: []
      exporters: [debug]
    traces:
      receivers: [ otlp ]
      processors: [ ]
      exporters: [ forward ]
    metrics:
      receivers: [ forward ]
      processors: [ ]
      exporters: [ debug ]
```
</details>

Main Branch Output:
```
Error: failed to build pipelines: connector "forward" used as exporter in logs pipeline but not used in any supported receiver pipeline
```
Proposed Output:
```
Error: failed to build pipelines: connector "forward" used as exporter in [logs/in2 logs/in] pipeline but not used in any supported receiver pipeline

```

---------

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-02-24 01:06:54 +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
Antoine Toulme f71fe2757f
[chore] fix metadata.yaml (#12387)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
fix metadata.yaml github_project, add a go:generate instruction to
confmap and a banner to README
2025-02-14 11:00:42 +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
Jade Guiton 77f824660e
Make MakeFactoryMap generic and move to otelcol (#12220)
#### Description

At the moment, `receiver`, `scraper`, `processor`, `exporter`, and
`extension` each have their own version of the `MakeFactoryMap`
function, which takes a list of Factories and returns it as a map, with
the component name as the key (and an error if there is overlap).
Because all versions are near-identical except for the Factory type
used, and this function is only used in tests and in the code generated
by OCB (`components.go`), it was suggested to make it generic and move
it to the `otelcol` package.

This PR does exactly that. The old `MakeFactoryMap` functions are
deprecated (and may be removed alongside their tests in a future
release). I also had to make a few other odd changes to fit the new
dependency graph.

#### Link to tracking issue
Resolves #12222

---------

Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-02-13 11:47:22 +00:00
Pablo Baeyens f87b93a8f9
[chore] Move LoggerWithout temporarily to internal package (#12334)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Moves `LoggerWithout` to an internal package so that we can keep on
experimenting on it while mark component 1.0 on v0.121.0.

This does not need a changelog since the change has not been released

<!-- Issue number if applicable -->
#### Link to tracking issue
Updates #12217
2025-02-12 10:35:58 +00:00
Bogdan Drutu abdfdc8d5f
[chore] Remove unused private funcs from generated code with mdatagen (#12339)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-02-11 00:25:13 +00:00
Bogdan Drutu 9b5208a53a
[chore] Remove dead code from mdatagen. (#12336)
Missed by
https://github.com/open-telemetry/opentelemetry-collector/pull/12304,
this variables can no longer be initialized so this becomes dead code.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-02-10 20:29:26 +00:00
Daniel Jaglowski 5d5fb21acf
Introduce component logger with appropriate attributes (#12259)
Implements the logger described in
https://github.com/open-telemetry/opentelemetry-collector/issues/12217

Alternative to #12057

Resolves #11814

`component/componentattribute`:
- Initializes new module
- Defines constants for component telemetry attribute keys
- Defines a `zapcore.Core` which can remove attributes from the root
logger

`service`:
- Rebases component instantiation on attribute sets
- Internal constructors for attribute sets for each component type
- Constructs loggers from `componentattribute`

`otlpreceiver`:
- Uses `componentattribute` to remove `otelcol.signal` attribute from
logger

`memorylimiter`:
- Uses `componentattribute` to remove `otelcol.signal`,
`otelcol.pipeline.id` and `otelcol.component.id` attributes from logger
2025-02-06 16:53:20 +00:00
Moritz Wiesinger 43087bdd92
[chore] add githubgen to enhance codeowners and issue templates (#11756)
### This PR
- adds the githubgen tool as a dependency in internal/tools
- uses githubgen to generate codeowners and issue template files
- updates lots of metadata files by
- taking the existing codeowners file and feeding the info from there
back into the component metadata.yaml files or creating new
metadata.yaml files where none existed yet
- adds distributions.yaml as a basis the mostly already existing
`distributions:` keys in metadata.yaml files (needed for githubgen to
work correctly)
- adds relevant make commands to make the githubgen tool usage mostly
transparent to users

This change is a prerequisite to be able to ping codeowners reliably
with automated tooling as a next step.


Part of #11562

---------

Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
2025-02-06 10:31:36 +00:00
Alex Boten 7d603aa46b
Remove deprecated funcs (#12304)
Removing all v0.119.0 deprecated funcs.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-02-06 03:57:26 +00:00
Pablo Baeyens 1f0365cbdd
[extension] Remove Settings.ModuleInfo and move to service.Host hidden method (#12296)
<!--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.Settings.ModuleInfo` to a `service.Host.GetModuleInfo`
method.

This field probably fits better on `extension.Settings` or even in
`component.BuildInfo`, but since its contents are a bit in flux per
discussions like #12283, I would like to move it here to not stabilize
it alongside the rest of `extension`.

The field is not used in any public code on Github, so I think it won't
have a huge impact to remove it in one go, happy to do this in two steps
if preferred.

One relevant difference is that this information is no longer available
at extension build time, but rather after the `Start` method is called.
Another relevant difference is that this is now available for all
component kinds, not just extensions. This could be worked around (we
could pass a different host depending on the component kind) but I don't
see the use right now.

#### Link to tracking issue
Updates #12283
2025-02-05 19:13:45 +00:00
Bogdan Drutu 0a40b4e00b
Deprecate metadatatest.Telemetry in favor of componenttest.Telemetry (#12218)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-31 21:31:34 +00:00
Bogdan Drutu d9b97ffb43
[metadatatest] Generate NewSettings that accepts componenttest.Telemetry (#12216)
This is the last functionality needed to replace
`metadatatest.Telemetry` with `componenttest.Telemetry`.

The `metadatatest.Telemetry` will be deprecated next release to give
time to change contrib since it is a large change.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-30 21:42:20 +00:00
Bogdan Drutu fb8bb93121
Add helper to get a metric for componentest.Telemetry (#12215)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-30 19:04:27 +00:00
Bogdan Drutu 3203167e9a
Make registration of callback for async metric always optional (#12204)
This PR also solves one more issues with the new interface, which is the
ability to record multiple observations for a single async metric using
one callback.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-29 23:58:43 +00:00
Chao Weng 356e5a6e26
[chore] Replace AssertMetrics with AssertEqualMetric series functions (#12184)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
A follow-up PR of #12179 , cc @bogdandrutu 

Note: This PR also removes those metric assertions which is actually
testing metrics that doesn't belong to the package. They might be added
due to the limitation of the AssertMetrics function. e.g. changes in
`processor/memorylimitprocessor/memorylimiter_test.go`

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

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

<!--Describe the documentation added.-->
#### Documentation
n/a

<!--Please delete paragraphs that you did not use before submitting.-->
2025-01-26 23:00:59 +00:00
Chao Weng c2f1599df9
Generate assert function for each metric in mdatagen (#12179)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Completion of #12167 , cc @bogdandrutu 

Updated one test to verify the change, will update the rest ones after
this PR merges.
<!-- Issue number if applicable -->
#### Link to tracking issue
n/a

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

<!--Describe the documentation added.-->
#### Documentation
Added
<!--Please delete paragraphs that you did not use before submitting.-->
2025-01-25 16:52:04 +00:00
Alex Boten 4edaacddf9
update config dependency (#11611)
This PR does a couple of things that I couldn't quite split up so I put
together a PR w/ individual commits to help reviewers get through it.
This PR does the following:

1. update `go.opentelemetry.io/contrib/config` package to latest. this
brings in breaking changes. in order to prevent those breaking changes
from impacting end users, i've also added a layer of config unmarshaling
2. updates the collector to instantiate the meter provider (and
exporters) via the config package. this allows us to remove all the code
in `otelinit`. the reason for including this change was that
unmarshaling the config was causing circular dependencies i didn't want
to address by moving code that could be deleted around.


Replacement for
https://github.com/open-telemetry/opentelemetry-collector/pull/11458.

Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/12021

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-01-24 17:47:00 +00:00
Bogdan Drutu 7db2f90d79
Allow passing trace/metric SDK options to componenttest.Telemetry (#12166)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-23 10:54:13 +00:00
Bogdan Drutu c6a0986813
Extract componenttest.Telemetry as generic struct for telemetry testing (#12151)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-22 20:27:45 +00:00
Pablo Baeyens b844bb7146
[cmd/mdatagen] Remove level field from metrics (#12145)
<!--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 -->

Removes `level` field. This will be added back in the future once #11754
is completed.

#### Link to tracking issue

Updates #11061
2025-01-22 14:09:03 +00:00
Matthieu MOREL b6f379f6f4
[chore]: enable nolintlint (#12132)
#### Description

[nolintlint](https://golangci-lint.run/usage/linters/#nolintlint):
Reports ill-formed or insufficient nolint directives.
2025-01-21 10:23:27 +00:00
Daniel Jaglowski 52d1414547
[chore] Add internal attribute package (#12073)
This PR creates a new internal package which defines the correct set of
attributes for each kind of component.

This is a subset of #12057 which is broken off in order to reduce the
overall size of that PR. As such, this package will not actually be used
until #12057 is merged.
2025-01-20 15:51:08 +00:00
Daniel Jaglowski 81f1fad0ee
[chore] Add test to validate expected component instances (#12071)
Subset of #12057

This PR adds a test to validate the expected number of instances of each
component. This framework becomes more useful once singleton components
are explicitly supported.
2025-01-20 13:45:55 +00:00
Chao Weng c14d4f96d6
Add tracing support in metadatatest (#12106)
#### Description
Add tracing support in metadatatest

cc @bogdandrutu  
#### Documentation
Added
2025-01-17 08:52:24 +00:00
Daniel Jaglowski 7425fe859c
[chore] Clean up naming in testcomponent package (#12072)
This PR just cleans up some naming in the `testcomponents` package, so
that no component kind has a monopoly on the generic version of a
variable or function name.

Subset of #12057
2025-01-10 21:05:23 +00:00
Bogdan Drutu 306c939415
Deprecate component_test in favor of metadatatest (#11812)
The main idea behind this is that the test helpers were generated in the
main package, hard to find and understand and also impossible to use
outside the main package, see the
[service/internal/proctelemetry/process_telemetry_test.go](https://github.com/open-telemetry/opentelemetry-collector/compare/main...bogdandrutu:opentelemetry-collector:dep-comp-test?expand=1#diff-ed642eb1c968a9308a07e87292f77af1e0830a7af2d87111c5abacde4fc87446).

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-06 18:06:46 +00:00
Bogdan Drutu 4cf491babd
[chore] Fix some nolint in tests or non critical code (#11943)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-12-17 21:59:18 +00:00
Matthew Wear 58a5ffc888
[service/internal] Allow components to transition from PermanentError to Stopping (#10958)
#### Description
In #10058 I mentioned:

> There is a tangentially related issue with PermanentErrors and the
underlying finite state machine that governs transitions between
statuses. Currently, a PermanentError is a final state. That is, once a
component enters this state, no further transitions are allowed. In
light of the work I did on the alternative health check extension, I
believe we should allow a transition from PermanentError to Stopping to
consistently prioritize lifecycle events for components. This transition
also make sense from a practical perspective. A component in a
PermanentError state is one that has been started and is running,
although in a likely degraded state. The collector will call shutdown on
the component (when the collector is shutting down) and we should allow
the status to reflect that.

This PR makes the suggested change and updates the documentation to
reflect that. As this is an internal change, I have not included a
changelog. Also note, we can close #10058 after this as we've already
removed status aggregation from core during the recent component status
refactor.

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

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

<!--Describe the documentation added.-->
#### Documentation
Updated docs/component-status.md and associated diagram.

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

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Co-authored-by: Antoine Toulme <atoulme@splunk.com>
2024-12-17 13:02:44 +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
Dmitrii Anoshin e9bc4bde92
Deprecate connectorprofiles module in favor of xconnector (#11887)
to allow adding more experimental data types.

Updates
https://github.com/open-telemetry/opentelemetry-collector/issues/11778
2024-12-14 15:04:34 +00:00