Skip to content

Commit

Permalink
Merge pull request #141 from markheger/dev-v5
Browse files Browse the repository at this point in the history
Monitoring toolkit for Streams v.5
  • Loading branch information
markheger authored Apr 9, 2019
2 parents 24cea6a + 2a462ca commit 10844ee
Show file tree
Hide file tree
Showing 143 changed files with 882 additions and 4,704 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.README.md.html
/.project
17 changes: 0 additions & 17 deletions .project

This file was deleted.

2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This toolkit uses Apache Ant 1.8 (or later) to build.

This toolkit requires

* IBM Streams 4.1 or later
* IBM Streams 4.3 or later
* Java 1.8

It is recommended to use the Java version that is part of the Streams installation.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The toolkit contains operators that uses the **JMX API** to monitor applications

Find the full documentation [here](https://ibmstreams.github.io/streamsx.monitoring/).

## Streaming Analytics service on IBM Cloud
## IBM Streams - IBM Cloud Private for Data

This toolkit is compatible with the Streaming Analytics service on IBM Cloud.
This toolkit is compatible with the IBM Streams running in IBM Cloud Private for Data.


4 changes: 1 addition & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<fileset dir="${toolkit}" includes="doc/"/>
</delete>
<ant dir="${toolkit}" target="clean"/>
<ant dir="${toolkit.test}" target="clean"/>
</target>

<target name="toolkit"
Expand Down Expand Up @@ -68,7 +67,6 @@

<!-- Test targets -->
<target name="test" depends="build-all-samples">
<ant dir="${toolkit.test}" target="test"/>
</target>

<!-- Targets called on samples -->
Expand Down Expand Up @@ -131,7 +129,7 @@
destfile="${releasefilename}"
basedir="${basedir}"
includes="com.ibm.streamsx.monitoring/** samples/**"
excludes="**/.gitignore com.ibm.streamsx.monitoring/.settings/** com.ibm.streamsx.monitoring/.project com.ibm.streamsx.monitoring/.classpat*"
excludes="**/.gitignore com.ibm.streamsx.monitoring/.settings/** com.ibm.streamsx.monitoring/ext.libs com.ibm.streamsx.monitoring/.project com.ibm.streamsx.monitoring/.classpat*"
/>
<checksum file="${releasefilename}"/>
<checksum algorithm="sha1" file="${releasefilename}"/>
Expand Down
6 changes: 3 additions & 3 deletions com.ibm.streamsx.monitoring/.classpath_tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="@STREAMS_INSTALL@/lib/com.ibm.streams.management.jmxmp.jar"/>
<classpathentry kind="lib" path="@STREAMS_INSTALL@/lib/com.ibm.streams.management.mx.jar"/>
<classpathentry kind="lib" path="@STREAMS_INSTALL@/ext/lib/jmxremote_optional.jar"/>
<classpathentry kind="lib" path="ext.libs/com.ibm.streams.management.jmxmp.jar"/>
<classpathentry kind="lib" path="ext.libs/com.ibm.streams.management.mx.jar"/>
<classpathentry kind="lib" path="ext.libs/jmxremote_optional.jar"/>
<classpathentry kind="lib" path="@STREAMS_INSTALL@/ext/lib/JSON4J.jar"/>
<classpathentry kind="output" path="impl/java/build"/>
</classpath>
7 changes: 4 additions & 3 deletions com.ibm.streamsx.monitoring/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<property name="java.bin.dir" location="impl/java/bin" />
<property name="spl-mt" value="${streams.install}/bin/spl-make-toolkit" />
<property name="impl.lib.dir" location="impl/lib" />
<property name="ext.libs.dir" location="ext.libs" />
<property name="jarfile" value="com.ibm.streamsx.monitoring.jar" />
<property name="gensrc.dir" location="impl/java/src-gen"/>

Expand All @@ -35,9 +36,9 @@

<path id="cp.streams">
<pathelement location="${streams.install}/lib/com.ibm.streams.operator.samples.jar" />
<pathelement location="${streams.install}/lib/com.ibm.streams.management.jmxmp.jar" />
<pathelement location="${streams.install}/lib/com.ibm.streams.management.mx.jar" />
<pathelement location="${streams.install}/ext/lib/jmxremote_optional.jar" />
<pathelement location="${ext.libs.dir}/com.ibm.streams.management.jmxmp.jar" />
<pathelement location="${ext.libs.dir}/com.ibm.streams.management.mx.jar" />
<pathelement location="${ext.libs.dir}/jmxremote_optional.jar" />
</path>

<target name="compile" depends="init">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use com.ibm.streamsx.topology.topic::Publish;
* PE failed notification. Suitable for submitting to an alert system
* such as a Slack channel.
*
* @param tag Tag placed at the beginning of the text alert. Can be set using the submission parameter `tag`. Defaults to an empty string meaning the tag for each alert will be the domain identifier followed by the instance identifier.
* @param tag Tag placed at the beginning of the text alert. Can be set using the submission parameter `tag`. Defaults to an empty string meaning the tag for each alert will be the instance identifier.
* @param stoppedDuration Duration in seconds a PE must be stopped before a notification is issued. Can be set using the submission parameter `stoppedDuration`. Defaults to sixty seconds.
*/
public composite FailedPEService
Expand Down Expand Up @@ -148,7 +148,7 @@ public composite FailedPEService
mutable rstring failed_tag = '';
}
onTuple Failed:
failed_tag = tag_ != '' ? tag_ : domainId + ':' + instanceId;
failed_tag = tag_ != '' ? tag_ : instanceId;

output Alerts:
string = failed_tag + ': ' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use com.ibm.streamsx.monitoring.jmx::ConnectionNotification;
* The schema is defined by the ConnectionNotification type.
*
* @param applicationConfigurationName
* Specifies the name of [https://www.ibm.com/support/knowledgecenter/en/SSCRJU_4.2.0/com.ibm.streams.admin.doc/doc/creating-secure-app-configs.html|application configuration object] that can contain domainId, connectionURL, user, password, and filterDocument properties. The application configuration overrides values that are specified with the corresponding parameters.
* Specifies the name of [https://www.ibm.com/support/knowledgecenter/en/SSCRJU_4.2.0/com.ibm.streams.admin.doc/doc/creating-secure-app-configs.html|application configuration object] that can contain instanceId, connectionURL, user, password, and filterDocument properties. The application configuration overrides values that are specified with the corresponding parameters.
*
* @param user
* Specifies the user that is required for the JMX connection. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value.
Expand All @@ -27,20 +27,17 @@ use com.ibm.streamsx.monitoring.jmx::ConnectionNotification;
* Specifies the password that is required for the JMX connection. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value.
*
* @param filterDocument
* Specifies the either a path to a JSON-formatted document or a JSON-formatted String that specifies the domain, instance and job filters as regular expressions. Each regular expression must follow the rules that are specified for Java [https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html|Pattern]. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value.
* If parameter is not set, then all jobs in current domain and instance are monitored.
* Specifies the either a path to a JSON-formatted document or a JSON-formatted String that specifies the instance and job filters as regular expressions. Each regular expression must follow the rules that are specified for Java [https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html|Pattern]. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value.
* If parameter is not set, then all jobs in current instance are monitored.
*
* @param connectionURL
* Specifies the connection URL as returned by the `streamtool getjmxconnect` command. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value.If not specified and the domainId parameter value equals the domain id under which this operator is running, then the operator uses the `streamtool getjmxconnect` command to get the value.
* Specifies the connection URL. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value. If not specified and the connection URL is used for the instance under which this operator is running.
*
* @param domainId
* Specifies the domain id that is monitored. If no domain id is specified, the domain id under which this operator is running is used. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value.
* @param instanceId
* Specifies the instance id that is monitored. If no instance id is specified, the instance id under which this operator is running is used. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value.
*
* @param sslOption
* Specifies the sslOption that is required for the JMX connection. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value. If not specified and the domainId parameter value equals the domain id under which this operator is running, then the operator uses the `streamtool getdomainproperty` command to get the value.
*
* @param credentials
* Specifies Streaming Analytics service credentials in JSON format. Relevant for IAM authentication case only. If parameter is set, then the parameters user and password are ignored. If the **applicationConfigurationName** parameter is specified, the application configuration with the property credentials can override this parameter value.
* Specifies the sslOption that is required for the JMX connection. If the **applicationConfigurationName** parameter is specified, the application configuration can override this parameter value. If not specified the default value `TLSv1.2 is` used.
*
* @param timeOut
* Specifies the number of seconds during which no duplicate of a tuple is emitted.
Expand All @@ -53,11 +50,10 @@ public composite JobStatusMonitor (output stream<JobStatusNotification> OutStrea
expression<rstring> $applicationConfigurationName: ""; // optional, if user and password are set
expression<rstring> $user: ""; // optional, if set in application configuration
expression<rstring> $password: ""; // optional, if set in application configuration
expression<rstring> $filterDocument; // optional, uses default filter to monitor all in current domain and instance
expression<rstring> $connectionURL: ""; // optional, if not set, then domain settings are used, where the PE is running
expression<rstring> $domainId: ""; // optional, if not set, then domain settings are used, where the PE is running
expression<rstring> $sslOption: ""; // optional, if not set, then domain settings are used, where the PE is running
expression<rstring> $credentials: "";
expression<rstring> $filterDocument; // optional, uses default filter to monitor all in current instance
expression<rstring> $connectionURL: "";
expression<rstring> $instanceId: "";
expression<rstring> $sslOption: "";
expression<float64> $timeOut: 5.0;

graph
Expand All @@ -74,15 +70,14 @@ public composite JobStatusMonitor (output stream<JobStatusNotification> OutStrea
password: $password;
filterDocument: $filterDocument;
connectionURL: $connectionURL;
domainId: $domainId;
instanceId: $instanceId;
sslOption: $sslOption;
credentials: $credentials;
}

stream<I> OutStream = DeDuplicate(Notifications as I) {
param
timeOut: $timeOut;
key: notifyType, domainId, instanceId, jobId, jobName, resource, peId, peHealth, peStatus;
key: notifyType, instanceId, jobId, jobName, resource, peId, peHealth, peStatus;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@ namespace com.ibm.streamsx.monitoring.jobs;
* The notification type, like *com.ibm.streams.management.job.added*,
* *com.ibm.streams.management.job.removed* and *com.ibm.streams.management.pe.changed*.
*
* * **domainId**
*
* The notification belongs to a job that is running in a domain. The **domainId**
* attribute specifies the unique domain id.
*
* * **instanceId**
*
* The notification belongs to a job that is running in an instance that belongs
* to a domain. The **instanceId** attribute specifies the unique instance
* id for the domain.
* The notification belongs to a job that is running in an instance.
* The **instanceId** attribute specifies the unique instance
* id.
*
* * **jobId**
*
Expand Down Expand Up @@ -84,7 +79,6 @@ namespace com.ibm.streamsx.monitoring.jobs;
*/
type JobStatusNotification = tuple<
rstring notifyType,
rstring domainId,
rstring instanceId,
int64 jobId,
rstring jobName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use com.ibm.streamsx.topology.topic::Publish;
*
* Output JSON Schema:
* \{
* "domainId" : string,
* "instanceId" : string,
* "jobId" : string,
* "jobName" : string,
Expand Down Expand Up @@ -48,7 +47,7 @@ use com.ibm.streamsx.topology.topic::Publish;
*
* @param monitoringConfiguration
* Application configuration name for the JMX connection details. Defaults to `monitoring` and can be set using the submission parameter `monitoringConfiguration`.
* The [https://www.ibm.com/support/knowledgecenter/en/SSCRJU_4.3.0/com.ibm.streams.admin.doc/doc/creating-secure-app-configs.html|application configuration object] can contain domainId, connectionURL, user, password, and filterDocument properties. The application configuration overrides values that are specified with the corresponding parameters.
* The [https://www.ibm.com/support/knowledgecenter/en/SSCRJU_4.3.0/com.ibm.streams.admin.doc/doc/creating-secure-app-configs.html|application configuration object] can contain instanceId, connectionURL, user, password, and filterDocument properties. The application configuration overrides values that are specified with the corresponding parameters.
*
* @param metricsTopic
* The name of the topic this service is publishing to. If parameter is not set, then the topic name `streamsx/monitoring/metrics/values` is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public composite Origin {

/**
* The notification type specifies all attributes that can be used to uniquely
* identify a changed metric value, starting with the domain and instance
* identify a changed metric value, starting with the instance
* ids, job and other information, and finally the metric name and its
* value.
*
Expand All @@ -86,16 +86,10 @@ public composite Origin {
* The [com.ibm.streamsx.monitoring.metrics::MetricsSource|MetricsSource] operator
* takes care to set existing attributes only.
*
* * **domainId**
*
* The metric belongs to a job that is running in a domain. The **domainId**
* attribute specifies the unique domain id.
*
* * **instanceId**
*
* The metric belongs to a job that is running in an instance that belongs
* to a domain. The **instanceId** attribute specifies the unique instance
* id for the domain.
* The metric belongs to a job that is running in an instance. The **instanceId**
* attribute specifies the unique instance id.
*
* * **jobId**
*
Expand Down Expand Up @@ -179,7 +173,6 @@ public composite Origin {
*
*/
type Notification = tuple<
rstring domainId,
rstring instanceId,
int64 jobId,
rstring jobName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,10 @@ type SystemStatus = tuple<
* The notification type com.ibm.streams.management.log.application.error or
* com.ibm.streams.management.log.application.warning.
*
* * **domainId**
*
* The domain ID.
*
* * **instanceId**
*
* The **instanceId** attribute specifies the unique instance
* id for the domain.
* id
*
* * **jobId**
*
Expand Down Expand Up @@ -106,7 +102,6 @@ type SystemStatus = tuple<
*/
type LogNotification = tuple<
rstring notifyType,
rstring domainId,
rstring instanceId,
int64 jobId,
rstring resource,
Expand Down
Loading

0 comments on commit 10844ee

Please sign in to comment.