Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
integrate hawkular monitor into kettle
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazzitelli committed Apr 17, 2015
1 parent 2166f7c commit b752723
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 3 deletions.
9 changes: 9 additions & 0 deletions kettle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<checkstyle.suppressions.file>${basedir}/src/main/scripts/checkstyle-suppressions.xml</checkstyle.suppressions.file>

<!-- The versions of the components that go into our integration distribution -->
<version.org.hawkular.agent>1.0.0-SNAPSHOT</version.org.hawkular.agent>
<version.org.hawkular.nest>1.0.0-SNAPSHOT</version.org.hawkular.nest>
<version.org.hawkular.inventory>0.0.1-SNAPSHOT</version.org.hawkular.inventory>
<version.org.hawkular.alerts>1.0.0-SNAPSHOT</version.org.hawkular.alerts>
Expand All @@ -51,6 +52,13 @@
</properties>

<dependencies>
<dependency>
<groupId>org.hawkular.agent</groupId>
<artifactId>hawkular-monitor</artifactId>
<version>${version.org.hawkular.agent}</version>
<classifier>module</classifier>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.hawkular.nest</groupId>
<artifactId>hawkular-nest-distro</artifactId>
Expand Down Expand Up @@ -145,6 +153,7 @@
<configuration>
<outputDirectory>${basedir}/target/nest</outputDirectory>
<includeArtifactIds>hawkular-nest-distro</includeArtifactIds>
<!-- just unpack the config file - its all we need -->
<includes>*/standalone/configuration/standalone.xml</includes>
</configuration>
</execution>
Expand Down
14 changes: 13 additions & 1 deletion kettle/src/main/scripts/distro-assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</unpackOptions>
</dependencySet>

<!-- all component deployments that go in the modules directory -->
<!-- all component deployments that go in the nest's internal modules directory -->
<dependencySet>
<outputDirectory>${nest.dist.zip.root.dir}/modules/system/layers/base/org/hawkular/nest/main/deployments</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
Expand All @@ -85,6 +85,18 @@
<directoryMode>0755</directoryMode>
</dependencySet>

<!-- additional subsystem extensions that go in the main WildFly modules directory -->
<dependencySet>
<outputDirectory>${nest.dist.zip.root.dir}/modules/system/layers/base</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>org.hawkular.agent:hawkular-monitor:zip:module</include>
</includes>
<unpack>true</unpack>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</dependencySet>

<!--
hawkular-accounts is separated from the others because we need a stable name to the war, without the
version number. This is because we use the Keycloak's "secure-deployment" to configure the integration, and that
Expand Down
81 changes: 79 additions & 2 deletions kettle/src/main/scripts/standalone.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@
</system-properties>
</xsl:template>

<!-- add additional subsystem extensions -->
<xsl:template match="node()[name(.)='extensions']">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<extension module="org.keycloak.keycloak-subsystem"/>
<extension module="org.hawkular.agent.monitor"/>
</xsl:copy>
<xsl:call-template name="system-properties"/>
</xsl:template>

<!-- Keycloak-related - datasource, our secured deployments (important) and security domain definitions -->
<!-- Keycloak-related - datasource -->
<xsl:template match="node()[name(.)='datasources']">
<xsl:copy>
<xsl:apply-templates select="node()[name(.)='datasource']"/>
Expand All @@ -61,9 +63,83 @@
<xsl:apply-templates select="node()[name(.)='drivers']"/>
</xsl:copy>
</xsl:template>

<!-- add extension subsystem configurations -->
<xsl:template match="node()[name(.)='profile']">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>

<!-- Hawkular Monitor agent subsystem -->
<subsystem xmlns="urn:org.hawkular.agent.monitor:monitor:1.0"
enabled="true"
apiJndiName="java:global/hawkular/agent/monitor/api"
numMetricSchedulerThreads="3"
numAvailSchedulerThreads="3">

<storage-adapter type="HAWKULAR"
url="http://localhost:8080"
context="/hawkular-bus/message/"
restContext="/hawkular-metrics/" />

<diagnostics enabled="true"
reportTo="LOG"
interval="5"
timeUnits="minutes"/>

<metric-set-dmr name="platform" enabled="true">
<metric-dmr name="heap.used"
interval="30"
timeUnits="seconds"
resource="/core-service=platform-mbean/type=memory"
attribute="heap-memory-usage#used" />

<metric-dmr name="heap.committed"
interval="1"
timeUnits="minutes"
resource="/core-service=platform-mbean/type=memory"
attribute="heap-memory-usage#committed" />

<metric-dmr name="non-heap.used"
interval="30"
timeUnits="seconds"
resource="/core-service=platform-mbean/type=memory"
attribute="non-heap-memory-usage#used" />

<metric-dmr name="non-heap.committed"
interval="1"
timeUnits="minutes"
resource="/core-service=platform-mbean/type=memory"
attribute="non-heap-memory-usage#committed" />

<metric-dmr name="thread-count"
interval="2"
timeUnits="minutes"
resource="/core-service=platform-mbean/type=threading"
attribute="thread-count" />
</metric-set-dmr>

<avail-set-dmr name="server-availabilities" enabled="true">
<avail-dmr name="app-server"
interval="30"
timeUnits="seconds"
resource="/"
attribute="server-state"
upRegex="run.*" />

<avail-dmr name="hawkular-bus-broker"
interval="1"
timeUnits="minutes"
resource="/subsystem=hawkular-bus-broker" />
</avail-set-dmr>

<managed-resources>
<local-dmr enabled="true"
metricSets="platform"
availSets="server-availabilities" />
</managed-resources>
</subsystem>

<!-- Keycloak-related - our secured deployments (important) -->
<subsystem xmlns="urn:jboss:domain:keycloak:1.0">
<auth-server name="main-auth-server">
<enabled>true</enabled>
Expand All @@ -84,6 +160,8 @@
</subsystem>
</xsl:copy>
</xsl:template>

<!-- Keycloak-related - security-domain definitions -->
<xsl:template match="node()[name(.)='security-domains']">
<xsl:copy>
<xsl:apply-templates select="node()[name(.)='security-domain']"/>
Expand All @@ -99,7 +177,6 @@
</security-domain>
</xsl:copy>
</xsl:template>
<!-- End of Keycloak-related changes -->

<!-- Add a cache for Hawkular Accounts -->
<xsl:template match="node()[name(.)='cache-container'][1]">
Expand Down

0 comments on commit b752723

Please sign in to comment.