Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

11.11. Enabling the JBoss Metrics Plug-in


The JBoss Metrics plug-in supports JBoss EAP 6 and JBossAS 7 version cartridges and is used to print JBoss metrics to stdout.
Enable the JBoss metrics plug-in by ensuring your JBoss application has the following in the application's standalone.xml file within the <extensions> element:
<extension module="com.openshift.metrics"/>
Copy to Clipboard Toggle word wrap
Then configure the metrics subsystem inside the <profile> element to look similar to the following:

Example 11.16. JBoss Metrics Plug-in XML

<subsystem xmlns="urn:redhat:openshift:metrics:1.0">
  <max-line-length>1024</max-line-length>
  <metrics-group cron="*/5 * * * * ?">
    <source type="jboss" path="core-service=platform-mbean/type=memory-pool/name=CMS_Old_Gen">
      <metric source-key="usage.used" publish-key="oldgen.used" />
      <metric source-key="usage.max" publish-key="oldgen.max" />
      <metric source-key="usage.committed" publish-key="oldgen.committed" />
    </source>
    <source path="java.lang:type=Memory" type="mbean">
      <metric source-key="HeapMemoryUsage.used" publish-key="jmx.heap.used"/>
    </source>
  </metrics-group>
</subsystem>
Copy to Clipboard Toggle word wrap
As in the above example, you can specify one or more sources inside a metrics group. Anything that is a valid JBoss resource, such as core-service=platform-mbean/type=memory-pool/name=CMS_Old_Gen, or a valid MBean, such as java.lang:type=Memory can be a source. Each source has a type (jboss or mbean) and a path, which is the name of the resource. A source contains one or more data points that can be read and published. You can specify a source-key (the location in the source of the data point) and a publish-key (the label of the information when written to stdout). Metrics are printed to stdout similar to the following:

Example 11.17. Logged Metrics Data

Jun 10 16:25:39 vm openshift-platform[29398]: type=metric appName=php6 gear=53961099e659c55b08000102 app=53961099e659c55b08000102 ns=demo quota.blocks.used=988 quota.blocks.limit=1048576 quota.files.used=229 quota.files.limit=80000
Copy to Clipboard Toggle word wrap
You can specify one or more metrics-group entries in order to group together the data points you wish to emit at any interval. For example, to emit memory data every 10 seconds but database connection pool data every 30 seconds, you would need two different metrics groups, because their schedules are different.
Note that you can add enabled="false" to any <metrics-group>, <source>, or <metric> attribute to disable it from being logged:
<metrics-group enabled="false">
Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat