Skip to content

Commit 02f535b

Browse files
authored
azl-otel-collector: Add azl-otel-collector to SPECS-EXTENDED (#13160)
1 parent 76a7ecc commit 02f535b

7 files changed

Lines changed: 222 additions & 1 deletion

File tree

LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSES-AND-NOTICES/SPECS/data/licenses.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,7 @@
22302230
"application-gateway-kubernetes-ingress",
22312231
"asc",
22322232
"azcopy",
2233+
"azl-otel-collector",
22332234
"azure-iot-sdk-c",
22342235
"azure-nvme-utils",
22352236
"azure-storage-cpp",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Azure Linux OTEL Collector
3+
After=network.target
4+
5+
[Service]
6+
Type=simple
7+
ExecStart=/usr/bin/azl-otelcol --config /etc/azl-otel-collector/config.yaml
8+
KillMode=process
9+
Restart=on-failure
10+
RestartSec=5s
11+
12+
[Install]
13+
WantedBy=multi-user.target
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"Signatures": {
3+
"azl-otel-collector-0.124.0.tar.gz": "2c11273db7045c693143cd2869e98b2a125362ff5f7adbade54af6f3e3a7f364",
4+
"azl-otel-collector-0.124.0-govendor-v1.tar.gz": "171aac80bf3965b647f13d6cb41d72365d7870d2672133148149b34086368147",
5+
"azl-otel-collector.service": "16d0fb39947318ca4912adc20613a79b88ec8ffae1bdb214001ac65a086d293c"
6+
}
7+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Disabled debuginfo package as the autogenerated 'debugfiles.list' file is empty.
2+
# In other words there were no debug symbols to package.
3+
%global debug_package %{nil}
4+
Summary: Azure Linux OpenTelemetry Collector Distribution
5+
Name: azl-otel-collector
6+
Version: 0.124.0
7+
Release: 1%{?dist}
8+
License: MIT
9+
Vendor: Microsoft Corporation
10+
Distribution: Azure Linux
11+
URL: https://github.com/microsoft/azl-otel-collector
12+
Source0: https://github.com/microsoft/azl-otel-collector/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
13+
Source1: %{name}-%{version}-govendor-v1.tar.gz
14+
Source2: azl-otel-collector.service
15+
BuildRequires: golang
16+
BuildRequires: systemd-rpm-macros
17+
18+
%description
19+
Azure Linux OpenTelemetry Collector is a custom distribution of the
20+
OpenTelemetry Collector. It contains a subset of the components from the
21+
https://github.com/open-telemetry/opentelemetry-collector-contrib repository and
22+
also includes receivers developed by the Azure Linux team.
23+
24+
%prep
25+
%autosetup -n azl-otel-collector-%{version}
26+
tar -xf %{SOURCE1} --no-same-owner -C cmd/azl-otelcol
27+
28+
%build
29+
export CGO_ENABLED=0
30+
%make_build MODFLAGS="-mod=vendor" BUILDTAGS="netgo osusergo static_build" LDFLAGS="-s -w" TRIMPATH=1
31+
32+
%install
33+
mkdir -p "%{buildroot}/%{_bindir}"
34+
install -D -m0755 bin/azl-otelcol %{buildroot}/%{_bindir}
35+
mkdir -p "%{buildroot}%{_unitdir}"
36+
install -D -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/azl-otel-collector.service
37+
mkdir -p "%{buildroot}%{_sysconfdir}/azl-otel-collector"
38+
install -D -m0644 config/default-config.yaml %{buildroot}%{_sysconfdir}/azl-otel-collector/config.yaml
39+
40+
%files
41+
%{_bindir}/azl-otelcol
42+
%license LICENSE
43+
%doc README.md
44+
45+
%package -n azl-otel-collector-service
46+
Summary: Systemd service and configuration for azl-otel-collector
47+
Requires: azl-otel-collector = %{version}-%{release}
48+
# Include the smartmontools package needed by the smartdata receiver in the collector
49+
Requires: smartmontools
50+
Requires(post): systemd
51+
52+
%description -n azl-otel-collector-service
53+
This package contains the systemd unit file and default configuration
54+
for the Azure Linux OpenTelemetry Collector.
55+
56+
%pre -n azl-otel-collector-service
57+
%systemd_preun azl-otel-collector.service
58+
59+
%post -n azl-otel-collector-service
60+
%systemd_post azl-otel-collector.service
61+
62+
%postun -n azl-otel-collector-service
63+
%systemd_postun_with_restart azl-otel-collector.service
64+
65+
%files -n azl-otel-collector-service
66+
%dir %{_sysconfdir}/azl-otel-collector
67+
%config(noreplace) %{_sysconfdir}/azl-otel-collector/config.yaml
68+
%{_unitdir}/azl-otel-collector.service
69+
70+
%changelog
71+
* Wed Apr 23 2025 Adit Jha <aditjha@microsoft.com> - 0.124.0-1
72+
- Original version for Azure Linux
73+
- License Verified
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!/bin/bash
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
5+
# Quit on failure
6+
set -e
7+
8+
PKG_VERSION=""
9+
SRC_TARBALL=""
10+
VENDOR_VERSION="1"
11+
OUT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
12+
13+
# parameters:
14+
#
15+
# --srcTarball : src tarball file
16+
# this file contains the 'initial' source code of the component
17+
# and should be replaced with the new/modified src code
18+
# --outFolder : folder where to copy the new tarball(s)
19+
# --pkgVersion : package version
20+
# --vendorVersion : vendor version
21+
#
22+
PARAMS=""
23+
while (( "$#" )); do
24+
case "$1" in
25+
--srcTarball)
26+
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
27+
SRC_TARBALL=$2
28+
shift 2
29+
else
30+
echo "Error: Argument for $1 is missing" >&2
31+
exit 1
32+
fi
33+
;;
34+
--outFolder)
35+
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
36+
OUT_FOLDER=$2
37+
shift 2
38+
else
39+
echo "Error: Argument for $1 is missing" >&2
40+
exit 1
41+
fi
42+
;;
43+
--pkgVersion)
44+
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
45+
PKG_VERSION=$2
46+
shift 2
47+
else
48+
echo "Error: Argument for $1 is missing" >&2
49+
exit 1
50+
fi
51+
;;
52+
--vendorVersion)
53+
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
54+
VENDOR_VERSION=$2
55+
shift 2
56+
else
57+
echo "Error: Argument for $1 is missing" >&2
58+
exit 1
59+
fi
60+
;;
61+
-*|--*=) # unsupported flags
62+
echo "Error: Unsupported flag $1" >&2
63+
exit 1
64+
;;
65+
*) # preserve positional arguments
66+
PARAMS="$PARAMS $1"
67+
shift
68+
;;
69+
esac
70+
done
71+
72+
echo "--srcTarball -> $SRC_TARBALL"
73+
echo "--outFolder -> $OUT_FOLDER"
74+
echo "--pkgVersion -> $PKG_VERSION"
75+
echo "--vendorVersion -> $VENDOR_VERSION"
76+
77+
if [ -z "$PKG_VERSION" ]; then
78+
echo "--pkgVersion parameter cannot be empty"
79+
exit 1
80+
fi
81+
82+
echo "-- create temp folder"
83+
tmpdir=$(mktemp -d)
84+
function cleanup {
85+
echo "+++ cleanup -> remove $tmpdir"
86+
rm -rf $tmpdir
87+
}
88+
trap cleanup EXIT
89+
90+
TARBALL_FOLDER="$tmpdir/tarballFolder"
91+
mkdir -p $TARBALL_FOLDER
92+
cp $SRC_TARBALL $tmpdir
93+
94+
pushd $tmpdir > /dev/null
95+
96+
PKG_NAME="azl-otel-collector"
97+
NAME_VER="$PKG_NAME-$PKG_VERSION"
98+
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-govendor-v$VENDOR_VERSION.tar.gz"
99+
100+
echo "Unpacking source tarball..."
101+
tar -xf $SRC_TARBALL
102+
103+
echo "Vendor go modules..."
104+
cd azl-otel-collector-"$PKG_VERSION"/cmd/azl-otelcol
105+
go mod vendor
106+
107+
echo ""
108+
echo "========================="
109+
echo "Tar vendored tarball"
110+
tar --sort=name \
111+
--mtime="2021-04-26 00:00Z" \
112+
--owner=0 --group=0 --numeric-owner \
113+
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
114+
-cf "$VENDOR_TARBALL" vendor
115+
116+
popd > /dev/null
117+
echo "$PKG_NAME vendored modules are available at $VENDOR_TARBALL"

cgmanifest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,16 @@
850850
}
851851
}
852852
},
853+
{
854+
"component": {
855+
"type": "other",
856+
"other": {
857+
"name": "azl-otel-collector",
858+
"version": "0.124.0",
859+
"downloadUrl": "https://github.com/microsoft/azl-otel-collector/archive/refs/tags/v0.124.0.tar.gz"
860+
}
861+
}
862+
},
853863
{
854864
"component": {
855865
"type": "other",

0 commit comments

Comments
 (0)