diff --git a/.github/workflows/otel-collector-windows-image.yml b/.github/workflows/otel-collector-windows-image.yml index b19e4611..cfdb3339 100644 --- a/.github/workflows/otel-collector-windows-image.yml +++ b/.github/workflows/otel-collector-windows-image.yml @@ -4,8 +4,8 @@ on: push: branches: master paths: - - 'otel-collector-windows-image/Dockerfile' - - '.github/workflows/otel-collector-windows-image.yml' + - "otel-collector-windows-image/Dockerfile" + - ".github/workflows/otel-collector-windows-image.yml" env: DOCKERHUB_REGISTRY: coralogixrepo/opentelemetry-collector-contrib-windows @@ -18,14 +18,14 @@ jobs: uses: actions/checkout@v2.4.0 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v1 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -40,11 +40,8 @@ jobs: context: ./otel-collector-windows-image/ platforms: windows/amd64 push: true - # For Windows 2019, we need to pin to specific sha256, in order to work around - # issue https://github.com/microsoft/Windows-Containers/issues/493. Once it's fixed, - # it can be removed. - build-args: | - WIN_BASE_IMAGE=mcr.microsoft.com/windows/servercore:1809@sha256:6fdf140282a2f809dae9b13fe441635867f0a27c33a438771673b8da8f3348a4 + build-args: | + WIN_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2019 tags: | ${{ env.DOCKERHUB_REGISTRY }}:${{ steps.set-image-version.outputs.version }} ${{ env.DOCKERHUB_REGISTRY }}:latest diff --git a/otel-collector-windows-image/Dockerfile b/otel-collector-windows-image/Dockerfile index 4fe26e57..94a25e70 100644 --- a/otel-collector-windows-image/Dockerfile +++ b/otel-collector-windows-image/Dockerfile @@ -1,9 +1,10 @@ # escape=` -ARG WIN_BASE_IMAGE +# For Windows 2022, use `mcr.microsoft.com/windows/servercore:ltsc2022` +ARG WIN_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2019 FROM --platform=$BUILDPLATFORM curlimages/curl AS build WORKDIR /src -RUN curl -Lo otelcol.tar.gz https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.106.1/otelcol-contrib_0.106.1_windows_amd64.tar.gz +RUN curl -Lo otelcol.tar.gz https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.117.0/otelcol-contrib_0.117.0_windows_amd64.tar.gz RUN tar -xzvf otelcol.tar.gz ## diff --git a/otel-collector-windows-image/Makefile b/otel-collector-windows-image/Makefile new file mode 100644 index 00000000..1ce534b3 --- /dev/null +++ b/otel-collector-windows-image/Makefile @@ -0,0 +1,21 @@ +IMAGE_REPOSITORY ?= otel-col +IMAGE_TAG ?= +# A Windows version to build for. Supported values are `2019` and `2022`. +WIN_VERSION ?= +# This can be `--load` to just build the image and do nothing. +# It can also be `--push` to build and push the image. +POST_BUILD ?= --load + +.phony: build-image +build-image: + docker buildx build ${POST_BUILD} --platform windows/amd64 --build-arg WIN_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc${WIN_VERSION} -t ${IMAGE_REPOSITORY}:${IMAGE_TAG} . + +.phony: win2019 +win2019: WIN_VERSION=2019 +win2019: IMAGE_TAG=win2019 +win2019: build-image + +.phony: win2022 +win2022: WIN_VERSION=2022 +win2022: IMAGE_TAG=win2022 +win2022: build-image diff --git a/otel-collector-windows-image/README.md b/otel-collector-windows-image/README.md index dccc3725..4c53d9ef 100644 --- a/otel-collector-windows-image/README.md +++ b/otel-collector-windows-image/README.md @@ -5,22 +5,29 @@ This is an (unofficial) Docker image for the OpenTelemetry Collector Contrib dis These images are published on [Docker Hub](https://hub.docker.com/r/coralogixrepo/opentelemetry-collector-contrib-windows). The tag version always corresponds to the official OpenTelemetry Collector release version. Depending on your Windows server version you can use images: + - For Windows 2019: `coralogixrepo/opentelemetry-collector-contrib-windows:latest`, `coralogixrepo/opentelemetry-collector-contrib-windows:` - For Windows 2022: `coralogixrepo/opentelemetry-collector-contrib-windows:-windows2022` Images are only available for the `amd64` platform. +## Build dependencies + +1. `docker buildx` + ## Building Windows image on MacOS / Linux It's possible to build the image from the Dockerfile in this directory, with following steps: + 1. Create a new buildx builder: ``` -docker buildx create --name img-builder --use --driver docker-container --driver-opt image=moby/buildkit:v0.9.3 +docker buildx create --name img-builder --use --driver docker-container ``` 2. Build the image for Windows platform: ``` -docker buildx build --load --platform windows/amd64 -t . +# For other possible make targets please check the Makefile. +make win2022 ``` diff --git a/otel-integration/CHANGELOG.md b/otel-integration/CHANGELOG.md index 2851efee..355ad45a 100644 --- a/otel-integration/CHANGELOG.md +++ b/otel-integration/CHANGELOG.md @@ -2,6 +2,14 @@ ## OpenTelemtry-Integration +### v0.0.135 / 2025-01-09 + +- [Feat] Bump Windows 2019 image to the latest LTSC image for such version +- [:warning: Change][Feat] Bump Collector version in Windows nodes to `0.116.0` + If you're using the Windows tailsampling values, please see the note about change in behavior in [`the 0.89.0 to 0.90.0 section of UPGRADING.md`](./UPGRADING.md#0089-to-0090). + The default Windows values is NOT affected.. +- [Fix] Update some missing/divergent configuration in the Windows tailsampling values file + ### v0.0.134 / 2025-01-09 - [Feat] Upgrade OpenTelemetry Collector to `0.117.0` diff --git a/otel-integration/k8s-helm/Chart.yaml b/otel-integration/k8s-helm/Chart.yaml index 879576df..b574c13c 100644 --- a/otel-integration/k8s-helm/Chart.yaml +++ b/otel-integration/k8s-helm/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: otel-integration description: OpenTelemetry Integration -version: 0.0.134 +version: 0.0.135 keywords: - OpenTelemetry Collector - OpenTelemetry Agent diff --git a/otel-integration/k8s-helm/values-windows-tailsampling.yaml b/otel-integration/k8s-helm/values-windows-tailsampling.yaml index 58e8b3da..d8a30319 100644 --- a/otel-integration/k8s-helm/values-windows-tailsampling.yaml +++ b/otel-integration/k8s-helm/values-windows-tailsampling.yaml @@ -23,7 +23,7 @@ opentelemetry-agent-windows: repository: coralogixrepo/opentelemetry-collector-contrib-windows pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "0.97.0" + tag: "0.116.0" # When digest is set to a non-empty value, images will be pulled by digest (regardless of tag value). digest: "" extraVolumes: @@ -210,7 +210,8 @@ opentelemetry-agent-windows: resource: # Supress this attribute, as we don't want the UUID of the collector to be sent, # instead we rely on instance label generated by Prometheus receiver. - - service.instance.id: + service.instance.id: + service.name: logs: level: "{{ .Values.global.logLevel }}" encoding: json diff --git a/otel-integration/k8s-helm/values-windows.yaml b/otel-integration/k8s-helm/values-windows.yaml index 58eb92a6..03223966 100644 --- a/otel-integration/k8s-helm/values-windows.yaml +++ b/otel-integration/k8s-helm/values-windows.yaml @@ -23,10 +23,10 @@ opentelemetry-agent-windows: repository: coralogixrepo/opentelemetry-collector-contrib-windows pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "0.104.0" + tag: "0.116.0" # When digest is set to a non-empty value, images will be pulled by digest (regardless of tag value). digest: "" - + extraVolumes: - name: etcmachineid hostPath: @@ -268,8 +268,8 @@ opentelemetry-agent-windows: resource: # Supress this attribute, as we don't want the UUID of the collector to be sent, # instead we rely on instance label generated by Prometheus receiver. - - service.instance.id: - - service.name: + service.instance.id: + service.name: logs: level: "{{ .Values.global.logLevel }}" encoding: json diff --git a/otel-integration/k8s-helm/values.yaml b/otel-integration/k8s-helm/values.yaml index 64ab130b..11573dba 100644 --- a/otel-integration/k8s-helm/values.yaml +++ b/otel-integration/k8s-helm/values.yaml @@ -5,7 +5,7 @@ global: defaultSubsystemName: "integration" logLevel: "warn" collectionInterval: "30s" - version: "0.0.134" + version: "0.0.135" extensions: kubernetesDashboard: