diff --git a/ibm-mq-metrics/README.md b/ibm-mq-metrics/README.md index 4389661d8..ced5c3530 100644 --- a/ibm-mq-metrics/README.md +++ b/ibm-mq-metrics/README.md @@ -83,6 +83,17 @@ java \ ./my-config.yml ``` +## Generate code with Weaver + +Weaver generates code, documentation and configuration for this program. + +```shell +make generate +``` + +This generates `config.yaml`, the `docs` folder, the `src/main/java/io/opentelemetry/ibm/mq/metrics` +Java code folder. + ## Connection There are two transport modes in which this extension can be run: @@ -147,12 +158,11 @@ _Note: The following is only needed for versions of Java 8 before 8u161._ **Note** : Please make sure to not use tab (\t) while editing yaml files. You may want to validate the yaml file using a [yaml validator](https://jsonformatter.org/yaml-validator). Configure the monitor by copying and editing the -config.yml file in src/main/resources/config.yml. +config.yml file. 1. Configure the queueManagers with appropriate fields and filters. You can configure multiple queue managers in one configuration file. 2. To run the extension at a frequency > 1 minute, please configure the taskSchedule section. - Refer to the [Task Schedule](https://community.appdynamics.com/t5/Knowledge-Base/Task-Schedule-for-Extensions/ta-p/35414) doc for details. ### Monitoring Workings - Internals diff --git a/ibm-mq-metrics/config.yml b/ibm-mq-metrics/config.yml index 61a444fd6..603330f65 100644 --- a/ibm-mq-metrics/config.yml +++ b/ibm-mq-metrics/config.yml @@ -1,8 +1,8 @@ -#Run it as a scheduled task instead of running every minute. -#If you want to run this every minute, comment this out -#taskSchedule: -# numberOfThreads: 20 -# taskDelaySeconds: 300 +# This section defines the schedule at which the program will scrape metrics. +taskSchedule: + numberOfThreads: 20 + initialDelaySeconds: 0 + taskDelaySeconds: 60 #This is the timeout on queue metrics and channel metrics threads.Default value is 20 seconds. #No need to change the default unless you know what you are doing. @@ -210,4 +210,4 @@ sslConnection: # Configure the OTLP exporter using system properties keys following the specification https://opentelemetry.io/docs/languages/java/configuration/ otlpExporter: - otel.exporter.otlp.endpoint: http://localhost:4318 \ No newline at end of file + otel.exporter.otlp.endpoint: http://localhost:4318 diff --git a/ibm-mq-metrics/templates/registry/yaml/config.yml.j2 b/ibm-mq-metrics/templates/registry/yaml/config.yml.j2 index 762f89446..5f23b27d0 100644 --- a/ibm-mq-metrics/templates/registry/yaml/config.yml.j2 +++ b/ibm-mq-metrics/templates/registry/yaml/config.yml.j2 @@ -1,8 +1,8 @@ -#Run it as a scheduled task instead of running every minute. -#If you want to run this every minute, comment this out -#taskSchedule: -# numberOfThreads: 20 -# taskDelaySeconds: 300 +# This section defines the schedule at which the program will scrape metrics. +taskSchedule: + numberOfThreads: 20 + initialDelaySeconds: 0 + taskDelaySeconds: 60 #This is the timeout on queue metrics and channel metrics threads.Default value is 20 seconds. #No need to change the default unless you know what you are doing. @@ -122,4 +122,4 @@ sslConnection: # Configure the OTLP exporter using system properties keys following the specification https://opentelemetry.io/docs/languages/java/configuration/ otlpExporter: - otel.exporter.otlp.endpoint: http://localhost:4318 \ No newline at end of file + otel.exporter.otlp.endpoint: http://localhost:4318