Skip to content

Commit

Permalink
[opentelemetry-integration] Upgrade Collector on Windows values to `0…
Browse files Browse the repository at this point in the history
….117.0` (#500)

Fixes ES-408.

- Upgrades the Collector in our Windows values file to `0.117.0`.
- Update some missing/divergent things in the Windows tailsampling values file.
  - Mention a breaking changes in the Windows values files.
- Make the Windows 2019 image build with the latest respective LTSC release.

🚨 **Breaking change** 🚨

This upgrade has the same breaking change as mentioned in the CHANGELOG entry.
  • Loading branch information
douglascamata authored Jan 9, 2025
1 parent d80e839 commit dc78a8c
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 21 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/otel-collector-windows-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,14 +18,14 @@ jobs:
uses: actions/[email protected]

- 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

Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions otel-collector-windows-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

##
Expand Down
21 changes: 21 additions & 0 deletions otel-collector-windows-image/Makefile
Original file line number Diff line number Diff line change
@@ -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
11 changes: 9 additions & 2 deletions otel-collector-windows-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<semantic_version>`
- For Windows 2022: `coralogixrepo/opentelemetry-collector-contrib-windows:<semantic_version>-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 <your_tag> .
# For other possible make targets please check the Makefile.
make win2022
```
8 changes: 8 additions & 0 deletions otel-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion otel-integration/k8s-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions otel-integration/k8s-helm/values-windows-tailsampling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions otel-integration/k8s-helm/values-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion otel-integration/k8s-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ global:
defaultSubsystemName: "integration"
logLevel: "warn"
collectionInterval: "30s"
version: "0.0.134"
version: "0.0.135"

extensions:
kubernetesDashboard:
Expand Down

0 comments on commit dc78a8c

Please sign in to comment.