Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove telegraf and use only fluent-bit for telemetry #1030

Open
wants to merge 75 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
dec238f
get build with new fluent-bit
gracewehner Dec 2, 2024
ed96e0b
update branch name
gracewehner Dec 2, 2024
890a1ad
support mariner
gracewehner Dec 2, 2024
bd51464
fix download
gracewehner Dec 2, 2024
a421f17
install normally
gracewehner Dec 2, 2024
8c0d65e
telegraf to file
gracewehner Dec 2, 2024
9c03ffa
get latest fluent-bit
gracewehner Dec 2, 2024
c3aeb9f
add process metrics from fluent-bit
gracewehner Dec 3, 2024
2cc0010
add back in telegraf
gracewehner Dec 3, 2024
759e167
use correct mem value
gracewehner Dec 4, 2024
beb425f
add in extra dimensions
gracewehner Dec 5, 2024
2b5102b
remove telegraf cpu/mem
gracewehner Dec 5, 2024
a5228b2
dont start telegraf
gracewehner Dec 5, 2024
b07f6aa
unrelated telemetry fixes
gracewehner Dec 5, 2024
9a0bff3
build custom fluent-bit
gracewehner Dec 6, 2024
562b7cc
add in metrics
gracewehner Dec 6, 2024
78efb86
fix path to cmake options
gracewehner Dec 6, 2024
44d3b26
missed file
gracewehner Dec 6, 2024
7036b98
fluent-bit version
gracewehner Dec 6, 2024
3710e9f
remove other fluent-bit reference
gracewehner Dec 6, 2024
a0436ce
remove process printing, add metrics printing
gracewehner Dec 6, 2024
9e4ce53
settings
gracewehner Dec 6, 2024
b29e4d0
remove db
gracewehner Dec 6, 2024
ed39e3c
remove printing metrics
gracewehner Dec 7, 2024
827bece
use metrics selector
gracewehner Dec 12, 2024
6e69eca
fix decoding to have ns and ss
gracewehner Dec 12, 2024
6be8680
change daemonset
gracewehner Dec 12, 2024
4ba0db8
match exact telemetry name
gracewehner Dec 12, 2024
118cd88
include all changed files
gracewehner Dec 12, 2024
10c6d1b
completely remove telegraf
gracewehner Dec 12, 2024
ce3180e
fix daemonset spacing
gracewehner Dec 12, 2024
f250ff3
change labels to string
gracewehner Dec 12, 2024
6365603
remove db references
gracewehner Dec 12, 2024
98c4fca
install newer fluent-bit
gracewehner Dec 12, 2024
61145b9
typo fix
gracewehner Dec 13, 2024
600cd5c
update to build windows
gracewehner Dec 13, 2024
0a7116d
add all env vars
gracewehner Dec 13, 2024
23b1f40
add in missing telemetry
gracewehner Dec 13, 2024
c8f74a6
turn on label processor
gracewehner Dec 13, 2024
280f86c
accept for daemonset too
gracewehner Dec 13, 2024
9f3bdbc
fix windows pid finder
gracewehner Dec 13, 2024
667c5b5
cleanup
gracewehner Dec 14, 2024
fdde68f
fixes
gracewehner Dec 14, 2024
e11b82b
fix OS_TYPE
gracewehner Dec 14, 2024
520d3f7
add debugging logs
gracewehner Dec 15, 2024
a2ca7ed
extra logging
gracewehner Dec 15, 2024
3108e4e
fix
gracewehner Dec 16, 2024
245904a
Merge branch 'main' into grace/telegraf-removal-2024
gracewehner Jan 31, 2025
3f7c837
address feedback
gracewehner Jan 31, 2025
6b8077f
remove branch
gracewehner Jan 31, 2025
0b1b06a
missed file
gracewehner Jan 31, 2025
cd3119b
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 1, 2025
651a56e
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 1, 2025
c00833c
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
3e7d071
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
03d4c51
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
9dd82ec
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
b43406a
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
5812ea6
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
88ab6b4
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
b6d81a0
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 2, 2025
cd2ca85
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 3, 2025
47d76e8
Update azure-pipeline-build.yml for Azure Pipelines
gracewehner Feb 3, 2025
c8c8eb2
trivyignore
gracewehner Feb 3, 2025
85ef841
Merge branch 'grace/telegraf-removal-2024' of https://github.com/Azur…
gracewehner Feb 3, 2025
dffe0c7
cleanup
gracewehner Feb 3, 2025
dc0680a
trivy exit code
gracewehner Feb 3, 2025
ef73cc7
add for targetallocator
gracewehner Feb 3, 2025
5a9c144
golang version
gracewehner Feb 3, 2025
1ba3219
update node-exporter image to what we're using
gracewehner Feb 3, 2025
f8114b8
fix to sudo
gracewehner Feb 3, 2025
aca238b
trivy
gracewehner Feb 3, 2025
9fb8ae5
k-s-m trivy
gracewehner Feb 3, 2025
095e977
me path moved
gracewehner Feb 4, 2025
f374de2
remove branch for build
gracewehner Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 158 additions & 34 deletions .pipelines/azure-pipeline-build.yml

Large diffs are not rendered by default.

58 changes: 19 additions & 39 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -1,45 +1,25 @@
# CRITICAL
# telegraf
CVE-2024-41110
# kube-state-metrics
CVE-2024-24790
CVE-2024-45337 # golang.org/x/crypto
CVE-2024-24790 # stdlib
# HIGH
# telegraf
GHSA-7jwh-3vrq-q3m8
CVE-2024-27289
CVE-2024-27304
# otelcollector
CVE-2024-45338 # golang.org/x/net
# promconfigvalidator
CVE-2024-45338 # golang.org/x/net
# configurationreader
CVE-2024-45338 # golang.org/x/net
# targetallocator
CVE-2024-45338 # golang.org/x/net
# kube-state-metrics
CVE-2024-34156
# node-exporter
CVE-2023-39325
CVE-2023-29403
CVE-2023-39325
CVE-2023-45283
CVE-2024-45338 # golang.org/x/net
CVE-2024-34156 # stdlib
# MEDIUM
# telegraf
CVE-2024-35255
CVE-2024-28110
CVE-2024-24557
CVE-2024-29018
CVE-2023-45288
CVE-2024-24786
# kube-state-metrics
CVE-2024-24789
CVE-2024-24791
CVE-2024-34155
CVE-2024-34158
# node-exporter
CVE-2023-48795
CVE-2023-3978
CVE-2023-44487
CVE-2023-29406
CVE-2023-29409
CVE-2023-39318
CVE-2023-39319
CVE-2023-39326
CVE-2023-45284
CVE-2023-45289
CVE-2023-45290
CVE-2024-24783
CVE-2024-24784
CVE-2024-24785
CVE-2023-45288 # stdlib
CVE-2024-24789 # stdlib
CVE-2024-24791 # stdlib
CVE-2024-34155 # stdlib
CVE-2024-34158 # stdlib
CVE-2024-45336 # stdlib
CVE-2024-45341 # stdlib
51 changes: 43 additions & 8 deletions otelcollector/build/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,39 @@ RUN apt-get update && apt-get install gcc-aarch64-linux-gnu -y
ARG TARGETOS TARGETARCH
RUN if [ "$TARGETARCH" = "arm64" ] ; then CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildmode=exe -ldflags '-linkmode external -extldflags=-Wl,-z,now' -o main.exe ./main.go ; else CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildmode=exe -ldflags '-linkmode external -extldflags=-Wl,-z,now' -o main.exe ./main.go ; fi

ARG TARGETARCH
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 AS fluent-bit-binary-builder
WORKDIR /
# Install with the same exact dependencies and code source that Mariner uses
RUN tdnf install wget tar ca-certificates bison cmake cyrus-sasl-devel doxygen flex gcc-c++ \
gnutls-devel graphviz libpq-devel libyaml-devel luajit-devel make openssl-devel pkgconfig \
systemd-devel systemd-rpm-macros zlib-devel build-essential -y
ARG FLUENT_BIT_VERSION
RUN wget https://github.com/fluent/fluent-bit/archive/refs/tags/v${FLUENT_BIT_VERSION}.tar.gz
RUN tar -xvf v${FLUENT_BIT_VERSION}.tar.gz
# Add a file with settings to build only the plugins we use
COPY ./fluent-bit/plugins_options.cmake /fluent-bit-${FLUENT_BIT_VERSION}/cmake/plugins_options.cmake
# Make a change that allows Fluent-Bit metrics to flow to our Go output plugin
RUN sed -i '/out->type = FLB_OUTPUT_PLUGIN_PROXY;/a \ \ \ \ out->event_type = FLB_OUTPUT_LOGS | FLB_OUTPUT_METRICS;' /fluent-bit-${FLUENT_BIT_VERSION}/src/flb_plugin_proxy.c
WORKDIR /fluent-bit-${FLUENT_BIT_VERSION}/build
# Run cmake with the same flags that Mariner uses
RUN cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DFLB_EXAMPLES=Off \
-DFLB_OUT_SLACK=Off \
-DFLB_IN_SYSTEMD=On \
-DFLB_OUT_TD=Off \
-DFLB_OUT_ES=Off \
-DFLB_SHARED_LIB=On \
-DFLB_RELEASE=On \
-DFLB_DEBUG=Off \
-DFLB_TLS=On \
-DFLB_JEMALLOC=On \
-DFLB_PREFER_SYSTEM_LIBS=On \
-DFLB_PROXY_GO=On ../
RUN make
RUN make install

FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 as builder
LABEL description="Azure Monitor Prometheus metrics collector"
LABEL maintainer="[email protected]"
Expand Down Expand Up @@ -103,9 +136,11 @@ COPY --from=main-builder --chmod=777 /main/main.exe $tmpdir/main

COPY ./scripts/*.sh $tmpdir/
COPY ./metricextension/me.config ./metricextension/me_internal.config ./metricextension/me_ds.config ./metricextension/me_ds_internal.config /usr/sbin/
COPY ./telegraf/ $tmpdir/telegraf/
COPY ./fluent-bit/fluent-bit.conf ./fluent-bit/fluent-bit-daemonset.conf ./fluent-bit/fluent-bit-parsers.conf $tmpdir/fluent-bit/
COPY ./fluent-bit/fluent-bit.yaml ./fluent-bit/fluent-bit-daemonset.yaml ./fluent-bit/fluent-bit-parsers.conf $tmpdir/fluent-bit/
COPY --from=fluent-bit-builder /src/out_appinsights.so $tmpdir/fluent-bit/bin/
COPY --from=fluent-bit-binary-builder /usr/local/bin/fluent-bit /usr/local/bin/fluent-bit
COPY --from=fluent-bit-binary-builder /usr/local/etc/fluent-bit /usr/local/etc/fluent-bit
COPY --from=fluent-bit-binary-builder /usr/local/lib/fluent-bit /usr/local/etc/fluent-bit
COPY ./react /static/react
COPY ./LICENSE $tmpdir/microsoft
COPY ./NOTICE $tmpdir/microsoft
Expand All @@ -123,7 +158,7 @@ RUN chmod 775 $tmpdir/*.sh;
RUN sync;
RUN $tmpdir/setup.sh ${TARGETARCH}
# If wanting to run without distroless, uncomment this line and comment everything after
# CMD [ "/opt/main.sh" ]
# ENTRYPOINT ["./opt/main"]

FROM mcr.microsoft.com/cbl-mariner/distroless/base:2.0
# Below is for ContainerInsightsPrometheusCollector-Prod AppInsights Resource
Expand Down Expand Up @@ -169,8 +204,6 @@ COPY --from=builder /usr/sbin/MetricsExtension /usr/sbin/MetricsExtension
COPY --from=builder /usr/bin/inotifywait /usr/bin/inotifywait
COPY --from=builder /usr/bin/bash /usr/bin/bash
COPY --from=builder /usr/sbin/busybox /usr/sbin/busybox
COPY --from=builder /usr/bin/fluent-bit /usr/bin/fluent-bit
COPY --from=builder /usr/bin/telegraf /usr/bin/telegraf
COPY --from=builder /usr/sbin/crond /usr/sbin/crond
COPY --from=builder /usr/bin/vim /usr/bin/vim
COPY --from=builder /usr/share/vim /usr/share/vim
Expand All @@ -183,6 +216,10 @@ COPY --from=builder /bin/sh /bin/sh
COPY --from=builder /usr/bin/p11-kit /usr/bin
COPY --from=builder /usr/bin/trust /usr/bin

COPY --from=fluent-bit-binary-builder /usr/local/bin/fluent-bit /usr/local/bin/fluent-bit
COPY --from=fluent-bit-binary-builder /usr/local/etc/fluent-bit /usr/local/etc/fluent-bit
COPY --from=fluent-bit-binary-builder /usr/local/lib/fluent-bit /usr/local/etc/fluent-bit

# bash dependencies
COPY --from=builder /lib/libreadline.so.8 /lib/
COPY --from=builder /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.6 /usr/lib/
Expand All @@ -198,9 +235,7 @@ COPY --from=builder /lib/libboost_filesystem.so.1.76.0 /lib/libcpprest.so.2.10
COPY --from=builder /lib64/libuuid.so.1 /lib64
# fluent-bit dependencies
# libssl.so.1.1 & libcrypto.so.1.1 are already available with openssl in distroless and copying them over causes FIPS HMAC verification failures
COPY --from=builder /lib/libyaml-0.so.2 /lib/libsystemd.so.0 /lib/libcurl.so.4 /lib/libm.so.6 /lib/libz.so.1 /lib/libzstd.so.1 /lib/libsasl2.so.3 /lib/libgcc_s.so.1 /lib/libc.so.6 /lib/liblzma.so.5 /lib/liblz4.so.1 /lib/libcap.so.2 /lib/libgcrypt.so.20 /lib/libnghttp2.so.14 /lib/libssh2.so.1 /lib/libgssapi_krb5.so.2 /lib/libresolv.so.2 /lib/libgpg-error.so.0 /usr/lib/libkrb5.so.3 /usr/lib/libk5crypto.so.3 /usr/lib/libcom_err.so.2 /usr/lib/libkrb5support.so.0 /lib/
# telegraf dependencies
COPY --from=builder /lib/libc.so.6 /lib/
COPY --from=fluent-bit-binary-builder /lib/libluajit-5.1.so.2 /lib/libyaml-0.so.2 /lib/libsystemd.so.0 /lib/libgcc_s.so.1 /lib/libc.so.6 /lib/liblzma.so.5 /lib/libzstd.so.1 /lib/liblz4.so.1 /lib/libcap.so.2 /lib/libgcrypt.so.20 /lib/libgpg-error.so.0 /lib/
# mdsd dependencies
COPY --from=builder /usr/lib/libdl.so.2 /usr/lib/librt.so.1 /usr/lib/libpthread.so.0 /usr/lib/libm.so.6 /usr/lib/libstdc++.so.6 /usr/lib/libgcc_s.so.1 /usr/lib/
# logrotate dependencies
Expand Down
1 change: 0 additions & 1 deletion otelcollector/build/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ COPY ./configmapparser/default-prom-configs/*.yml $tmpdir/microsoft/otelcollecto
COPY ./opentelemetry-collector-builder/otelcollector.exe ./opentelemetry-collector-builder/collector-config-default.yml ./opentelemetry-collector-builder/collector-config-template.yml $tmpdir/microsoft/otelcollector/
COPY ./prom-config-validator-builder/promconfigvalidator.exe $tmpdir/
COPY ./metricextension/me.config ./metricextension/me_internal.config ./metricextension/me_ds.config ./metricextension/me_ds_win.config ./metricextension/me_ds_internal.config ./metricextension/me_ds_internal_win.config $tmpdir/metricextension/
COPY ./telegraf/telegraf-prometheus-collector-windows.conf $tmpdir/telegraf/
COPY ./fluent-bit/fluent-bit-windows.conf $tmpdir/fluent-bit/
COPY ./fluent-bit/fluent-bit-parsers.conf $tmpdir/fluent-bit/
COPY ./fluent-bit/src/out_appinsights.so $tmpdir/fluent-bit/bin/
Expand Down
2 changes: 1 addition & 1 deletion otelcollector/build/windows/scripts/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Write-Host ('Installing Fluent Bit');
try {
# Keep version in sync with linux in setup.sh file
# $fluentBitUri = 'https://github.com/microsoft/OMS-docker/releases/download/winakslogagent/td-agent-bit-1.4.0-win64.zip'
$fluentBitUri = 'https://releases.fluentbit.io/2.1/fluent-bit-2.1.10-win64.zip'
$fluentBitUri = 'https://releases.fluentbit.io/3.0/fluent-bit-3.0.7-win64.zip'
Invoke-WebRequest -Uri $fluentBitUri -OutFile /installation/fluent-bit.zip
Expand-Archive -Path /installation/fluent-bit.zip -Destination /installation/fluent-bit
Move-Item -Path /installation/fluent-bit/*/bin/* -Destination /opt/fluent-bit/bin/ -ErrorAction SilentlyContinue
Expand Down
203 changes: 0 additions & 203 deletions otelcollector/fluent-bit/fluent-bit-daemonset.conf

This file was deleted.

Loading
Loading