diff --git a/NOTICE b/NOTICE index b27f17fac2923f619c9e40e0c530605d8c10066d..b4eed8c03c8e976cf175bb4f6692b34ed4c6a69b 100644 --- a/NOTICE +++ b/NOTICE @@ -117,6 +117,7 @@ The following software have components provided under the terms of this license: - Plexus Velocity Component (from https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-velocity) - PostgreSQL JDBC Driver - PowerMock (from http://www.powermock.org, https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito) +- Prometheus Java Simpleclient (from https://repo1.maven.org/maven2/io/prometheus/simpleclient) - Protocol Buffer extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-protobuf) - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) - RxJava (from https://github.com/ReactiveX/RxJava) @@ -465,6 +466,7 @@ The following software have components provided under the terms of this license: - LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - PostgreSQL JDBC Driver - Project Lombok (from http://projectlombok.org, https://projectlombok.org) +- Prometheus Java Simpleclient (from https://repo1.maven.org/maven2/io/prometheus/simpleclient) - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) - reactive-streams (from http://www.reactive-streams.org/) - xml-apis diff --git a/indexer-core/pom.xml b/indexer-core/pom.xml index a12777a9faf3b82592af3e8f0881c16739e5e229..2f995cb4cd4eaa05d48c31ddec63f767d7aa49ac 100644 --- a/indexer-core/pom.xml +++ b/indexer-core/pom.xml @@ -4,12 +4,12 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>indexer-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <name>indexer-core</name> <description>Indexer Service Core</description> <packaging>jar</packaging> diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java index c3517a676f63ffd2d08a848b8bb02a6f31383a48..124dc0ebdfbc152922b56357a7d30740e94d441e 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java @@ -435,7 +435,9 @@ public class IndexerServiceImpl implements IndexerService { Exception failedRequestCause = null; try { + long startTime = System.currentTimeMillis(); BulkResponse bulkResponse = restClient.bulk(bulkRequest, RequestOptions.DEFAULT); + long stopTime = System.currentTimeMillis(); // log failed bulk requests ArrayList<String> bulkFailures = new ArrayList<>(); @@ -464,7 +466,7 @@ public class IndexerServiceImpl implements IndexerService { } if (!bulkFailures.isEmpty()) this.jaxRsDpsLog.warning(bulkFailures); - jaxRsDpsLog.info(String.format("records in elasticsearch service bulk request: %s | successful: %s | failed: %s", bulkRequest.numberOfActions(), succeededResponses, failedResponses)); + jaxRsDpsLog.info(String.format("records in elasticsearch service bulk request: %s | successful: %s | failed: %s | time taken for bulk request: %d milliseconds", bulkRequest.numberOfActions(), succeededResponses, failedResponses, stopTime-startTime)); // retry entire message if all records are failing if (bulkRequest.numberOfActions() == failureRecordIds.size()) throw new AppException(failedRequestStatus, "Elastic error", failedRequestCause.getMessage(), failedRequestCause); diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java index 2027796610526b85510a9a9404fdccd45ca39ba8..25f5945654edc51b92cd8a53099298dca6d59d5f 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java @@ -97,10 +97,15 @@ public class IndicesServiceImpl implements IndicesService { request.mapping(mappingJsonString, XContentType.JSON); } request.setTimeout(REQUEST_TIMEOUT); + long startTime = System.currentTimeMillis(); CreateIndexResponse response = client.indices().create(request, RequestOptions.DEFAULT); + long stopTime = System.currentTimeMillis(); // cache the index status boolean indexStatus = response.isAcknowledged() && response.isShardsAcknowledged(); - if (indexStatus) this.indexCache.put(index, true); + if (indexStatus) { + this.indexCache.put(index, true); + this.log.info(String.format("Time taken to successfully create new index %s : %d milliseconds", request.index(), stopTime-startTime)); + } return indexStatus; } catch (ElasticsearchStatusException e) { diff --git a/pom.xml b/pom.xml index c148fd375a65588a7ce7a39dc0a1ff84c10c5f6c..b3ef4afa497579f19a90791c2393a16462946b0c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> <packaging>pom</packaging> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <description>Indexer Service</description> <properties> diff --git a/provider/indexer-aws/pom.xml b/provider/indexer-aws/pom.xml index 1a8ba1dba23253591437777f227794591c9b5fb0..18fddd734d6e2d99b5bd1a17502c02859441bfaf 100644 --- a/provider/indexer-aws/pom.xml +++ b/provider/indexer-aws/pom.xml @@ -18,7 +18,7 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -26,7 +26,7 @@ <artifactId>indexer-aws</artifactId> <description>Indexer service on AWS</description> <packaging>jar</packaging> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <properties> <aws.version>1.11.1018</aws.version> @@ -63,7 +63,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> diff --git a/provider/indexer-azure/pom.xml b/provider/indexer-azure/pom.xml index 109f4eea0d2af31a8a849da4876421483fb9bfaa..323731a1ff167be91ffe5cef41f9bd1ba31e7192 100644 --- a/provider/indexer-azure/pom.xml +++ b/provider/indexer-azure/pom.xml @@ -21,12 +21,12 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <artifactId>indexer-azure</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <name>indexer-azure</name> <description>Indexer Service Azure</description> <packaging>jar</packaging> @@ -39,7 +39,7 @@ <azure.appservice.subscription /> <log4j.version>2.17.1</log4j.version> <nimbus-jose-jwt.version>8.2</nimbus-jose-jwt.version> - <indexer-core.version>0.14.0-SNAPSHOT</indexer-core.version> + <indexer-core.version>0.15.0-SNAPSHOT</indexer-core.version> <spring-security-jwt.version>1.1.1.RELEASE</spring-security-jwt.version> <osdu.corelibazure.version>0.14.0-rc2</osdu.corelibazure.version> <osdu.oscorecommon.version>0.13.0</osdu.oscorecommon.version> @@ -227,6 +227,14 @@ <version>1.7.0</version> </dependency> + <!-- Prometheus Dependency --> + <dependency> + <groupId>io.micrometer</groupId> + <artifactId>micrometer-registry-prometheus</artifactId> + <scope>runtime</scope> + </dependency> + + <!-- Test Dependencies --> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java index 6ee0289c6e1526316a71f3b94f372dcb6ed0c1bc..f7cabb70c42148fac7ddf806c811d3976b80aa91 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java @@ -167,8 +167,10 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder { message.setContentType("application/json"); try { - logger.info("Indexer publishes message to Service Bus " + headers.getCorrelationId()); + long startTime = System.currentTimeMillis(); topicClientFactory.getClient(headers.getPartitionId(), serviceBusReindexTopicName).send(message); + long stopTime = System.currentTimeMillis(); + logger.info(String.format("Indexer publishes message to Service Bus, messageId: %s | time taken to send message: %d milliseconds ", message.getMessageId(), stopTime - startTime)); } catch (Exception e) { logger.error(e.getMessage(), e); } diff --git a/provider/indexer-azure/src/main/resources/application.properties b/provider/indexer-azure/src/main/resources/application.properties index 8f479afcd82f6acbe812168eae39a0980b076310..f86f5149ad97e503a195f750f45463ac1165d7e4 100644 --- a/provider/indexer-azure/src/main/resources/application.properties +++ b/provider/indexer-azure/src/main/resources/application.properties @@ -93,6 +93,9 @@ management.server.port=8081 management.health.azure-key-vault.enabled=false management.health.elasticsearch.enabled=false +management.endpoints.web.exposure.include=${web_exposure_endpoints:health,info} +management.metrics.enable.all=${enable_metrics:false} + #Redis -redis.database=${REDIS_DATABASE} \ No newline at end of file +redis.database=${REDIS_DATABASE} diff --git a/provider/indexer-gcp/pom.xml b/provider/indexer-gcp/pom.xml index 311aa52ab24e9f07619c5db489bf3d1d2a78785f..761d69d2b6bcd0321c172999689fbe961de4929b 100644 --- a/provider/indexer-gcp/pom.xml +++ b/provider/indexer-gcp/pom.xml @@ -5,12 +5,12 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <artifactId>indexer-gcp</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <name>indexer-gcp</name> <description>Indexer Service GCP App Engine</description> <packaging>jar</packaging> @@ -24,7 +24,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <!-- excluded due to runtime conflict with latest core-lib-gcp transient dependencies --> <exclusions> <exclusion> diff --git a/provider/indexer-ibm/pom.xml b/provider/indexer-ibm/pom.xml index 378bf7dace7c028b53b55110d81fced5a63d35e3..f1a4072c0f0babd71d3156b69e41ae8f619db093 100644 --- a/provider/indexer-ibm/pom.xml +++ b/provider/indexer-ibm/pom.xml @@ -21,7 +21,7 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -53,7 +53,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <exclusions> <exclusion> <groupId>io.netty</groupId> diff --git a/provider/indexer-reference/pom.xml b/provider/indexer-reference/pom.xml index 3e1359fa94dae1c660471bfd797f0dc482d8b961..14d6ed1e0f2ebc326af7de8a27b6ae26b1462aec 100644 --- a/provider/indexer-reference/pom.xml +++ b/provider/indexer-reference/pom.xml @@ -22,12 +22,12 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <artifactId>indexer-reference</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <name>indexer-reference</name> <description>Indexer Service GCP Anthos</description> <packaging>jar</packaging> @@ -36,7 +36,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/testing/indexer-test-aws/pom.xml b/testing/indexer-test-aws/pom.xml index 538651fb4407d563794d76bc9f5259b443484991..9c83945762babe928c119a2e6546dde5d6052122 100644 --- a/testing/indexer-test-aws/pom.xml +++ b/testing/indexer-test-aws/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-aws</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> @@ -42,7 +42,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> </dependency> <!-- AWS specific packages --> diff --git a/testing/indexer-test-azure/pom.xml b/testing/indexer-test-azure/pom.xml index 50f217f25c093c524e7a0308997c9da2ffebc12b..71b67e74014aa0b851b8a96cbf1724edf2ed05e8 100644 --- a/testing/indexer-test-azure/pom.xml +++ b/testing/indexer-test-azure/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-azure</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> @@ -45,7 +45,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> diff --git a/testing/indexer-test-core/pom.xml b/testing/indexer-test-core/pom.xml index 28dec9cf0cae26b8fafcf4779856283652a04ce7..58a03dd055ed7f8db8a9a38471f150b6bb18950a 100644 --- a/testing/indexer-test-core/pom.xml +++ b/testing/indexer-test-core/pom.xml @@ -5,13 +5,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <properties> <maven.compiler.target>1.8</maven.compiler.target> diff --git a/testing/indexer-test-gcp/pom.xml b/testing/indexer-test-gcp/pom.xml index c32245324cbf5bf9290df99dab3b0ff2886c3bce..32ea67ded9eaf7846ce0d91961bf3abe9b71a8bc 100644 --- a/testing/indexer-test-gcp/pom.xml +++ b/testing/indexer-test-gcp/pom.xml @@ -6,13 +6,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-gcp</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> @@ -37,7 +37,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> </dependency> <!-- Cucumber --> diff --git a/testing/indexer-test-ibm/pom.xml b/testing/indexer-test-ibm/pom.xml index 26f5ddcdcbe3c314759875f93995117f288ae372..2face84f60e0b83a3068fc8f84f14bbf5efb3cbd 100644 --- a/testing/indexer-test-ibm/pom.xml +++ b/testing/indexer-test-ibm/pom.xml @@ -6,13 +6,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-ibm</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> @@ -38,7 +38,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/testing/pom.xml b/testing/pom.xml index 08218f0dd1511159b46ec16efe599ca5d66ca7e2..047e96b2b66e33a975bdfae33bc5cb0c4210cbb6 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -18,7 +18,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.14.0-SNAPSHOT</version> + <version>0.15.0-SNAPSHOT</version> <description>Indexer Service Integration Test Root Project</description> <properties> <spring.version>5.1.19.RELEASE</spring.version>