Managing Fuse on Karaf Standalone
Manage Fuse applications with the Fuse Console
Abstract
Preface
Red Hat Fuse provides two enterprise monitoring tools for viewing and managing Fuse integrations:
- The Fuse Console is a web-based console that you access from a browser to monitor and manage a running Fuse container. The Fuse Console is based on Hawtio open source software (https://hawt.io/). This guide describes how to use the Fuse Console.
- Prometheus stores system and integration-level metrics for Fuse distributions. You can use a graphical analytics interface, such as Grafana, to view and analyze the stored historical data. To learn more about using Prometheus, see the the Prometheus documentation.
The audience for this guide is Red Hat Fuse on Apache Karaf administrators. This guide assumes that you are familiar with the Red Hat Fuse platform, Apache Camel, and the processing requirements for your organization.
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Chapter 1. About the Fuse Console
The Red Hat Fuse Console is a web console based on HawtIO open source software. For a list of supported browsers, go to Supported Configurations.
The Fuse Console provides a central interface to examine and manage the details of one or more deployed Fuse containers. You can also monitor Red Hat Fuse and system resources, perform updates, and start or stop services.
The Fuse Console is available when you install Red Hat Fuse standalone or use Fuse on OpenShift. The integrations that you can view and manage in the Fuse Console depend on the plugins that are running. Possible plugins include:
- Camel
- JMX
- OSGI
- Runtime
- Logs
Chapter 2. Accessing the Fuse Console
To access the Fuse Console for Apache Karaf standalone, follow these steps.
Prerequisite
Install Fuse on the Karaf container. For step-by-step instructions, see Installing on Apache Karaf.
Procedure
In the command line, navigate to the directory in which you installed Red Hat Fuse and run the following command to start Fuse standalone:
./bin/fuse
The Karaf console starts and shows version information, the default Fuse Console URL, and a list of common commands.
-
In a browser, type the URL to connect to the Fuse Console. For example:
http://localhost:8181/hawtio
- In the login page, type your user name and password and then click Log In.
By default, the Fuse Console shows the Home page. The left navigation tabs indicate the running plugins.
Chapter 3. Securing the Fuse Console
To secure the Fuse Console on Apache Karaf:
Disable the Fuse Console’s proxy servlet when deploying to AWS
If you want to deploy a standalone Fuse application to Amazon Web Services (AWS), you should disable the Fuse Console’s proxy servlet by setting the
hawtio.disableProxy
system property totrue
.NoteWhen you disable the Fuse Console proxy servlet, the Fuse Console’s Connect tab is disabled and you cannot connect to other JVMs from the Fuse Console. If you want to deploy more than one Fuse application on AWS, you must deploy the Fuse Console for each application.
Set HTTPS as the required protocol
You can use the
hawtio.http.strictTransportSecurity
property to require web browsers to use the secure HTTPS protocol to access the Fuse Console. This property specifies that web browsers that try to use HTTP to access the Fuse Console must automatically convert the request to use HTTPS.Use public keys to secure responses
You can use the
hawtio.http.publicKeyPins
property to secure the HTTPS protocol by telling the web browser to associate a specific cryptographic public key with the Fuse Console to decrease the risk of “man-in-the-middle” attacks with forged certificates.Enable SSL/TLS security
SSL/TLS security is not enabled by default for the Fuse Console. It is recommended that you enable SSL/TLS security on the Fuse Console to protect username/password credentials from snooping.
- Implement Red Hat Single Sign On
Control user access
The operations that an authenticated user is allowed to perform depend on the role (or roles) assigned to that user, as listed in Table 4.1, “Role-based access on Karaf standalone”.
Procedure
To set HTTPS as the required protocol, set the
hawtio.http.strictTransportSecurity
property in the$KARAF_HOME/etc/system.properties
file as shown in the following example:hawtio.http.strictTransportSecurity = max-age=31536000; includeSubDomains; preload
To use public keys to secure responses, set the
hawtio.http.publicKeyPins
property in the$KARAF_HOME/etc/system.properties
file as shown in the following example:hawtio.http.publicKeyPins = pin-sha256="cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs"; max-age=5184000; includeSubDomains
(For deploying on AWS only) To disable the Fuse Console’s proxy servlet, set the
hawtio.disableProxy
property totrue
in the$KARAF_HOME/etc/system.properties
file as shown in the following example:hawtio.disableProxy = true;
- For detailed instructions on how to enable SSL/TLS security, see the "Enabling SSL/TLS for Undertow in an Apache Karaf container" section in the Apache Karaf Security Guide.
- For information on how to secure the Fuse Console with Red Hat Single Sign-On, see the section on securing the Hawtio administration console in the Red Hat Single Sign-on Securing Applications and Services Guide.
To ensure that a user has the necessary user role authorization to perform the Fuse Console operations that the user needs to perform, follow these steps to set a user role:
-
Open the Red Hat Fuse
etc/users.properties
file in an editor. Add an entry for the user name, password, and role.
For example, the following entry in the
etc/users.properties
file defines the admin user and grants the admin role.admin = secretpass,admin
- Save the file.
-
Open the Red Hat Fuse
Additional resources
-
For a description of the
hawtio.http.strictTransportSecurity
property’s syntax, see the description page for the HTTP Strict Transport Security (HSTS) response header. -
For a description of the
hawtio.http.publicKeyPins
property’s syntax, including instructions on how to extract the Base64 encoded public key, see the description page for the HTTP Public Key Pinning response header.
Chapter 4. Role-based access reference
The operations that an authenticated user is allowed to perform depend on the role (or roles) assigned to that user, as listed in Table 4.1, “Role-based access on Karaf standalone”.
Operation | admin | manager | viewer |
---|---|---|---|
Log in/Log out | Y | Y | Y |
View Help topics | Y | Y | Y |
Set user preferences | Y | Y | Y |
Connect | |||
Discover and connect to remote integrations | Y | Y | Y |
Discover and connect to local integrations | Y | Y | Y |
Camel | |||
View all running Camel applications | Y | Y | Y |
Start, suspend, resume, and delete Camel contexts | Y | Y | |
Send messages | Y | Y | |
Add endpoints | Y | Y | |
View routes, route diagrams, and runtime statistics | Y | Y | Y |
Start and stop routes | Y | Y | |
Delete routes | Y | Y | |
JMX | |||
Change attribute values | Y | Y | |
Select and view attributes in a time-based chart | Y | Y | Y |
View operations | Y | Y | Y |
OSGI | |||
View bundles, features, packages, services, servers, framework, and configurations | Y | Y | Y |
Add and delete bundles | Y | Y | |
Add configurations | Y | Y | |
Install and uninstall features | Y | ||
Runtime | |||
View system properties, metrics, and threads | Y | Y | Y |
Logs | |||
View logs | Y | Y | Y |
Additional resources
For more information on role-based access control, see Deploying into Apache Karaf.
Chapter 5. Customizing the Fuse Console branding
You can customize the Fuse Console branding information, such as title, logo, and login page information, by using the Fuse Console branding plugin.
By default, the Fuse Console branding is defined in the hawtconfig.json
that is located in the Fuse Console WAR file (karaf-install-dir/system/io/hawt/hawtio-war/<version>/hawtio-war-<version>.war
). When you implement the Fuse Console branding plugin, you can override the default branding with your own custom branding.
Procedure
-
Download the branding plugin example from
https://github.com/hawtio/hawtio/tree/master/examples/branding-plugin
to a local directory of your choice. In an editor of your choice, open the Fuse Console branding plugin’s
src/main/webapp/plugin/brandingPlugin.js
file to customize the Fuse Console branding.You can change the values of the configuration properties listed in Table A.1, “Fuse Console Configuration Properties”.
- Save your changes.
In an editor of your choice, open the Fuse Console branding plugin’s
pom.xml
file to its<parent>
section:<parent> <groupId>io.hawt</groupId> <artifactId>project</artifactId> <version>2.9-SNAPSHOT</version> <relativePath>../..</relativePath> </parent>
Edit the
<parent>
section as follows:-
Change the value of the
<version>
property to match the version of your Fuse on Karaf installation. For example, if your Fuse on Karaf installation directory name is 2.0.0.fuse-760015, set the version to 2.0.0.fuse-760015. Remove the
<relativePath>../..</relativePath>
line.For example:
<parent> <groupId>io.hawt</groupId> <artifactId>project</artifactId> <version> 2.0.0.fuse-760015</version> </parent>
-
Change the value of the
In a Terminal window, build the branding-plugin project by running the following command:
mvn clean install
If Fuse is not already running, start it by running the following command:
Linux/Unix:
bin/fuse
Windows:
bin\fuse.bat`
At the Karaf CLI prompt, type the following command to install the Fuse Console branding plugin (where
<version>
is the version of your Fuse on Karaf installation):Linux/Unix:
install -s mvn:io.hawt/branding-plugin/<version>/war
Windows:
install -s mvn:io.hawt\branding-plugin\<version>\war
-
In a web browser, open the Fuse Console by using the URL that the start command returned in Step 7 (the default URL is
http://localhost:8181/hawtio/
).
If you have already run the Fuse Console in a web browser, the branding is stored in the browser’s local storage. To use new branding settings, you must clear the browser’s local storage.
Chapter 6. Ensuring that data displays correctly in the Fuse Console
If the display of the queues and connections in the Fuse Console is missing queues, missing connections, or displaying inconsistent icons, adjust the Jolokia collection size parameter that specifies the maximum number of elements in an array that Jolokia marshals in a response.
Procedure
In the upper right corner of the Fuse Console, click the user icon and then click Preferences.
- Increase the value of the Maximum collection size option (the default is 50,000).
- Click Close.
Chapter 7. Disabling the Fuse Console
You can disable the Fuse Console on Karaf so that it becomes inaccessible to all users without affecting any other component.
Procedure
To determine the hawtio-web bundle ID, use the following command to list the Fuse bundles that the Fuse Console uses:
osgi:list | grep hawtio
To stop the bundle, use the osgi:stop command. For example, if the hawtio :: Web console bundle has an ID of 246, type this command:
osgi:stop 246
The bundle goes into the resolved state and you can no longer access the Fuse Console.
Additional resources
For more information about managing bundles, see the "Lifecycle Management" chapter of Deploying into Apache Karaf.
Chapter 8. Connecting to remote Fuse applications
The Fuse Console uses Jolokia, an agent-based approach to Java Management Extensions (JMX) that requires extra software (an agent) installed on the client. By default, Red Hat Fuse includes a jolokia agent.
With standalone Fuse Console distributions, you can connect to remote integrations that already have a jolokia agent (https://jolokia.org/) running inside them. If the process that you want to connect to does not have a jolokia agent inside, refer to the jolokia documentation (http://jolokia.org/agent.html).
8.1. Unlocking the Fuse Console
By default, Jolokia for Fuse 7 standalone on Apache Karaf is locked and the Fuse Console is not accessible remotely.
To unlock the Fuse Console for a hostname or IP address other than locahost or 127.0.0.1, follow these steps:
-
Open the
$KARAF_HOME/etc/jolokia-access.xml
file in an editor. Register the hostnames or IP addresses for the Fuse integrations that you want to access with the Fuse console by adding them to the <cors> section.
For example, to access hostname 0.0.0.3 from the Fuse Console, add the
*<allow-origin>http://0.0.0.3:*</allow-origin>*
line as shown:
<!-- Cross-Origin Resource Sharing (CORS) restrictions By default, only CORS access within localhost is allowed for maximum security. You can add trusted hostnames in the <cors> section to unlock CORS access from them. --> <cors> <!-- Allow cross origin access only within localhost --> <allow-origin>http*://localhost:*</allow-origin> <allow-origin>http*://127.0.0.1:*</allow-origin> <allow-origin>http://0.0.0.3:*</allow-origin> <!-- Whitelist the hostname patterns as <allow-origin> --> <!-- <allow-origin>http*://*.example.com</allow-origin> <allow-origin>http*://*.example.com:*</allow-origin> --> <!-- Check for the proper origin on the server side to protect against CSRF --> <strict-checking /> </cors>
- Save the file.
8.2. Restricting remote access
Optionally, you can restrict remote access to the Fuse Console for specific hosts and IP addresses.
You can grant overall access based on the IP address of an HTTP client. To specify these restrictions:
In the jolokia-access.xml
file, add or edit a <remote>
section that contains one or more <host>
elements. For the <host>
element, you can specify an IP address, a host name, or a netmask given in CIDR format (for example, 10.0.0.0/16
for all clients coming from the 10.0 network).
The following example allows access from localhost and all clients whose IP addresses start with 10.0
. For all other IP addresses, access is denied.
<remote> <host>localhost</host> <host>10.0.0.0/16</host> </remote>
For more details, see the Jolokia security documentation (https://jolokia.org/reference/html/security.html).
8.3. Allowing connections to remote Fuse instances
The Fuse Console’s proxy servlet uses whitelist host protection, with which by default the Fuse Console can only connect to localhost. If you want to connect the Fuse Console to other remote Fuse instances, you need to configure the whitelist as follows:
For Apache Karaf, make the following configuration changes in etc/system.properties
file:
hawtio.proxyWhitelist = localhost, 127.0.0.1, myhost1, myhost2, myhost3
8.4. Connecting to a remote Jolokia agent
Before you begin, you need to know the connection details (host name, port, and path) of the remote Jolokia agent.
The default connection URL for the Jolokia agent for Fuse on Apache Karaf is http://<host>:8181/hawtio/jolokia
.
As a system administrator, you can change this default.
Typically, the URL to remotely connect to a Jolokia agent is the URL to open the Fuse Console plus /jolokia
. For example, if the URL to open the Fuse Console is http://<host>:1234/hawtio
, then the URL to remotely connect to it would probably be http://<host>:1234/hawtio/jolokia
.
To connect to a remote Jolokia instance so that you can examine its JVM:
- Click the Connect tab.
- Click the Remote tab, and then Add connection.
- Type the Name, Scheme (HTTP or HTTPS), and the hostname.
- Click Test Connection.
- Click Add.
The Fuse Console automatically probes the local network interfaces other than localhost and 127.0.0.1 and adds them to the whitelist. Hence, you do not need to manually register the local machine’s addresses to the whitelist.
8.5. Setting data moving preferences
You can change the following Jolokia preferences, for example, if you want to more frequently refresh data that displays in the Fuse Console. Note that increasing the frequency of data updates impacts networking traffic and increases the number of requests made to the server.
- Update rate - The period between polls to Jolokia to fetch JMX data (the default is 5 seconds).
- Maximum depth - The number of levels that Jolokia will marshal an object to JSON on the server side before returning (the default is 7).
- Maximum collection size - The maximum number of elements in an array that Jolokia marshals in a response (the default is 50,000).
To change the values of these settings:
In the upper right of the Fuse Console, click the user icon and then click Preferences.
- Edit the options and then click Close.
8.6. Viewing JVM runtime information
To view JVM runtime information, such as system properties, metrics, and threads, click the Runtime tab.
Chapter 9. Viewing and managing Apache Camel applications
In the Fuse Console’s Camel tab, you view and manage Apache Camel contexts, routes, and dependencies.
You can view the following details:
- A list of all running Camel contexts
- Detailed information of each Camel context such as Camel version number and runtime statics
- Lists of all routes in each Camel application and their runtime statistics
- Graphical representation of the running routes along with real time metrics
You can also interact with a Camel application by:
- Starting and suspending contexts
- Managing the lifecycle of all Camel applications and their routes, so you can restart, stop, pause, resume, etc.
- Live tracing and debugging of running routes
- Browsing and sending messages to Camel endpoints
Prerequisite
The Camel tab is only available when you connect to a container that uses one or more Camel routes.
9.1. Starting, suspending, or deleting a context
- In the Camel tab’s tree view, click Camel Contexts.
- Check the box next to one or more contexts in the list.
- Click Start or Suspend.
To delete a context:
- Stop the context.
- Click the ellipse icon and then select Delete from the dropdown menu.
When you delete a context, you remove it from the deployed application.
9.2. Viewing Camel application details
- In the Camel tab’s tree view, click a Camel application.
- To view a list of application attributes and values, click Attributes.
- To view a graphical representation of the application attributes, click Chart and then click Edit to select the attributes that you want to see in the chart.
- To view inflight and blocked exchanges, click Exchanges.
- To view application endpoints, click Endpoints. You can filter the list by URL, Route ID, and direction.
- To view, enable, and disable statistics related to the Camel built-in type conversion mechanism that is used to convert message bodies and message headers to different types, click Type Converters.
- To view and execute JMX operations, such as adding or updating routes from XML or finding all Camel components available in the classpath, click Operations.
9.3. Viewing a list of the Camel routes and interacting with them
To view a list of routes:
- Click the Camel tab.
In the tree view, click the application’s routes folder:
To start, stop, or delete one or more routes:
- Check the box next to one or more routes in the list.
- Click Start or Stop.
To delete a route, you must first stop it. Then click the ellipse icon and select Delete from the dropdown menu.
Note- When you delete a route, you remove it from the deployed application.
- You can also select a specific route in the tree view and then click the upper-right menu to start, stop, or delete it.
- To view a graphical diagram of the routes, click Route Diagram.
- To view inflight and blocked exchanges, click Exchanges.
- To view endpoints, click Endpoints. You can filter the list by URL, Route ID, and direction.
- Click Type Converters to view, enable, and disable statistics related to the Camel built-in type conversion mechanism, which is used to convert message bodies and message headers to different types.
To interact with a specific route:
- In the Camel tab’s tree view, select a route.
- To view a list of route attributes and values, click Attributes.
- To view a graphical representation of the route attributes, click Chart. You can click Edit to select the attributes that you want to see in the chart.
- To view inflight and blocked exchanges, click Exchanges.
- Click Operations to view and execute JMX operations on the route, such as dumping the route as XML or getting the route’s Camel ID value.
To trace messages through a route:
- In the Camel tab’s tree view, select a route.
- Select Trace, and then click Start tracing.
To send messages to a route:
- In the Camel tab’s tree view, open the context’s endpoints folder and then select an endpoint.
- Click the Send subtab.
- Configure the message in JSON or XML format.
- Click Send.
- Return to the route’s Trace tab to view the flow of messages through the route.
9.4. Debugging a route
- In the Camel tab’s tree view, select a route.
- Select Debug, and then click Start debugging.
To add a breakpoint, select a node in the diagram and then click Add breakpoint. A red dot appears in the node:
The node is added to the list of breakpoints:
- Click the down arrow to step to the next node or the Play button to resume running the route.
- Click the Pause button to suspend all threads for the route.
- Click Stop debugging when you are done. All breakpoints are cleared.
Chapter 10. Viewing and managing JMX domains and MBeans
Java Management Extensions (JMX) is a Java technology that allows you to manage resources (services, devices, and applications) dynamically at runtime. The resources are represented by objects called MBeans (for Managed Bean). You can manage and monitor resources as soon as they are created, implemented, or installed.
With the JMX plugin on the Fuse Console, you can view and manage JMX domains and MBeans. You can view MBean attributes, run commands, and create charts that show statistics for the MBeans.
The JMX tab provides a tree view of the active JMX domains and MBeans organized in folders. You can view details and execute commands on the MBeans.
Procedure
To view and edit MBean attributes:
- In the tree view, select an MBean.
- Click the Attributes tab.
- Click an attribute to see its details.
To perform operations:
- In the tree view, select an MBean.
- Click the Operations tab, expand one of the listed operations.
- Click Execute to run the operation.
To view charts:
- In the tree view, select an item.
- Click the Chart tab.
Chapter 11. Viewing and managing Quartz Schedules
Quartz (http://www.quartz-scheduler.org/) is a richly featured, open source job scheduling library that you can integrate within most Java applications. You can use Quartz to create simple or complex schedules for executing jobs. A job is defined as a standard Java component that can execute virtually anything that you program it to do.
The Fuse Console shows the Quartz tab if your Camel route deploys the camel-quartz2
component. Note that you can alternately access Quartz mbeans through the JMX tree view.
Procedure
In the Fuse Console, click the Quartz tab.
The Quartz page includes a treeview of the Quartz Schedulers and Scheduler, Triggers, and Jobs tabs.
- To pause or start a scheduler, click the buttons on the Scheduler tab.
Click the Triggers tab to view the triggers that determine when jobs will run. For example, a trigger can specify to start a job at a certain time of day (to the millisecond), on specified days, or repeated a specified number of times or at specific times.
- To filter the list of triggers select State, Group, Name, or Type from the drop-down list. You can then further filter the list by selecting or typing in the fill-on field.
- To pause, resume, update, or manually fire a trigger, click the options in the Action column.
- Click the Jobs tab to view the list of running jobs. You can sort the list by the columns in the table: Group, Name, Durable, Recover, Job ClassName, and Description.
Chapter 12. Viewing and managing your OSGI environment
For Apache Karaf standalone distributions, you can view and manage the Red Hat Fuse OSGi environment. You can view and manage container bundles, features, and configurations, as well as Java packages and OSGi services.
The OSGi tab contains a series of subtabs with options for each container component:
- Bundles
- List of installed bundles. You can install and uninstall bundles, start and stop bundles, and edit bundle properties. You can also filter the list and toggle between list and grid view.
- Features
- List of available features. You can install and uninstall features or feature repositories, and drill down to view feature details.
- Packages
- List of installed Java packages. You can view package versions and associated bundles.
- Services
- List of running services. You can view service IDs, associated bundles and object classes.
- Declarative Services
- List of declarative OSGi services. You can view the service state and drill down to view service details. You can also activate and deactivate services.
- Server
- Detailed information about the local or remote host in read-only mode.
- Framework
- Configuration options for the container OSGi framework. You can set the framework start level and the initial bundle start level.
- Configuration
- List of configuration objects. You can view the state of each object and drill down to view or edit object details. You can also create a new configuration object.
Chapter 13. Viewing diagnostics
Use the Diagnostics tab to view diagnostic information about the JVM via the JVM DiagnosticCommand and HotspotDiangostic interfaces.
The functionality is similar to the Diagnostic Commands view in Java Mission Control (jmc) or the command line tool jcmd. The plugin will provide corresponding jcmd commands in some scenarios.
Procedure
- To retrieve the number of instances of loaded classes and the amount of bytes they take up, click Class Histogram. If the operation is repeated, the tab shows the difference since last run.
- To view the JVM diagnostic flag setting, click the JVM flags.
- For a running JVM, you can also modify the flag settings.
Additional resources
The supported JVM depends on the platform, for more information go to one of the following sources:
Chapter 14. Viewing threads
You can view and monitor the state of threads.
Procedure
- Click the Runtime tab and then the Threads subtab. The Threads page lists active threads and stack trace details for each thread. By default, the thread list shows all threads in descending ID order.
- To sort the list by increasing ID, click the ID column label.
- Optionally, filter the list by thread state (for example, Blocked) or by thread name.
- To drill down to detailed information for a specific thread, such as the lock class name and full stack trace for that thread, in the Actions column, click More.
Chapter 15. Viewing log entries
You can view log entries for Red Hat Fuse in the Logs tab.
Prerequisite
The Logs tab is available when the Java application includes the Log MBean.
Procedure
To view a list of the log entries, click the Log Entries tab.
By default, the list shows log entries in ascending order.
You can drill down to each log entry to view detailed information about the log entry.
- To filter the list of logs to show specific log types, click the Action Bar. You can filter the log entries section according to a text string or the logging level.
To change the Fuse Console default settings:
In the upper right corner of the Fuse Console, click the user icon and then click Preferences from the drop-down menu.
- To change the default sorting order, select Server Logs and then click the log entry link to drill down to details about the log entry, such as the bundle name, thread, and the full message text.
Optionally, you can customize these settings for storing log messages:
- The number of log statements to keep in the Fuse Console (the default is 100).
- The global log level: INFO (the default), OFF, ERROR, WARN, and DEBUG.
-
The child-level messages to include, such as
hawtio-oauth
andhawtio-core-utils
.
- To reset the Fuse Console Logs settings to the default values, click Reset → Reset settings.
Chapter 16. Enabling Prometheus metrics
Prometheus is an open-source systems and service monitoring and alerting toolkit that you can use to monitor services deployed in a standalone Apache Karaf container. Prometheus collects and stores metrics from configured services at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if a specified condition becomes true.
Red Hat support for Prometheus is limited to the setup and configuration recommendations provided in Red Hat product documentation.
Prometheus uses “exporters” that are installed and configured on the clients to expose an endpoint to Prometheus format. This endpoint is an HTTP interface that provides a list of metrics and the current values of the metrics. Prometheus periodically scrapes each target-defined endpoint and writes the collected data to its database. Prometheus gathers data over an extended time, rather than just for the currently running session. Prometheus stores the data so that you can graphically visualize and run queries on the data.
16.1. Enabling the export of metrics from a standalone Apache Karaf container
Prometheus uses a configuration file ( https://raw.githubusercontent.com/jboss-fuse/application-templates/master/prometheus/prometheus-config.yml
) which includes metrics exposed by Camel.
The metrics that you can identify are limited to those supplied in JMX.
You must deploy a Fuse application in order for Apache Camel metrics to be generated.
Procedure
To enable the export of Prometheus metrics from a standalone Apache Karaf container using the command line:
-
Open a command prompt and make sure you are in the
etc/
directory of your Apache Karaf installation. Type the following command to create the Prometheus configuration file from the example file in the
etc/
directory:cp prometheus-config.yml-example prometheus-config.yml
-
The exporter is only available when you use the
fuse
orfuse.bat
command to start Fuse: runbin/fuse
on Linux/Unix orbin\fuse.bat
on Windows. -
When Fuse has restarted, you can view the exposed metrics by opening a web browser at:
http://localhost:9779
Optionally you can change the default values of the KARAF_PROMETHEUS_PORT
and KARAF_PROMETHEUS_CONFIG
configuration variables from the command line.
16.2. Configuring the Prometheus server to scrape exposed metrics from the Apache Karaf container
To enable the Prometheus server to scrape metrics from the Apache Karaf container, the endpoint which exposes the metrics must be added to the targets
property of the Prometheus configuration file.
Procedure
-
Navigate to the
/prometheus.yml
configuration file in the Prometheus installation directory. Add the Apache Karaf endpoint to scrape:
scrape_configs: - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['localhost:9779']
Appendix A. Fuse Console Configuration Properties
By default, the Fuse Console configuration is defined in the hawtconfig.json
file. You can customize the Fuse Console configuration information, such as title, logo, and login page information.
Table A.1, “Fuse Console Configuration Properties” provides a description of the properties and lists whether or not each property requires a value.
Section | Property Name | Default Value | Description | Required? |
---|---|---|---|---|
About | Title | Red Hat Fuse Management Console | The title that shows on the About page of the Fuse Console. | Required |
productInfo | Empty value | Product information that shows on the About page of the Fuse Console. | Optional | |
additionalInfo | Empty value | Any additional information that shows on the About page of the Fuse Console. | Optional | |
copyright | Empty value | Copyright information that shows on the About page of the Fuse Console. | Optional | |
imgSrc |
| The image that appears on the About page of the Fuse Console. | Required | |
branding | appName | Red Hat Fuse Management Console | The name for your application. This name displays in the title bar of the Fuse Console. | Required |
appLogoUrl |
| The path to your application logo image file that displays in the Fuse Console }navigation bar. The value can be a path relative to the Hawtio status URL or an absolute URL. | Required | |
Css | The URL of an external CSS stylesheet, that can be used to style the application. It can be a path, relative to the Hawtio status URL, or it can be an absolute URL. | Optional | ||
companyLogoUrl |
| The path to your company logo image file. | Required | |
Favicon | The URL of the favicon, that usually displays in the Web browser tab. It can be a path, relative to the Hawtio status URL, or it can be an absolute URL. | Optional | ||
login | description | Empty value |
Descriptive text that displays on the Fuse Console Login page (for example, | Optional |
links | [ ] |
Specify an array of | Optional | |
disabledRoutes | none | [ ] | Disables specific paths (i.e., plugins) on the console. Do not change this section. Any change is not supported for distributions other than OpenShift. | Optional |