IBMStreams / streamsx.monitoring

The com.ibm.streamsx.monitoring toolkit provides capabilities to create applications that monitor IBM Streams and its applications.
https://ibmstreams.github.io/streamsx.monitoring/
Other
5 stars 5 forks source link

MetricMonitor unable to take threshold document as file input? #97

Closed chanskw closed 6 years ago

chanskw commented 6 years ago

I am unsure what I did wrong... but I could not get it to work.

I created a new project and imported the two microservices in my project. Renamed the namespaces and they compile.

In the MetricMonitorService, instead of using app config, I changed it to use the threshold document as follows:

/**

/**

At submission time, I specified "etc/threshold.json" as the submission parameter.

I made sure that the threshold.json document is in the etc directory. I also added the etc resources to be packaged as part of the bundle. I checked that the bundle has the etc/threshold.json using spl-app-info.

When I run the application, I can never get any alert generated. In addition, I have the following errors:

04 Dec 2017 13:18:36.192 [4543] ERROR #splapptrc,J[36],P[36],AlertMessage M[MetricsMonitor.java:com.ibm.streamsx.monitoring.metrics.MetricsMonitor.processPunctuation:285] - java.io.IOException: File thresholdDocument parse error: java.nio.file.NoSuchFileException: etc/threshold.json

The documentation does not indicate if I have a relative path, what it is relative to. Looking at the code, I assume it's the root directory of the application.

markheger commented 6 years ago

should support relative path from application directory