diff --git a/.github/Dockerfile_PreBuild b/.github/Dockerfile_PreBuild index cf711494f..782715024 100644 --- a/.github/Dockerfile_PreBuild +++ b/.github/Dockerfile_PreBuild @@ -1,5 +1,10 @@ FROM jetty:9.4-jdk11-alpine +ENV JMX_EXPORTER_VERSION=1.2.0 + +# To enable add "-javaagent:$JETTY_BASE/jmx-exporter.jar=8090:$JETTY_BASE/prometheus_config.yml" to the JAVA_OPTIONS +RUN wget https://github.com/prometheus/jmx_exporter/releases/download/$JMX_EXPORTER_VERSION/jmx_prometheus_javaagent-$JMX_EXPORTER_VERSION.jar -o /var/lib/jetty/jmx-exporter.jar +COPY .github/jmx_exporter.config /var/lib/jetty/prometheus_config.yml # Copy OBP source code # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war diff --git a/.github/jmx_exporter.config b/.github/jmx_exporter.config new file mode 100644 index 000000000..f9ea32557 --- /dev/null +++ b/.github/jmx_exporter.config @@ -0,0 +1,15 @@ +--- +lowercaseOutputLabelNames: true +lowercaseOutputName: true +whitelistObjectNames: ["java.lang:type=OperatingSystem"] +blacklistObjectNames: [] +rules: +- pattern: 'java.lang<>(committed_virtual_memory|free_physical_memory|free_swap_space|total_physical_memory|total_swap_space)_size:' + name: os_$1_bytes + type: GAUGE + attrNameSnakeCase: true +- pattern: 'java.lang<>((?!process_cpu_time)\w+):' + name: os_$1 + type: GAUGE + attrNameSnakeCase: true +- pattern: ".*" \ No newline at end of file diff --git a/.github/workflows/auto_update_base_image.yml b/.github/workflows/auto_update_base_image.yml new file mode 100644 index 000000000..3048faf15 --- /dev/null +++ b/.github/workflows/auto_update_base_image.yml @@ -0,0 +1,35 @@ +name: Regular base image update check +on: + schedule: + - cron: "0 5 * * *" + workflow_dispatch: + +env: + ## Sets environment variable + DOCKER_HUB_ORGANIZATION: ${{ vars.DOCKER_HUB_ORGANIZATION }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Docker Image Update Checker + id: baseupdatecheck + uses: lucacome/docker-image-update-checker@v2.0.0 + with: + base-image: jetty:9.4-jdk11-alpine + image: ${{ env.DOCKER_HUB_ORGANIZATION }}/obp-api:latest + + - name: Trigger build_container_develop_branch workflow + uses: actions/github-script@v6 + with: + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'build_container_develop_branch.yml', + ref: 'refs/heads/develop' + }); + if: steps.baseupdatecheck.outputs.needs-updating == 'true' diff --git a/.github/workflows/build_container_develop_branch.yml b/.github/workflows/build_container_develop_branch.yml index a7f68daa9..d3f355042 100644 --- a/.github/workflows/build_container_develop_branch.yml +++ b/.github/workflows/build_container_develop_branch.yml @@ -3,6 +3,7 @@ name: Build and publish container develop # read-write repo token # access to secrets on: + workflow_dispatch: push: branches: - develop diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template index 99355627c..da4f06a89 100644 --- a/obp-api/src/main/resources/props/sample.props.template +++ b/obp-api/src/main/resources/props/sample.props.template @@ -183,9 +183,9 @@ jwt.use.ssl=false ## Enable writing API metrics (which APIs are called) to RDBMS -write_metrics=true +write_metrics=false ## Enable writing connector metrics (which methods are called)to RDBMS -write_connector_metrics=true +write_connector_metrics=false ## ElasticSearch #allow_elasticsearch=true