Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ install: build
find debian/opennms-common/usr/share/opennms/bin -type f -execdir chmod 755 {} \;
mv debian/temp/etc/* debian/opennms-common/etc/opennms/
mv debian/temp/lib debian/opennms-common/usr/share/opennms/
mv debian/temp/agent debian/opennms-common/usr/share/opennms/
install -d -m 755 debian/opennms-common/var/lib/opennms/xsds
mv debian/temp/share/xsds/* debian/opennms-common/var/lib/opennms/xsds/
find debian/opennms-common/etc/opennms -type f -execdir chmod 644 {} \;
Expand Down
5 changes: 5 additions & 0 deletions opennms-base-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,11 @@
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.pyroscope</groupId>
<artifactId>agent</artifactId>
<version>${pyroscopeVersion}</version>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
Expand Down
10 changes: 10 additions & 0 deletions opennms-base-assembly/src/assembly/daemon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<exclude>org.opennms:opennms-jasperstudio-extension</exclude>
<exclude>org.springframework:*</exclude>
<exclude>org.slf4j:slf4j-jdk14</exclude>
<exclude>io.pyroscope:agent</exclude>
<!-- Exclude the dependency POMs -->
<exclude>*:pom</exclude>
</excludes>
Expand All @@ -123,5 +124,14 @@
<include>org.apache.httpcomponents:httpasyncclient-osgi:jar:${httpasyncclientVersion}</include>
</includes>
</dependencySet>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputFileNameMapping>pyroscope-agent.jar</outputFileNameMapping>
<outputDirectory>agent</outputDirectory>
<useStrictFiltering>true</useStrictFiltering>
<includes>
<include>io.pyroscope:agent:jar</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>
11 changes: 11 additions & 0 deletions opennms-base-assembly/src/main/filtered/bin/opennms
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ RUNJAVA_OPTIONS=""
# when it cannot connect using the Attach API (automatically or by PID)
JMX_URL="service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/jmxrmi"

# Whether to enable the Pyroscope agent
PYROSCOPE_AGENT_ENABLED=0

# The user that OpenNMS needs to run as.
[ -z "$RUNAS" ] && RUNAS=opennms

Expand Down Expand Up @@ -796,6 +799,14 @@ if [ -n "$JAVA_HEAP_SIZE" ] && [ "$JAVA_HEAP_SIZE" -gt 0 ]; then
MANAGER_OPTIONS+=("-Xmx${JAVA_HEAP_SIZE}m")
fi

# https://pyroscope.io/docs/java-tracing/#running-as-otel-java-instrumentation-extension
if [ -n "$PYROSCOPE_AGENT_ENABLED" ] && [ "$PYROSCOPE_AGENT_ENABLED" -gt 0 ]; then
export PYROSCOPE_APPLICATION_NAME="${PYROSCOPE_APPLICATION_NAME:=OpenNMS}"
export PYROSCOPE_SERVER_ADDRESS="${PYROSCOPE_SERVER_ADDRESS:=http://localhost:4040}" # so we don't get a warning

MANAGER_OPTIONS+=("-javaagent:${OPENNMS_HOME}/agent/pyroscope-agent.jar")
fi

JAVA_VERSION="$("$OPENNMS_HOME/bin/runjava" -p -f 2> /dev/null)"
JAVA_SHORT_VERSION="$(echo "$JAVA_VERSION" | cut -d. -f1)"
if [ -z "$JAVA_SHORT_VERSION" ]; then
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,7 @@
<opencsvVersion>2.3</opencsvVersion>
<opentracingVersion>0.31.0</opentracingVersion>
<jeagertracingVersion>0.34.0</jeagertracingVersion>
<pyroscopeVersion>0.10.2</pyroscopeVersion>
<lz4JavaVersion>1.8.0</lz4JavaVersion>
<quartzVersion>2.3.2</quartzVersion>
<rancidApiVersion>2.0.0</rancidApiVersion>
Expand Down
8 changes: 6 additions & 2 deletions tools/packages/opennms/opennms.spec
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,9 @@ find %{buildroot}%{sharedir} ! -type d | \
grep -v 'tca-datacollection-config.xml' | \
grep -v 'juniper-tca' | \
sort >> %{_tmppath}/files.main
find %{buildroot}%{instprefix}/agent ! -type d | \
sed -e "s|^%{buildroot}|%attr(755,opennms,opennms) |" | \
sort >> %{_tmppath}/files.main
find %{buildroot}%{instprefix}/contrib ! -type d | \
sed -e "s|^%{buildroot}|%attr(755,opennms,opennms) |" | \
sort >> %{_tmppath}/files.main
Expand All @@ -690,8 +693,9 @@ find %{buildroot}%{instprefix}/system ! -type d | \
sed -e "s|^%{buildroot}|%attr(755,opennms,opennms) |" | \
grep -v 'jira-' | \
sort >> %{_tmppath}/files.main
# Put the etc, lib, and system subdirectories into the package
find %{buildroot}%{instprefix}/bin \
# Put the agent, bin, etc, lib, and system subdirectories into the package
find %{buildroot}%{instprefix}/agent \
%{buildroot}%{instprefix}/bin \
%{buildroot}%{instprefix}/contrib \
%{buildroot}%{instprefix}/etc \
%{buildroot}%{instprefix}/lib \
Expand Down