<!--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 -->
Marks `confmap.strictlyTypedInput` as stable.
#### Link to tracking issue
Fixes#10552
Blocked by:
- #10794
- #10795
#### Description
The custom unmarshalling for components copied a map without preserving
the internal representation. This led to the issues mentioned on #10552
not being fully fixed (they were only fixed if they happened in the
`service::telemetry` section for example).
#### Link to tracking issue
Fixes issues mentioned on #10552
#### Testing
This adds one unit test at the `otelcol` level. Since we didn't catch
this with our current `confmap/internal/e2e` tests, we likely also want
to refactor those.
---------
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
Co-authored-by: Curtis Robert <crobert@splunk.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description
Following the tldr section in the builder
[README](https://github.com/open-telemetry/opentelemetry-collector/tree/main/cmd/builder#tldr)
raises the following errors:
With v0.99.0:
```
Error: mismatch in go.mod and builder configuration versions: core collector version calculated by component dependencies "v0.107.0" does not match configured version "v0.106.1". Use --skip-strict-versioning to temporarily disable this check. This flag will be removed in a future minor version
```
With latest:
```
Error: invalid 'confmap.ResolverSettings' configuration: DefaultScheme not found in providers list
2024/08/13 06:55:50 collector server run finished with error: invalid 'confmap.ResolverSettings' configuration: DefaultScheme not found in providers list
```
Removing the `fileprovider` resolves the confmap failure on latest. This
PR removes the `fileprovider` from the `otelcol-custom` binary. An
alternatively we could update the `otelcol.yaml` to include the expected
scheme.
The repo uses markdown-link-check and not having a package.json file to
pin the version causes dependabot security checks sadness. Following the
same pattern as the specification repo for storing package.json in the
root of the repo.
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description
This PR removes `ReportStatus` from `component.TelemetrySettings` and
instead expects components to check if their `component.Host` implements
a new `componentstatus.Reporter` interface.
<!-- Issue number if applicable -->
#### Link to tracking issue
Related to
https://github.com/open-telemetry/opentelemetry-collector/pull/10725
Related to
https://github.com/open-telemetry/opentelemetry-collector/pull/10413
<!--Describe what testing was performed and which tests were added.-->
#### Testing
unit tests and a sharedinstance e2e test.
The contrib tests will fail because this is a breaking change. If we
merge this I and @mwear can commit to updating contrib before the next
release.
---------
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
#### Description
Updates the generated_telemetry and generated_metrics files to only
include the context import when there are async metrics.
#### Link to tracking issue
- Closes#10883
#### Testing
Added unit test to verify expected behaviour.
#### Description
Updates mdatagen's output to show a complete example including the
required metadata.yaml file.
#### Link to tracking issue
- Closes#10886
#### Testing
Running `mdatagen -h` now shows `Usage: ./mdatagen metadata.yaml`
#### Documentation
N/A
---------
Co-authored-by: Yang Song <songy23@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
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>
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [github/codeql-action](https://togithub.com/github/codeql-action) |
action | patch | `v3.26.0` -> `v3.26.1` |
---
> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.
---
### Release Notes
<details>
<summary>github/codeql-action (github/codeql-action)</summary>
###
[`v3.26.1`](https://togithub.com/github/codeql-action/compare/v3.26.0...v3.26.1)
[Compare
Source](https://togithub.com/github/codeql-action/compare/v3.26.0...v3.26.1)
</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://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This change adds `goleak` to check for memory leaks. Originally there
were 3 failing tests in the `service` package, so I'll describe changes
in relation to resolving each test's failing goleak check.
1. `TestServiceTelemetryRestart`: Simplest fix, close the response body
to make sure goroutines aren't leaked by reopening a server on the same
port. This was just a test issue
2. `TestTelemetryInit.UseOTelWithSDKConfiguration`: The [meter
provider](fb3ed1b0d6/service/telemetry.go (L57-L58))
was being started in the initialization process ([metrics
reference](fb3ed1b0d6/service/internal/proctelemetry/config.go (L135))),
but never shutdown. The type originally being used
(`meter.MetricProvider`) was the base interface which didn't provide a
`Shutdown` method. I changed this to use the `sdk` interfaces that
provide the required `Shutdown` method. The actual functionality of
starting the providers was already using and returning the `sdk`
interface, so the actual underlying type remains the same. Since `mp` is
a private member and `sdkmetric` and implement the original type, I
don't believe changing the type is a breaking change.
3. `TestServiceTelemetryCleanupOnError`: This test starts a server using
a sub-goroutine, cancels it, starts again in a subroutine, and cancels
again in the main goroutine. This test showed the racing behavior of the
subroutine running
[`server.ListenAndServe`](fb3ed1b0d6/service/internal/proctelemetry/config.go (L148))
and the main goroutine's functionality of [calling
close](fb3ed1b0d6/service/telemetry.go (L219))
and then starting the server again [right
away](fb3ed1b0d6/service/service_test.go (L244)).
The solution here is to add a `sync.WaitGroup` variable that can
properly block until all servers are closed before returning from
`shutdown`. This will allow us to ensure it's safe to proceed knowing
the ports are free, and server is fully closed.
The first test fix was just a test issue, but 2 and 3 were real bugs. I
realize it's a bit hard to read with them all together, but I assumed
adding PR dependency notes would be more complicated.
**Link to tracking Issue:** <Issue number if applicable>
#9165
**Testing:** <Describe what testing was performed and which tests were
added.>
All tests are passing as well as goleak check.
---------
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.13.0/v0.107.0
- make prepare-release PREVIOUS_VERSION=1[.]12[.]0
RELEASE_CANDIDATE=1.13.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]106[.]1
RELEASE_CANDIDATE=0.107.0 MODSET=beta
Previously the service was returning an instance of a SDK tracer
provider regardless of whether there were any processors configured
causing resources to be consumed unnecessarily.
Fixes#10858
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This will make it available to most components, as the
generated_telemetry is only generated for components that have internal
telemetry configured. Arguably the scope name should be moved to its own
file, but i'd rather not add yet another file if possible.
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description
Expose a setting on tests::host to set up your own host initialization
code
Some receivers require a host that has additional capabilities such as
exposing exporters.
For those, we can expose a setting that allows them to place a different
host in the generated code.
#### Description
This PR improves the version validation during the release preparation
workflow.
#### Link to tracking issue
Fixes#10735
---------
Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
After discussion with the collector SIG call this week, July
31st, I have made small tweaks to the artifact release that will not
require an "extra step" of pushing tags. If these changes are accepted,
the distributions will be released under tag "vX.XXX.X" and the ocb
binaries will be released under "cmd/builder/vX.XXX.X" but both under
this repo, opentelemetry-collector-releases. The workflow
`builder-release.yaml` in releases repo will push the additional tags
necessary for the builder release.
Refactoring the release process as mentioned in past issues/PRs. ocb
binary is currently released in a separate release tag under this
repository, which makes it harder to find and inconsistent with the rest
of the binaries and images releasing in the
opentelemetry-collector-releases repository.
Releasing the ocb binaries in opentelemetry-collector-releases makes
this process more standardized and also opens the opportunity to release
more tools alongside ocb binary down the road, like corresponding docker
images (as discussed in #5712).
#### Link to tracking issue
Fixes#10662
Mentioned in [releases issue #
295](https://github.com/open-telemetry/opentelemetry-collector-releases/issues/295)
[Corresponding PR in
opentelemetry-collector-releases](https://github.com/open-telemetry/opentelemetry-collector-releases/pull/608)
#### Testing
Sample binary release in [forked
jackgopack4/opentelemetry-collector-releases
repo](https://github.com/jackgopack4/opentelemetry-collector-releases/releases/tag/cmd%2Fbuilder%2Fv0.106.1)
#### Documentation
Updated corresponding documentation to reflect new release process
---------
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
This can be used by components that need to set their scope name
manually. Will save component owners from having to store a variable,
which may diverge from the scope name used by the component for emitting
its own telemetry. There are about a dozen components in contrib that
could use this today.
Alternatively, I could just update the scope name strings in the
components manually.
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This will reference the same issue instead of needing to create a PR and
add it to the changelog. Creating a PR and then updating it is not
allowed because of the branch protection permissions.
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description
The default port used by `zpagesextension` is in a range that Windows
machines can exclude by default. This change adds a PowerShell script to
release the default `zpagesextension` port (55679) on the Windows GH
workflows.
#### Link to tracking issue
Fixes#10811
#### Description
Refine the warning message to make it useful for the end user.
#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/10514
#### Testing
Locally tested.
```sh
2024-07-31T22:03:05.984+0900 INFO internal/command.go:125 OpenTelemetry Collector Builder {"version": "(devel)"}
2024-07-31T22:03:05.984+0900 INFO internal/command.go:136 Using default build configuration
2024-07-31T22:03:05.985+0900 INFO builder/config.go:142 Using go {"go-executable": "/usr/local/bin/go"}
2024-07-31T22:03:05.985+0900 INFO builder/main.go:77 You're building a distribution with non-aligned version of the builder. The version mismatch may cause the compilation failure. It's recommended to use the same version. {"collector-version": "0.104.0", "builder-version": "0.106.1"}
2024-07-31T22:03:05.985+0900 INFO builder/main.go:100 Sources created {"path": "/tmp/otelcol-distribution3869530617"}
2024-07-31T22:03:06.510+0900 INFO builder/main.go:191 Getting go modules
2024-07-31T22:03:06.552+0900 INFO builder/main.go:111 Compiling
2024-07-31T22:03:07.080+0900 INFO builder/main.go:130 Compiled {"binary": "/tmp/otelcol-distribution3869530617/otelcorecol"}
```
#### Documentation
N/A
#### Note
I did not add a changelog entry because other PRs that only changed
logging messages and behavior did not add it too.
If this is an incorrect understanding, please point it out.
---------
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
If the test is executed with the `root` user, the
`TestGenerateInvalidOutputPath` test fails.
The behaviour was noticed with a GitLab runner that was executed with
root rights.
An attempt is made to create the directory `/:invalid` during the test.
A user without root rights receives the message `cannot create directory
'/:invalid': Permission denied`.
In contrast, the `root` user can create the directory without any
problems because this is a valid path.
To correct the behaviour of the test, the path to `:/invalid` was
adjusted.
This is not a valid path under Windows or Linux.
Signed-off-by: Andrej Giesbrecht <giesan@gmx.net>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add 10s read header timeout on the configtelemetry Prometheus HTTP
server.
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes#5699
---------
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add `NewDefaultCORSConfig` function to initialize the default
`confighttp.CORSConfig`
<!-- Issue number if applicable -->
#### Link to tracking issue
#9655
#### Description
This is a stripped-down version of
https://github.com/open-telemetry/opentelemetry-collector/pull/10121
that eschews implementation details in favor of answering questions
about _what_ we want to achieve instead of how we will achieve it. A
section from that PR has been reproduced here to cover a few approaches
for future discussions.