Skip to content

Commit 5d230cc

Browse files
committed
pmdaopentelemetry: new pmda for opentelemetry metrics
Addition of OpenTelemetry PMDA - domain num 88. Supports ingestion of OpenTelemetry data and conversion to PCP metrics. PMDA supports dynamic metric addition and removal congruent to source entries in the configuration directory. Relevent QA tests were added. Addition and update of new pmdaopentelemetry manpage.
1 parent 1f7e810 commit 5d230cc

35 files changed

+75808
-1
lines changed

build/rpm/GNUmakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ pcp.spec: pcp.spec.in
7676
-e's|@pmda_infiniband@|$(PMDA_INFINIBAND)|g' \
7777
-e's|@pmda_perfevent@|$(PMDA_PERFEVENT)|g' \
7878
-e's|@pmda_openmetrics@|$(PMDA_OPENMETRICS)|g' \
79+
-e's|@pmda_opentelemetry@|$(PMDA_OPENTELEMETRY)|g' \
7980
-e's|@pmda_libvirt@|$(PMDA_LIBVIRT)|g' \
8081
-e's|@pmda_lio@|$(PMDA_LIO)|g' \
8182
-e's|@pmda_json@|$(PMDA_JSON)|g' \

configure

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ QMAKE
827827
PMDA_RESCTRL
828828
PMDA_LIBVIRT
829829
PMDA_MSSQL
830+
PMDA_OPENTELEMETRY
830831
PMDA_OPENMETRICS
831832
PMDA_LIO
832833
PMDA_NUTCRACKER
@@ -9720,6 +9721,19 @@ if $pmda_openmetrics; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
97209721
printf "%s\n" "yes" >&6; }; else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
97219722
printf "%s\n" "no" >&6; }; fi
97229723

9724+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the OpenTelemetry PMDA should be included" >&5
9725+
printf %s "checking if the OpenTelemetry PMDA should be included... " >&6; }
9726+
pmda_opentelemetry=false
9727+
if test "$have_python" = true
9728+
then
9729+
$have_python_requests && $have_python_OrderedDict && pmda_opentelemetry=true
9730+
fi
9731+
PMDA_OPENTELEMETRY=$pmda_opentelemetry
9732+
9733+
if $pmda_opentelemetry; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9734+
printf "%s\n" "yes" >&6; }; else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
9735+
printf "%s\n" "no" >&6; }; fi
9736+
97239737
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the SQL Server PMDA should be included" >&5
97249738
printf %s "checking if the SQL Server PMDA should be included... " >&6; }
97259739
pmda_mssql=false

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1414
dnl for more details.
1515
dnl
1616

17+
configopts="`rpmbuild --eval '--exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --prefix=%{_prefix}' 2>/dev/null`"
18+
1719
dnl unpacking check - this file must exist
1820
AC_INIT
1921
AC_CONFIG_SRCDIR([src/include/pcp/pmapi.h])
@@ -1522,6 +1524,15 @@ fi
15221524
AC_SUBST(PMDA_OPENMETRICS, $pmda_openmetrics)
15231525
if $pmda_openmetrics; then AC_MSG_RESULT(yes); else AC_MSG_RESULT(no); fi
15241526

1527+
AC_MSG_CHECKING([if the OpenTelemetry PMDA should be included])
1528+
pmda_opentelemetry=false
1529+
if test "$have_python" = true
1530+
then
1531+
$have_python_requests && $have_python_OrderedDict && pmda_opentelemetry=true
1532+
fi
1533+
AC_SUBST(PMDA_OPENTELEMETRY, $pmda_opentelemetry)
1534+
if $pmda_opentelemetry; then AC_MSG_RESULT(yes); else AC_MSG_RESULT(no); fi
1535+
15251536
AC_MSG_CHECKING([if the SQL Server PMDA should be included])
15261537
pmda_mssql=false
15271538
if test "$have_python" = true

qa/1632

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/sh
2+
# PCP QA Test No. 1632
3+
# pmdaopentelemetry scalability testing
4+
# specifically scaling number of metrics per nodes
5+
#
6+
# Copyright (c) 2025 Red Hat. All Rights Reserved.
7+
#
8+
9+
seq=`basename $0`
10+
echo "QA output created by $seq"
11+
12+
# get standard environment, filters and checks
13+
. ./common.opentelemetry
14+
15+
_pmdaopentelemetry_check || _notrun "opentelemetry pmda and/or load generator not installed"
16+
_have_python266 && _notrun "python load generator does not currently work with python 2.6.6"
17+
18+
status=1 # failure is the default!
19+
$sudo rm -rf $tmp $tmp.* $seq.full
20+
totalendpoints=5 #total queue to work through
21+
endpoints=5 #opentelemetry endpoints
22+
iterations=5
23+
metrics=400
24+
instances=10
25+
26+
_cleanup()
27+
{
28+
# load generator exits itself for this test
29+
30+
echo "=== endpoint log ===" >>$here/$seq.full
31+
if [ -f $tmp.endpoint ]
32+
then
33+
cat $tmp.endpoint >>$here/$seq.full
34+
else
35+
echo "Error: endpoint log file is missing" >>$here/$seq.full
36+
fi
37+
38+
cd $here
39+
_pmdaopentelemetry_cleanup
40+
$sudo rm -rf $tmp $tmp.*
41+
}
42+
43+
_prepare_pmda opentelemetry
44+
trap "_cleanup; exit \$status" 0 1 2 3 15
45+
_stop_auto_restart pmcd
46+
47+
_pmdaopentelemetry_save_config
48+
_pmdaopentelemetry_install
49+
50+
port=`_find_free_port 10000`
51+
echo "port=$port" >>$here/$seq.full
52+
53+
$python $here/opentelemetry/opentelemetry_endpoint.python \
54+
--port=$port \
55+
--output=$PCP_PMDAS_DIR/opentelemetry/config.d/ \
56+
--total $totalendpoints \
57+
--endpoints $endpoints \
58+
--metrics $metrics \
59+
--instances $instances \
60+
--limit $iterations >$tmp.endpoint 2>&1 &
61+
pid=$!
62+
if ! _pmdaopentelemetry_wait_for_metric opentelemetry.source4
63+
then
64+
status=1
65+
exit
66+
fi
67+
if pminfo -b 1000000 -v `pminfo opentelemetry.source0 | LC_COLLATE=POSIX sort` > $tmp.info 2> $tmp.err
68+
then
69+
:
70+
else
71+
echo "... failed! ... here is the Install log ..."
72+
cat $tmp.out
73+
fi
74+
cat $tmp.info $tmp.err
75+
76+
if pminfo -b 1000000 -ftd `pminfo opentelemetry.source1 | LC_COLLATE=POSIX sort` > $tmp.info 2>$tmp.err
77+
then
78+
echo "Fetch and desc opentelemetry metrics: success"
79+
cat $tmp.info
80+
else
81+
echo "Fetch and desc opentelemetry metrics: failed"
82+
cat $tmp.err
83+
fi
84+
85+
for i in `seq 0 1 4`
86+
do
87+
pminfo -b 10000000 -tf `pminfo opentelemetry.source$i | LC_COLLATE=POSIX sort`
88+
pminfo -b 10000000 -tf `pminfo opentelemetry.source$i | LC_COLLATE=POSIX sort`
89+
pminfo -b 10000000 -tf `pminfo opentelemetry.source$i | LC_COLLATE=POSIX sort`
90+
pminfo -b 10000000 -tf `pminfo opentelemetry.source$i | LC_COLLATE=POSIX sort`
91+
sleep 0.5
92+
done
93+
94+
_pmdaopentelemetry_remove
95+
96+
# success, all done
97+
status=0
98+
exit

0 commit comments

Comments
 (0)