The following commands were run to prepare this release:
- make chlog-update VERSION=v1.34.0/v0.128.0
- make prepare-release PREVIOUS_VERSION=1[.]33[.]0
RELEASE_CANDIDATE=1.34.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]127[.]0
RELEASE_CANDIDATE=0.128.0 MODSET=beta
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Amends `ToStringMap` so that it returns `map[string]any(nil)` if the map
used to create this `Conf` was nil. Currently it returns an empty map.
I consider this a bug since, while not explicitly undocumented, I would
expect the following two properties to be true, and they were not before
this change:
1. For any map `m` without `expandedValue`s,
`NewFromStringMap(m).ToStringMap() == m`
2. For any map `m` without `expandedValue`s and any `path` referencing
an existing key in `m` with a `map[string]any` value,
`NewFromStringMap(m).Sub(path) == m[path[0]][path[1]][...][path[N]]`
<!-- Issue number if applicable -->
#### Link to tracking issue
I need this to be able to distinguish between
```
foo:
bar:
```
and
```
foo:
bar: {}
```
which currently have different behaviors when mapping to pointers.
The goal is to be able to do #13168
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Do not panic on assigning nil maps to non-nil maps
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes#13117
<!--Describe what testing was performed and which tests were added.-->
#### Testing
unit tests
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.33.0/v0.127.0
- make prepare-release PREVIOUS_VERSION=1[.]32[.]0
RELEASE_CANDIDATE=1.33.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]126[.]0
RELEASE_CANDIDATE=0.127.0 MODSET=beta
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Adds a method to delete a path from a `Conf` object.
I needed this for #13060
---------
Co-authored-by: Jade Guiton <jade.guiton@datadoghq.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Documents the behavior of `ToStringMap` when there are multiple
representations available
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Clarifies usage of `confmap.Unmarshaler`. This is a limitation that
currently exists since mapstructure will fail to map between the types.
<!--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 -->
Enables `DecoderConfig.DecodeNil`
#### Link to tracking issue
Taken from #10260
Updates #12981
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.32.0/v0.126.0
- make prepare-release PREVIOUS_VERSION=1[.]31[.]0
RELEASE_CANDIDATE=1.32.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]125[.]0
RELEASE_CANDIDATE=0.126.0 MODSET=beta
---------
Co-authored-by: Dmitry Anoshin <anoshindx@gmail.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
If we enable `DecodeNil` as true, we may have [untyped
nils](https://go.dev/doc/faq#nil_error) being passed. Unfortunately,
these are not valid values for `reflect`, which leads to surprising
behavior such as golang/go/issues/51649.
Unfortunately, the default hooks from mapstructure do not deal with this
properly. To account for this, we:
- Vendor and change the `ComposeDecodeHookFunc` function so that this
case is accounted for the kinds of hooks that just won't work with
untyped nils
- Create a safe wrapper for the hooks that do work with untyped nils.
This wrapper is used in all hooks, but in the interest of keeping as
close to what I would imagine upstream will accept, I did not add this
to the compose function.
This should not have any end-user observable behavior.
<!-- Issue number if applicable -->
#### Link to tracking issue
Attempt to work around
https://github.com/open-telemetry/opentelemetry-collector/pull/12996#issuecomment-2862859367
---------
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
While working on #12981, I would have found it useful to have these
tests, since they surfaced a bug when enabling `DecodeNil`.
@mx-psi @dmitryax While working on my RFC, I realized that we can
simplify the logic by moving the merge behavior into `conf.Merge`.
Currently, the feature gate check happens externally, and we choose the
merge option based on that.
This PR moves the check inside `conf.Merge`. By doing this
[converters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/confmap/README.md)
can also make use of this feature.
There are no changes to any API signatures, so this doesn’t introduce
any breaking changes. Let me know what you think about this.
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>
<!--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
Follow-up of
https://github.com/open-telemetry/opentelemetry-collector/pull/12097/
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
### Description
Ideally, users want to merge lists in pipelines only. In this PR, I'm
adding support for merging following components:
1. extensions
2. receivers
3. exporters
We make use of glob-like pattern to match the path because there can be
multiple pipelines configured. Inspired by @evan-bradley's
[idea](https://github.com/open-telemetry/opentelemetry-collector/pull/12097/#discussion_r1918620008).
I'm leaving `processors` out of this list because we make an ordering
guarantee.
#### _**Future plan:**_
Once this PR gets merged, it would make it easier for us to decide upon
the command line flags to make this option configurable over the RFC.
Right now, `patterns` is hardcoded to include above mentioned
components, but we can easily make it configurable after making some
tweaks.
<!-- Issue number if applicable -->
### Link to tracking issue
Relates
https://github.com/open-telemetry/opentelemetry-collector/issues/8754
<!--Describe what testing was performed and which tests were added.-->
### Testing
Expanded the existing test cases
<!--Describe the documentation added.-->
#### Documentation
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
`Equal(..)` panics when we're comparing maps. Use `reflect.DeepEqual`
instead. It behaves same way as `Equal` for types such as `int`,
`string`, `float` etc, but compares individual elements for maps as
well.
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/12932
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added a scenario
<!--Describe the documentation added.-->
#### Documentation
<!--Please delete paragraphs that you did not use before submitting.-->
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.31.0/v0.125.0
- make prepare-release PREVIOUS_VERSION=1[.]30[.]0
RELEASE_CANDIDATE=1.31.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]124[.]0
RELEASE_CANDIDATE=0.125.0 MODSET=beta
<!--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 -->
A second attempt at #11882.
Note that I added some tests in #12871 to prevent something like #12661
from happening again.
#### Link to tracking issue
Fixes#11749
<!--Describe what testing was performed and which tests were added.-->
#### Testing
<!--Describe the documentation added.-->
See tests from #12871 as well as the new tests added here.
<!--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 test for #12661 and another test present on #11882.
I verified that the first test fails in v0.123.0: on this version the
slice has `[]S{A: "A", B: "B"}` instead.
#### Description
This updates replace gopkg.in/yaml.v3 with sigs.k8s.io/yaml
#### Link to tracking issue
Fixes#12827
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.30.0/v0.124.0
- make prepare-release PREVIOUS_VERSION=1[.]29[.]0
RELEASE_CANDIDATE=1.30.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]123[.]0
RELEASE_CANDIDATE=0.124.0 MODSET=beta
The following commands were run to prepare this release:
make chlog-update VERSION=v1.29.0/v0.123.0
make prepare-release PREVIOUS_VERSION=1.28.1 RELEASE_CANDIDATE=1.29.0
MODSET=stable
make prepare-release PREVIOUS_VERSION=0.122.1 RELEASE_CANDIDATE=0.123.0
MODSET=beta
The following commands were run to prepare this release:
* make chlog-update VERSION=v1.28.1/v0.122.1
* make prepare-release PREVIOUS_VERSION=1[.]28[.]0
RELEASE_CANDIDATE=1.28.1 MODSET=stable
* make prepare-release PREVIOUS_VERSION=0[.]122[.]0
RELEASE_CANDIDATE=0.122.1 MODSET=beta
---------
Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com>
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.28.0/v0.122.0
- make prepare-release PREVIOUS_VERSION=1[.]27[.]0
RELEASE_CANDIDATE=1.28.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]121[.]0
RELEASE_CANDIDATE=0.122.0 MODSET=beta
#### Description
There are a bunch of warnings in the lint output about tenv being
deprecated, and moving to usetesting. Reference:
https://golangci-lint.run/usage/linters/#tenv
#### Link to tracking issue
none
#### Testing
Ran `make golint` and `make all`
<!--Describe the documentation added.-->
---------
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
Koanf's default merging strategy currently overrides static values such
as slices, numbers, and strings. However, lists of components should be
treated as a special case. This pull request introduces a new command
line option to allow for merging lists instead of discarding the
existing ones.
With this new merging strategy:
- All the lists are merged rather than replaced.
- The merging logic is name-aware, meaning that if components with the
same name appear in both lists, they will only appear once in the final
merged list.
<!-- Issue number if applicable -->
#### Link to tracking issue
Related issues:
- https://github.com/open-telemetry/opentelemetry-collector/issues/8754
- https://github.com/open-telemetry/opentelemetry-collector/issues/8394
- https://github.com/open-telemetry/opentelemetry-collector/issues/10370
<!--Describe what testing was performed and which tests were added.-->
#### Testing
- Added
<!--Describe the documentation added.-->
#### Documentation
- Added under readme.
##### Example
Consider the following configs,
```yaml
# main.yaml
receivers:
otlp/in:
processors:
batch:
exporters:
otlp/out:
extensions:
file_storage:
service:
pipelines:
traces:
receivers: [ otlp/in ]
processors: [ batch ]
exporters: [ otlp/out ]
extensions: [ file_storage ]
```
```yaml
# extra_extension.yaml
extensions:
healthcheckv2:
service:
extensions: [ healthcheckv2 ]
```
If you run the collector with following command,
```
otelcol --config=main.yaml --config=extra_extension.yaml --feature-gates=-confmap.enableMergeAppendOption
```
then the final configuration after config resolution will look like
following:
```yaml
# main.yaml
receivers:
otlp/in:
processors:
batch:
exporters:
otlp/out:
extensions:
file_storage:
healthcheckv2:
service:
pipelines:
traces:
receivers: [ otlp/in ]
processors: [ batch ]
exporters: [ otlp/out ]
extensions: [ file_storage, healthcheckv2 ]
```
For backward compatibly, the default behaviour is **not** to merge
lists. Users who want to explicitly merge lists can enable the command
line option.
Note: I’d appreciate your feedback on this 🙏
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.27.0/v0.121.0
- make prepare-release PREVIOUS_VERSION=1[.]26[.]0
RELEASE_CANDIDATE=1.27.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]120[.]0
RELEASE_CANDIDATE=0.121.0 MODSET=beta
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add a README for the YAML file with an mdatagen autogenerated section
and basic usage information.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Similar to the other PRs, add a readme to the HTTP provider with basic
usage information.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The existing link 404s, this updates it to the correct URL.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Use mdatagen for the file provider. This switches the package test to be
generated and adds an autogenerated section to the readme.
I've also populated the readme with basic usage information.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Use mdatagen for the HTTP provider. This switches the package test to be
generated and adds an autogenerated section to the readme.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Use mdatagen for the env provider. This switches the package test to be
generated and adds an autogenerated section to the readme.
I've also populated the readme with basic usage information.
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/12465
<!--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 -->
Add error hint field to surface YAML parsing errors. This only surfaces
the error for top-level URIs but it's a step in the right direction.
Error when passing a file with contents `[invalid:,` as the config:
Before:
```
retrieved value (type=string) cannot be used as a Conf
```
After:
```
retrieved value (type=string) cannot be used as a Conf: assuming string type since contents are not valid YAML: yaml: line 1: did not find expected node content
```
#### Link to tracking issue
Updates #12000
<!--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.-->
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.26.0/v0.120.0
- make prepare-release PREVIOUS_VERSION=1[.]25[.]0
RELEASE_CANDIDATE=1.26.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]119[.]0
RELEASE_CANDIDATE=0.120.0 MODSET=beta
<!--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
### 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>