이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 109. Ganglia Component


Available as of Camel version 2.15

Provides a mechanism to send a value (the message body) as a metric to the Ganglia monitoring system.  Uses the gmetric4j library.  Can be used in conjunction with standard Ganglia and JMXetric for monitoring metrics from the OS, JVM and business processes through a single platform.

You should have a Ganglia gmond agent running on the machine where your JVM runs.  The gmond sends a heartbeat to the Ganglia infrastructure, camel-ganglia can’t send the heartbeat itself currently.

On most Linux systems (Debian, Ubuntu, Fedora and RHEL/CentOS with EPEL) you can just install the Ganglia agent package and it runs automatically using multicast configuration.  You can configure it to use regular UDP unicast if you prefer.

Maven users will need to add the following dependency to their pom.xml for this component:

 

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-ganglia</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

109.1. URI format

ganglia:address:port[?options]

You can append query options to the URI in the following format, ?option=value&option=value&…​

109.2. Ganglia component and endpoint URI options

The Ganglia component supports 2 options which are listed below.

NameDescriptionDefaultType

configuration (advanced)

To use the shared configuration

 

GangliaConfiguration

resolveProperty Placeholders (advanced)

Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders.

true

boolean

The Ganglia endpoint is configured using URI syntax:

ganglia:host:port

with the following path and query parameters:

109.2.1. Path Parameters (2 parameters):

NameDescriptionDefaultType

host

Host name for Ganglia server

239.2.11.71

String

port

Port for Ganglia server

8649

int

109.2.2. Query Parameters (13 parameters):

NameDescriptionDefaultType

dmax (producer)

Minumum time in seconds before Ganglia will purge the metric value if it expires. Set to 0 and the value will remain in Ganglia indefinitely until a gmond agent restart.

0

int

groupName (producer)

The group that the metric belongs to.

java

String

metricName (producer)

The name to use for the metric.

metric

String

mode (producer)

Send the UDP metric packets using MULTICAST or UNICAST

MULTICAST

UDPAddressingMode

prefix (producer)

Prefix the metric name with this string and an underscore.

 

String

slope (producer)

The slope

BOTH

GMetricSlope

spoofHostname (producer)

Spoofing information IP:hostname

 

String

tmax (producer)

Maximum time in seconds that the value can be considered current. After this, Ganglia considers the value to have expired.

60

int

ttl (producer)

If using multicast, set the TTL of the packets

5

int

type (producer)

The type of value

STRING

GMetricType

units (producer)

Any unit of measurement that qualifies the metric, e.g. widgets, litres, bytes. Do not include a prefix such as k (kilo) or m (milli), other tools may scale the units later. The value should be unscaled.

 

String

wireFormat31x (producer)

Use the wire format of Ganglia 3.1.0 and later versions. Set this to false to use Ganglia 3.0.x or earlier.

true

boolean

synchronous (advanced)

Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

false

boolean

109.3. Message body

Any value (such as a string or numeric type) in the body is sent to the Ganglia system.

109.4. Return value / response

Ganglia sends metrics using unidirectional UDP or multicast.  There is no response or change to the message body.

109.5. Examples

109.5.1. Sending a String metric

The message body will be converted to a String and sent as a metric value.  Unlike numeric metrics, String values can’t be charted but Ganglia makes them available for reporting.  The os_version string at the top of every Ganglia host page is an example of a String metric.

from("direct:string.for.ganglia")
    .setHeader(GangliaConstants.METRIC_NAME, simple("my_string_metric"))
    .setHeader(GangliaConstants.METRIC_TYPE, GMetricType.STRING)
    .to("direct:ganglia.tx");

from("direct:ganglia.tx")
    .to("ganglia:239.2.11.71:8649?mode=MULTICAST&prefix=test");

109.5.2. Sending a numeric metric

from("direct:value.for.ganglia")
    .setHeader(GangliaConstants.METRIC_NAME, simple("widgets_in_stock"))
    .setHeader(GangliaConstants.METRIC_TYPE, GMetricType.UINT32)
    .setHeader(GangliaConstants.METRIC_UNITS, simple("widgets"))
    .to("direct:ganglia.tx");

from("direct:ganglia.tx")
    .to("ganglia:239.2.11.71:8649?mode=MULTICAST&prefix=test");
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.