diff --git a/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/test.js b/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/test.js index f631606..5eb84c1 100644 --- a/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/test.js +++ b/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/test.js @@ -98,6 +98,10 @@ describe('flow-node prometheus-metrics', () => { var apiRequestsSuccess = await value.getSingleMetric('axway_api_requests_success').get(); var apiRequestsFailure = await value.getSingleMetric('axway_api_requests_failures').get(); var apiRequestsExceptions = await value.getSingleMetric('axway_api_requests_exceptions').get(); + var apiRequestsDurationAvg = await value.getSingleMetric('axway_api_requests_duration_avg').get(); + var apiRequestsDurationMax = await value.getSingleMetric('axway_api_requests_duration_max').get(); + var apiRequestsDurationMin = await value.getSingleMetric('axway_api_requests_duration_min').get(); + expect(apiRequestsTotal.type).to.equal('counter'); expect(apiRequestsTotal.values).to.lengthOf(4); // 4 Metrics are expected @@ -112,6 +116,12 @@ describe('flow-node prometheus-metrics', () => { expect(apiRequestsSuccess.values[2]).to.deep.equal( { labels: { 'gatewayId': 'instance-2', "service": "FHIR CarePlan"}, value: 6 }); expect(apiRequestsFailure.values[2]).to.deep.equal( { labels: { 'gatewayId': 'instance-2', "service": "FHIR CarePlan"}, value: 0 }); expect(apiRequestsExceptions.values[2]).to.deep.equal( { labels: { 'gatewayId': 'instance-2', "service": "FHIR CarePlan"}, value: 0 }); + + expect(apiRequestsDurationAvg.type).to.equal('histogram'); + expect(apiRequestsDurationMax.type).to.equal('histogram'); + expect(apiRequestsDurationMin.type).to.equal('histogram'); + + // Check for the Petstore service, has some duration (processingTime) test values expect(output).to.equal('next'); }); }); diff --git a/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/testFiles/Service/1_ServiceMetrics.json b/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/testFiles/Service/1_ServiceMetrics.json index 16036e9..9cae431 100644 --- a/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/testFiles/Service/1_ServiceMetrics.json +++ b/apibuilder4prometheus/custom_flow_nodes/api-builder-plugin-prometheus-metrics/test/testFiles/Service/1_ServiceMetrics.json @@ -19,9 +19,9 @@ "name": "Petstore", "failures": 4, "successes": 888, - "processingTimeAvg": [101], - "processingTimeMin": [16], - "processingTimeMax": [179] + "processingTimeAvg": [0,5,0,101], + "processingTimeMin": [17,16,0,1], + "processingTimeMax": [80,0,0,179] }, { "groupType": "Service", diff --git a/helm/Chart.yaml b/helm/Chart.yaml index e8db1ce..63d07dd 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -4,6 +4,6 @@ description: Prometheus exporter for Axway API-Management type: application -version: 0.2.0 +version: "0.3.0" -appVersion: "0.2.0" +appVersion: "0.3.0" diff --git a/helm/examples/example.local.values.yaml b/helm/examples/example.local.values.yaml index d5d42a9..be8361b 100644 --- a/helm/examples/example.local.values.yaml +++ b/helm/examples/example.local.values.yaml @@ -1,8 +1,9 @@ global: - pullPolicy: IfNotPresent + # pullPolicy: Always + # imageTag: "latest" ingress: - enabled: false + enabled: true annotations: # https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.1/guide/ingress/annotations kubernetes.io/ingress.class: alb @@ -15,11 +16,12 @@ ingress: alb.ingress.kubernetes.io/success-codes: "200" hosts: - - host: metrics.axway-apim-on-eks.de + - host: metrics.customer.com paths: - path: /* -anm: - url: https://axway-apim-anm:8090 - username: admin - password: my-password +config: + anm: + url: https://axway-apim-anm:8090 + username: admin + password: my-password