Skip to content

Commit

Permalink
chore: Upgrade otel core to v114 (#1714)
Browse files Browse the repository at this point in the history
* chore: Upgrade otel core to v114

* Remove the sumologic exporter after deprecation. The upstream sumologic exporter will be used

* Remove the deprecated syslog exporter after upstream API breaking changes

* Address API breaking changes in the collector processor

* Ensure that the otelcol builder version is correct

* Address API breaking changes in the receiver factory

* Removing deprecated links from Readme

* Get the correct version from the binary

* Fix an issue with the arguments passed to get_version_from_binary

* Use yq to edit the version in builder config. Also remove the version (v) prefix

* Adding the awskinesisexporter and updating go toolchain to 1.22.8

* Replace SED with YQ for updating the version in builder config
  • Loading branch information
rnishtala-sumo authored Dec 18, 2024
1 parent 0c5261b commit c36e934
Show file tree
Hide file tree
Showing 101 changed files with 3,263 additions and 10,963 deletions.
1 change: 1 addition & 0 deletions .changelog/1714.changed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chore: Upgrade otel core to v114
2 changes: 1 addition & 1 deletion .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
shell: bash

env:
GO_VERSION: "1.22.6"
GO_VERSION: "1.22.8"

jobs:
# Add lint to dev builds as that's the only way for cache to be shared across branches.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults:
shell: bash

env:
GO_VERSION: "1.22.6"
GO_VERSION: "1.22.8"

jobs:
build-changed:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defaults:
shell: bash

env:
GO_VERSION: "1.22.6"
GO_VERSION: "1.22.8"
VERSION: ${{ inputs.version }}

jobs:
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
run: |
binary=${{ steps.set-binary-name.outputs.binary_name }}
binary_path=otelcolbuilder/cmd/${binary}
./ci/get_version_from_binary.sh otc "${binary_path}"
./ci/get_version_from_binary.sh core "${binary_path}"
./ci/get_version_from_binary.sh sumo "${binary_path}"
- uses: apple-actions/import-codesign-certs@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defaults:
shell: bash

env:
GO_VERSION: "1.22.6"
GO_VERSION: "1.22.8"

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.6-alpine AS builder
FROM golang:1.22.8-alpine AS builder
ADD . /src
WORKDIR /src/otelcolbuilder/
ENV CGO_ENABLED=0
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ for-all:
check-uniform-dependencies:
./ci/check_uniform_dependencies.sh

OT_CORE_VERSION := $(shell grep "otelcol_version: .*" otelcolbuilder/.otelcol-builder.yaml | cut -f 4 -d " ")
OT_CORE_VERSION := $(shell grep "version: .*" otelcolbuilder/.otelcol-builder.yaml | cut -f 4 -d " ")
OT_CONTRIB_VERSION := $(shell grep --max-count=1 '^ - gomod: github\.com/open-telemetry/opentelemetry-collector-contrib/' otelcolbuilder/.otelcol-builder.yaml | cut -d " " -f 6 | $(SED) "s/v//")
# usage: make update-ot OT_CORE_NEW=x.x.x OT_CONTRIB_NEW=y.y.y
.PHONY: update-ot
update-ot: install-gsed
@test $(OT_CORE_NEW) || (echo "usage: make update-ot OT_CORE_NEW=x.x.x OT_CONTRIB_NEW=y.y.y"; exit 1);
@test $(OT_CONTRIB_NEW) || (echo "usage: make update-ot OT_CORE_NEW=x.x.x OT_CONTRIB_NEW=y.y.y"; exit 1);
@echo "Updating OT core from $(OT_CORE_VERSION) to $(OT_CORE_NEW) and OT contrib from $(OT_CONTRIB_VERSION) to $(OT_CONTRIB_NEW)"
$(SED) -i "s/\(otelcol_version:\) $(OT_CORE_VERSION)$$/\1 $(OT_CORE_NEW)/" otelcolbuilder/.otelcol-builder.yaml
$(SED) -i "s/\(go\.opentelemetry\.io\/collector\/.*\) v$(OT_CORE_VERSION)$$/\1 v$(OT_CORE_NEW)/" otelcolbuilder/.otelcol-builder.yaml
$(SED) -i "s/\(github\.com\/open-telemetry\/opentelemetry-collector-contrib\/.*\) v$(OT_CONTRIB_VERSION)$$/\1 v$(OT_CONTRIB_NEW)/" otelcolbuilder/.otelcol-builder.yaml
$(shell yq e ".dist.version = \"${OT_CORE_NEW}\"" -i otelcolbuilder/.otelcol-builder.yaml)
$(shell yq -i '(.. | select(tag=="!!str")) |= sub("(go\.opentelemetry\.io/collector.*) v${OT_CORE_VERSION}", "$$1 v${OT_CORE_NEW}")' otelcolbuilder/.otelcol-builder.yaml)
$(shell yq -i '(.. | select(tag=="!!str")) |= sub("(github\.com/open-telemetry/opentelemetry-collector-contrib.*) v${OT_CONTRIB_VERSION}", "$$1 v${OT_CONTRIB_NEW}")' otelcolbuilder/.otelcol-builder.yaml)
$(SED) -i "s/$(OT_CORE_VERSION)/$(OT_CORE_NEW)/" otelcolbuilder/Makefile
$(SED) -i "s/\(collector\/\(blob\|tree\)\/v\)$(OT_CORE_VERSION)/\1$(OT_CORE_NEW)/" \
README.md \
Expand Down
476 changes: 238 additions & 238 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ci/build-fips-action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV TARGETARCH=$TARGETARCH

RUN yum groupinstall -y "Development Tools" && yum install -y curl git

RUN curl -Lo go.tar.gz https://go.dev/dl/go1.22.6.linux-$TARGETARCH.tar.gz
RUN curl -Lo go.tar.gz https://go.dev/dl/go1.22.8.linux-$TARGETARCH.tar.gz
RUN tar -zxvf go.tar.gz -C /usr/local
ENV PATH="/usr/local/go/bin:${PATH}"

Expand Down
2 changes: 1 addition & 1 deletion ci/get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ parse_params() {

parse_core_version() {
config="otelcolbuilder/.otelcol-builder.yaml"
regex='s/.*otelcol_version:[ ]+([0-9]+\.[0-9]+\.[0-9]+).*/\1/p'
regex='s/.*version:[ ]+([0-9]+\.[0-9]+\.[0-9]+).*/\1/p'
version="$(sed -En "${regex}" "${config}")"

if [[ -z "${version}" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion ci/get_version_from_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ parse_version() {

output="$(${binary_path} --version)"

regex=".* ([0-9]+)\.([0-9]+)\.([0-9]+)\-sumo\-([0-9]+).*"
regex="otelcol-sumo version v?([0-9]+)\.([0-9]+)\.([0-9]+)\-sumo\-([0-9]+).*"

if [[ $output =~ $regex ]]; then
major_version="${BASH_REMATCH[1]}"
Expand Down
2 changes: 1 addition & 1 deletion ci/plugins_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ readonly GREP=grep
fi

readonly BUILDER_CONFIG="otelcolbuilder/.otelcol-builder.yaml"
OT_VERSION=$(yq e '.dist.otelcol_version' "${BUILDER_CONFIG}" | cut -f1,2 -d'.')
OT_VERSION=$(yq e '.dist.version' "${BUILDER_CONFIG}" | cut -f1,2 -d'.')
readonly OT_VERSION
readonly CONTRIB_PLUGIN_HTTP_URL_REGEX="https://github.com/open-telemetry/opentelemetry-collector(-contrib)?/tree/(v[0-9]+.[0-9]+.[0-9]+)/(receiver|processor|exporter|extension)/([a-zA-Z]+)"
readonly CONTRIB_PLUGIN_REGEX="github.com/open-telemetry/opentelemetry-collector(-contrib)?/(receiver|processor|exporter|extension)/([a-zA-Z]+)"
Expand Down
28 changes: 14 additions & 14 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ to persist the position in the files it reads between restarts.

See section below on [Collecting logs from files](#collecting-logs-from-files) for details on configuring the Filelog receiver.

[filestorageextension_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.108.0/extension/storage/filestorage
[filestorageextension_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.114.0/extension/storage/filestorage

### Basic configuration for metrics

Expand Down Expand Up @@ -196,7 +196,7 @@ service:
exporters: [sumologic]
```

[hostmetricsreceiver_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.108.0/receiver/hostmetricsreceiver/README.md
[hostmetricsreceiver_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.114.0/receiver/hostmetricsreceiver/README.md

### Basic configuration for traces

Expand Down Expand Up @@ -225,7 +225,7 @@ service:
exporters: [sumologic]
```

[otlpreceiver_readme]: https://github.com/open-telemetry/opentelemetry-collector/tree/v0.108.0/receiver/otlpreceiver
[otlpreceiver_readme]: https://github.com/open-telemetry/opentelemetry-collector/tree/v0.114.0/receiver/otlpreceiver

### Putting it all together

Expand Down Expand Up @@ -324,9 +324,9 @@ so keep in mind that to store credentials either the user needs a home directory
More information about this feature can be found in the [extension's documentation][sumologicextension_store_credentials].

[sumologic_webpage]: https://www.sumologic.com/
[sumologicextension]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.108.0/extension/sumologicextension
[sumologicexporter]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.108.0/exporter/sumologicexporter
[hostmetricsreceiver]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.108.0/receiver/hostmetricsreceiver
[sumologicextension]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.114.0/extension/sumologicextension
[sumologicexporter]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.114.0/exporter/sumologicexporter
[hostmetricsreceiver]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.114.0/receiver/hostmetricsreceiver
[sumologicextension_configuration]: ../pkg/extension/sumologicextension#configuration
[sumologicextension_store_credentials]: ../pkg/extension/sumologicextension/README.md#storing-credentials

Expand Down Expand Up @@ -421,7 +421,7 @@ service:
- hostmetrics
```

[sumologicexporter_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.108.0/exporter/sumologicexporter/README.md
[sumologicexporter_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.114.0/exporter/sumologicexporter/README.md

## Collecting logs from files

Expand Down Expand Up @@ -532,8 +532,8 @@ Flags: 0
Example configuration with example log can be found in [/examples/otelcolconfigs/logs_json/](/examples/otelcolconfigs/logs_json/) directory.

[json_parser]: https://github.com/open-telemetry/opentelemetry-log-collection/blob/main/docs/operators/json_parser.md
[filelogreceiver_readme]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.108.0/receiver/filelogreceiver
[debugexporter_docs]: https://github.com/open-telemetry/opentelemetry-collector/tree/v0.108.0/exporter/debugexporter
[filelogreceiver_readme]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.114.0/receiver/filelogreceiver
[debugexporter_docs]: https://github.com/open-telemetry/opentelemetry-collector/tree/v0.114.0/exporter/debugexporter

## Setting source category

Expand Down Expand Up @@ -650,7 +650,7 @@ The first example creates a `_sourceCategory` label with a hardcoded value of `d
The second example creates a `_sourceCategory` label by copying to it the value of Prometheus' `job` label,
which contains the name of the job - in this case, `otelcol-metrics`.

[prometheusreceiver_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.108.0/receiver/prometheusreceiver/README.md
[prometheusreceiver_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.114.0/receiver/prometheusreceiver/README.md
[prometheus_website]: https://prometheus.io/
[prometheus_relabel_config]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config

Expand Down Expand Up @@ -706,7 +706,7 @@ service:
- statsd/another-app
```

[resourceprocessor_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.108.0/processor/resourceprocessor/README.md
[resourceprocessor_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.114.0/processor/resourceprocessor/README.md

## Setting source host

Expand Down Expand Up @@ -778,8 +778,8 @@ Only the first Resource processor's action is required to correctly set the `_so
The other two actions perform an optional metadata cleanup - they delete the unneeded attributes.

[sumologic_source_host_docs]: https://help.sumologic.com/docs/send-data/reference-information/metadata-naming-conventions#source-host
[resourcedetectionprocessor_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.108.0/processor/resourcedetectionprocessor/README.md
[resourcedetectionprocessor_system_detector]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.108.0/processor/resourcedetectionprocessor/README.md#system-metadata
[resourcedetectionprocessor_docs]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.114.0/processor/resourcedetectionprocessor/README.md
[resourcedetectionprocessor_system_detector]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.114.0/processor/resourcedetectionprocessor/README.md#system-metadata

## Command-line configuration options

Expand Down Expand Up @@ -850,5 +850,5 @@ service:
# ...
```

[metricstransformprocessor]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.108.0/processor/metricstransformprocessor
[metricstransformprocessor]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.114.0/processor/metricstransformprocessor
[prometheus_data_model]: https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
Loading

0 comments on commit c36e934

Please sign in to comment.