Skip to content

Commit

Permalink
Testing the presence of Prometheus Exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
juditnovak committed Dec 3, 2023
1 parent ab13699 commit 2872571
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,27 @@ jobs:
exit 1
fi
- name: Check if Prometheus Exporter plugin is available
env:
OPENSEARCH_JAVA_HOME: /snap/opensearch/current/usr/lib/jvm/java-17-openjdk-amd64
OPENSEARCH_BIN: /snap/opensearch/current/usr/share/opensearch/bin
OPENSEARCH_PATH_CONF: /var/snap/opensearch/current/etc/opensearch
OPENSEARCH_HOME: /var/snap/opensearch/current/usr/share/opensearch
OPENSEARCH_LIB: /var/snap/opensearch/current/usr/share/opensearch/lib
OPENSEARCH_PATH_CERTS: /var/snap/opensearch/current/etc/opensearch/certificates
run: |
# Prometheus Exporter appears in plugins listing
prometheus_is_there=$(sudo -E "${OPENSEARCH_BIN}"/opensearch-plugin list | grep prometheus-exporter)
if [ ! "$prometheus_is_there" ]; then
exit 1
fi
# Prometheus exporter can be queried
resp=$(curl I --cacert ${cert} -XGET https://localhost:9200/_prometheus/metrics -u 'admin:admin')
if [[ "$resp" != *"200 OK"* ]]; then
exit 1
fi
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

0 comments on commit 2872571

Please sign in to comment.