You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2020/11/26 08:17:55 UTC
[camel-k] branch master updated (6affc5a -> 79bdca8)
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git.
from 6affc5a Updated CHANGELOG.md
new 18c7119 Fix rsync problem in monitoring test
new 3b3d513 [ENTESB-14497] Provide tests for basic Operator metrics
new 79bdca8 [ENTESB-14357] Provide tests for basic Operator Alerts
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
e2e/yaks/openshift/monitoring/alerting.feature | 16 ++++++++++++++++
e2e/yaks/openshift/monitoring/dependencyInstall.sh | 2 +-
e2e/yaks/openshift/monitoring/metrics.feature | 20 ++++++++++++++++++++
e2e/yaks/openshift/monitoring/obtainToken.sh | 6 ++++--
e2e/yaks/openshift/monitoring/yaks-config.yaml | 6 ++++--
5 files changed, 45 insertions(+), 5 deletions(-)
create mode 100644 e2e/yaks/openshift/monitoring/alerting.feature
[camel-k] 02/03: [ENTESB-14497] Provide tests for basic Operator
metrics
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 3b3d5132bfd7ff494a96734130494a5f2d26ff93
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Tue Nov 24 18:05:40 2020 +0100
[ENTESB-14497] Provide tests for basic Operator metrics
---
e2e/yaks/openshift/monitoring/metrics.feature | 20 ++++++++++++++++++++
e2e/yaks/openshift/monitoring/yaks-config.yaml | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/e2e/yaks/openshift/monitoring/metrics.feature b/e2e/yaks/openshift/monitoring/metrics.feature
index 3b28f59..e4657b0 100644
--- a/e2e/yaks/openshift/monitoring/metrics.feature
+++ b/e2e/yaks/openshift/monitoring/metrics.feature
@@ -27,3 +27,23 @@ Feature: Camel K can serve metrics to Prometheus
| $.data.result[0].metric.pod | @startsWith('metrics')@ |
| $.data.result[0].value[1] | @isNumber()@ |
And receive HTTP 200
+
+ Scenario: Thanos is able to serve integration build metrics from Operator
+ Given HTTP request header Authorization is "Bearer ${openshift.token}"
+ When send GET /api/v1/query?query=camel_k_build_duration_seconds_sum
+ Then verify HTTP response expressions
+ | $.status | success |
+ | $.data.result[?(@.metric.namespace == '${YAKS_NAMESPACE}' && @.metric.result == 'Succeeded')].metric.__name__ | camel_k_build_duration_seconds_sum |
+ | $.data.result[?(@.metric.namespace == '${YAKS_NAMESPACE}' && @.metric.result == 'Succeeded')].metric.pod | @startsWith('camel-k-operator')@ |
+ | $.data.result[?(@.metric.namespace == '${YAKS_NAMESPACE}' && @.metric.result == 'Succeeded')].value[1] | @greaterThan(10)@ |
+ And receive HTTP 200
+
+ Scenario: Thanos is able to serve integration readiness metrics from Operator
+ Given HTTP request header Authorization is "Bearer ${openshift.token}"
+ When send GET /api/v1/query?query=camel_k_integration_first_readiness_seconds_sum
+ Then verify HTTP response expressions
+ | $.status | success |
+ | $.data.result[?(@.metric.namespace == '${YAKS_NAMESPACE}')].metric.__name__ | camel_k_integration_first_readiness_seconds_sum |
+ | $.data.result[?(@.metric.namespace == '${YAKS_NAMESPACE}')].metric.pod | @startsWith('camel-k-operator')@ |
+ | $.data.result[?(@.metric.namespace == '${YAKS_NAMESPACE}')].value[1] | @greaterThan(5)@ |
+ And receive HTTP 200
\ No newline at end of file
diff --git a/e2e/yaks/openshift/monitoring/yaks-config.yaml b/e2e/yaks/openshift/monitoring/yaks-config.yaml
index 5f26519..ed57176 100644
--- a/e2e/yaks/openshift/monitoring/yaks-config.yaml
+++ b/e2e/yaks/openshift/monitoring/yaks-config.yaml
@@ -23,7 +23,7 @@ pre:
script: ./obtainToken.sh
- name: Camel-k install
run: |
- kamel install -w -n ${YAKS_NAMESPACE}
+ kamel install -w -n ${YAKS_NAMESPACE} --monitoring=true
- name: Dependency install
script: ./dependencyInstall.sh
- name: Integration run
[camel-k] 01/03: Fix rsync problem in monitoring test
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 18c7119dea22bc827a2023cd395cdd10a32a4b66
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Tue Nov 24 17:16:43 2020 +0100
Fix rsync problem in monitoring test
---
e2e/yaks/openshift/monitoring/dependencyInstall.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/e2e/yaks/openshift/monitoring/dependencyInstall.sh b/e2e/yaks/openshift/monitoring/dependencyInstall.sh
index 6c63a83..ce129d2 100644
--- a/e2e/yaks/openshift/monitoring/dependencyInstall.sh
+++ b/e2e/yaks/openshift/monitoring/dependencyInstall.sh
@@ -26,4 +26,4 @@ LOCAL_MVN_HOME=$(mvn help:evaluate -Dexpression=settings.localRepository -q -Dfo
OPERATOR_POD=$(oc -n ${YAKS_NAMESPACE} get pods -l name=camel-k-operator --no-headers -o custom-columns=NAME:.metadata.name)
oc -n ${YAKS_NAMESPACE} exec $OPERATOR_POD -- mkdir -p /tmp/artifacts/m2/com/github/openshift-integration/camel-k-example-metrics/1.0.0-SNAPSHOT/
-oc -n ${YAKS_NAMESPACE} rsync $LOCAL_MVN_HOME/com/github/openshift-integration/camel-k-example-metrics/1.0.0-SNAPSHOT/ $OPERATOR_POD:/tmp/artifacts/m2/com/github/openshift-integration/camel-k-example-metrics/1.0.0-SNAPSHOT/ --exclude=\* --include=camel-k-example-metrics-1.0.0-SNAPSHOT.\* --no-perms=true
\ No newline at end of file
+oc -n ${YAKS_NAMESPACE} rsync $LOCAL_MVN_HOME/com/github/openshift-integration/camel-k-example-metrics/1.0.0-SNAPSHOT/ $OPERATOR_POD:/tmp/artifacts/m2/com/github/openshift-integration/camel-k-example-metrics/1.0.0-SNAPSHOT/ --no-perms=true
\ No newline at end of file
[camel-k] 03/03: [ENTESB-14357] Provide tests for basic Operator
Alerts
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 79bdca84cc918966e3fd19957b1575863dca9df5
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Wed Nov 25 22:20:54 2020 +0100
[ENTESB-14357] Provide tests for basic Operator Alerts
---
e2e/yaks/openshift/monitoring/alerting.feature | 16 ++++++++++++++++
e2e/yaks/openshift/monitoring/obtainToken.sh | 6 ++++--
e2e/yaks/openshift/monitoring/yaks-config.yaml | 4 +++-
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/e2e/yaks/openshift/monitoring/alerting.feature b/e2e/yaks/openshift/monitoring/alerting.feature
new file mode 100644
index 0000000..7b66a7f
--- /dev/null
+++ b/e2e/yaks/openshift/monitoring/alerting.feature
@@ -0,0 +1,16 @@
+Feature: Alerts from Camel-K are propagated to Openshift Prometheus
+
+ Background: Prepare Thanos-ruler URL
+ Given URL: https://thanos-ruler.openshift-user-workload-monitoring:9091
+
+ Scenario: Integration gets the message from the timer
+ Given Camel-K integration metrics is running
+ Then Camel-K integration metrics should print Successfully processed
+ Then sleep 120000 ms
+
+ Scenario: Thanos-ruler is able to serve alerts based on metrics from Operator
+ Given HTTP request header Authorization is "Bearer ${openshift.token}"
+ When send GET /api/v1/rules
+ Then verify HTTP response expressions
+ | $..rules[?(@.labels.namespace == '${YAKS_NAMESPACE}' && @.state == 'pending')].name | CamelKBuildFailure |
+ And receive HTTP 200
\ No newline at end of file
diff --git a/e2e/yaks/openshift/monitoring/obtainToken.sh b/e2e/yaks/openshift/monitoring/obtainToken.sh
index c3616d3..a4bbe83 100755
--- a/e2e/yaks/openshift/monitoring/obtainToken.sh
+++ b/e2e/yaks/openshift/monitoring/obtainToken.sh
@@ -17,6 +17,8 @@
TOKEN=`oc config view --minify --output 'jsonpath={..token}'`
echo "openshift.token=${TOKEN}" > openshift-token.properties
-oc -n ${YAKS_NAMESPACE} create secret generic openshift-token-secret --from-file=openshift-token.properties
-oc -n ${YAKS_NAMESPACE} label secret openshift-token-secret yaks.citrusframework.org/test=metrics
+oc -n ${YAKS_NAMESPACE} create secret generic openshift-token-secret-metrics --from-file=openshift-token.properties
+oc -n ${YAKS_NAMESPACE} create secret generic openshift-token-secret-alerting --from-file=openshift-token.properties
+oc -n ${YAKS_NAMESPACE} label secret openshift-token-secret-metrics yaks.citrusframework.org/test=metrics
+oc -n ${YAKS_NAMESPACE} label secret openshift-token-secret-alerting yaks.citrusframework.org/test=alerting
rm openshift-token.properties
\ No newline at end of file
diff --git a/e2e/yaks/openshift/monitoring/yaks-config.yaml b/e2e/yaks/openshift/monitoring/yaks-config.yaml
index ed57176..242ae05 100644
--- a/e2e/yaks/openshift/monitoring/yaks-config.yaml
+++ b/e2e/yaks/openshift/monitoring/yaks-config.yaml
@@ -28,4 +28,6 @@ pre:
script: ./dependencyInstall.sh
- name: Integration run
run: |
- kamel run --name metrics Metrics.java -w -n $YAKS_NAMESPACE --dependency mvn:com.github.openshift-integration:camel-k-example-metrics:1.0.0-SNAPSHOT
+ set +e
+ kamel run --name metrics Metrics.java -w -n $YAKS_NAMESPACE --dependency mvn:com.github.openshift-integration:camel-k-example-metrics-non-existing:1.0.0-SNAPSHOT
+ kamel run --name metrics Metrics.java -w -n $YAKS_NAMESPACE --dependency mvn:com.github.openshift-integration:camel-k-example-metrics:1.0.0-SNAPSHOT
\ No newline at end of file