Skip to content

Commit

Permalink
feat(build): use patched versions of four upstream receivers
Browse files Browse the repository at this point in the history
Use patched versions of:
* hostmetricsreceiver
* apachereceiver
* mysqlreceiver
* elasticsearchreceiver

The intent is to move back to using upstream as the necessary changes
are merged.
  • Loading branch information
Mikołaj Świątek committed Oct 18, 2022
1 parent 3f0b3e3 commit 071e5be
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This release introduces the following breaking changes:

### Changed

- feat(build): use patched versions of four upstream receivers [#767]
- fix(sumologicexporter): do not crash if server returns unknown length response [#718]
- fix(k8sprocessor): fix metadata enrichment [#724]
- fix(k8sprocessor): keep pod's services information up to date [#710]
Expand All @@ -45,6 +46,7 @@ This release introduces the following breaking changes:
[#746]: https://github.com/SumoLogic/sumologic-otel-collector/pull/746
[#769]: https://github.com/SumoLogic/sumologic-otel-collector/pull/769
[#693]: https://github.com/SumoLogic/sumologic-otel-collector/pull/693
[#767]: https://github.com/SumoLogic/sumologic-otel-collector/pull/767
[upgrade_guide_unreleased]: ./docs/Upgrading.md#unreleased

## [v0.57.2-sumo-0]
Expand Down
58 changes: 55 additions & 3 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,61 @@ Updating OT core involves:

### Updating patched processors

We currently do not maintain patches for upstream components.
We currently maintain patches for the following upstream components:

Historical process can be taken from [v0.57.2-sumo-0][updating_patched] if needed.
- `hostmetricsreceiver`
- `mysqlreceiver`
- `apachereceiver`
- `elasticsearchreceiver`

The patches live in our [contrib fork repository][contrib_fork], on the `vX.X.X-patches` branch. See [comments][builder_config]
in the builder configuration for more details.

To update this patchset for the new OT core version:

1. Checkout the contrib fork repo, add upstream as a remote, and pull the new version tag.

```bash
export CURRENT_VERSION=vX.X.X
export NEW_VERSION=vY.Y.Y
export SUFFIX=patches
git clone https://github.com/SumoLogic/opentelemetry-collector-contrib && cd opentelemetry-collector-contrib
git remote add upstream https://github.com/open-telemetry/opentelemetry-collector-contrib
git pull upstream "${NEW_VERSION}" "${CURRENT_VERSION}"
```

1. Create a new branch for the patchset and rebase it on the new version

```bash
git switch "${CURRENT_VERSION}-${SUFFIX}"
git checkout -b "${NEW_VERSION}-${SUFFIX}"
git rebase -i --onto "${NEW_VERSION}" "${CURRENT_VERSION}" "${NEW_VERSION}-${SUFFIX}"
```

1. Resolve conflicts and make sure tests and linters pass afterwards.
You can run them by invoking the following in the project root:

```bash
make install-tools
make golint
make gotest
```

If the command `make gotest` fails on unrelated tests, like for example `kafkareceiver`,
only run the tests for the changed modules:

```bash
export COMPONENTS=("receiver/hostmetricsreceiver" "receiver/mysqlreceiver" "receiver/apachesreceiver" "receiver/elasticsearchsreceiver")
for component in $COMPONENTS do; make -C $component test; done
```

1. Push the new branch to the fork repo and write down the commit SHA

```bash
git push origin "${NEW_VERSION}-${SUFFIX}"
```

1. Update the [builder configuration][builder_config] with the new commit SHA

### Updating OT distro

Expand Down Expand Up @@ -236,6 +288,7 @@ make update-journalctl
[tracing_tests]: ../.circleci/config.yml
[circleci]: https://app.circleci.com/pipelines/github/SumoLogic/sumologic-otel-collector
[circleci_approve]: ../images/circleci_approve_workflow.png
[contrib_fork]: https://github.com/SumoLogic/opentelemetry-collector-contrib
[changelog]: ../CHANGELOG.md
[upgrading]: ./Upgrading.md
[journaldreceiver]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.51.0/receiver/journaldreceiver
Expand All @@ -247,4 +300,3 @@ make update-journalctl
[#604]: https://github.com/SumoLogic/sumologic-otel-collector/pull/604/files
[OTC_release]: https://github.com/open-telemetry/opentelemetry-collector-contrib/releases
[OT_release]: https://github.com/open-telemetry/opentelemetry-collector/releases
[updating_patched]: https://github.com/SumoLogic/sumologic-otel-collector/blob/v0.57.2-sumo-0/docs/release.md#updating-patched-processors
8 changes: 8 additions & 0 deletions otelcolbuilder/.otelcol-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ replaces:
# Needed for telegrafreceiver
- github.com/influxdata/telegraf => github.com/SumoLogic/telegraf v1.22.0-sumo-4

# For now, cherry-picked changes are being used:
# commit: https://github.com/SumoLogic/opentelemetry-collector-contrib/commit/04ce767d9704265356687ebc47373266eb48aefc
# branch: https://github.com/SumoLogic/opentelemetry-collector-contrib/tree/v0.62.0-patches
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver => github.com/SumoLogic/opentelemetry-collector-contrib/receiver/hostmetricsreceiver 04ce767d9704265356687ebc47373266eb48aefc
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver => github.com/SumoLogic/opentelemetry-collector-contrib/receiver/apachereceiver 04ce767d9704265356687ebc47373266eb48aefc
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver => github.com/SumoLogic/opentelemetry-collector-contrib/receiver/mysqlreceiver 04ce767d9704265356687ebc47373266eb48aefc
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchsreceiver => github.com/SumoLogic/opentelemetry-collector-contrib/receiver/elasticsearchreceiver 04ce767d9704265356687ebc47373266eb48aefc

# Google renamed their org from `googleapis` to `google`, and for `gnostic` this happened in v0.5.6
# However, kubernetes/client-go still uses the old name for v0.5.5, and this causes go mod to complain
# Replace this here instead of modifying indirect dependencies in packages, as it's more robust
Expand Down

0 comments on commit 071e5be

Please sign in to comment.