Skip to content

Commit

Permalink
Merge branch '1.3' of github.com:opensearch-project/observability int…
Browse files Browse the repository at this point in the history
…o qs

Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Dec 1, 2022
2 parents 3b4cdf8 + a7435c7 commit 5182ac7
Show file tree
Hide file tree
Showing 23 changed files with 116 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: [pull_request, push]
env:
PLUGIN_NAME: dashboards-observability
OPENSEARCH_VERSION: '1.3'
OPENSEARCH_PLUGIN_VERSION: 1.3.6.0
OPENSEARCH_PLUGIN_VERSION: 1.3.7.0

jobs:

Expand Down
4 changes: 2 additions & 2 deletions dashboards-observability/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "observabilityDashboards",
"version": "1.3.6.0",
"opensearchDashboardsVersion": "1.3.6",
"version": "1.3.7.0",
"opensearchDashboardsVersion": "1.3.7",
"server": true,
"ui": true,
"requiredPlugins": [
Expand Down
5 changes: 3 additions & 2 deletions dashboards-observability/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "observability-dashboards",
"version": "1.3.6.0",
"version": "1.3.7.0",
"main": "index.ts",
"license": "Apache-2.0",
"scripts": {
Expand Down Expand Up @@ -40,6 +40,7 @@
"glob-parent": "^6.0.1",
"ansi-regex": "^5.0.1",
"json-schema": "^0.4.0",
"qs": "^6.10.3"
"qs": "~6.10.3",
"minimatch": "^3.0.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,160 +26,8 @@ exports[`Visualization Container Component renders add visualization container 1
grow={false}
>
<div
<<<<<<< HEAD
className="euiPanel euiPanel--paddingMedium euiPanel--flexGrowZero panel-full-width"
>
<div
className="mouseGrabber"
>
<EuiFlexGroup
justifyContent="spaceBetween"
>
<div
className="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<EuiFlexItem
style={
Object {
"width": "35%",
}
}
>
<div
className="euiFlexItem"
style={
Object {
"width": "35%",
}
}
>
<EuiText
className="panels-title-text"
grow={false}
>
<div
className="euiText euiText--medium panels-title-text euiText--constrainedWidth"
>
<EuiToolTip
content=""
delay="long"
position="top"
>
<span
className="euiToolTipAnchor"
onKeyUp={[Function]}
onMouseOut={[Function]}
onMouseOver={[Function]}
>
<h5
onBlur={[Function]}
onFocus={[Function]}
/>
</span>
</EuiToolTip>
</div>
</EuiText>
</div>
</EuiFlexItem>
<EuiFlexItem
className="visualization-action-button"
grow={false}
>
<div
className="euiFlexItem euiFlexItem--flexGrowZero visualization-action-button"
>
<EuiIcon
onClick={[Function]}
type="crossInACircleFilled"
>
<EuiIconEmpty
aria-hidden={true}
className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false"
onClick={[Function]}
role="img"
style={null}
>
<svg
aria-hidden={true}
className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false"
height={16}
onClick={[Function]}
role="img"
style={null}
viewBox="0 0 16 16"
width={16}
xmlns="http://www.w3.org/2000/svg"
/>
</EuiIconEmpty>
</EuiIcon>
</div>
</EuiFlexItem>
</div>
</EuiFlexGroup>
</div>
<div
className="visualization-div"
>
<EuiLoadingChart
className="visualization-loading-chart"
mono={true}
size="xl"
>
<span
className="euiLoadingChart euiLoadingChart--mono visualization-loading-chart euiLoadingChart--xLarge"
>
<span
className="euiLoadingChart__bar"
/>
<span
className="euiLoadingChart__bar"
/>
<span
className="euiLoadingChart__bar"
/>
<span
className="euiLoadingChart__bar"
/>
</span>
</EuiLoadingChart>
</div>
</div>
</EuiPanel>
</VisualizationContainer>
`;

exports[`Visualization Container Component renders add visualization container 2`] = `
<VisualizationContainer
cloneVisualization={[MockFunction]}
editMode={true}
fromTime="now-15m"
http={[MockFunction]}
onRefresh={true}
pplFilterValue="where Carrier = \\"OpenSearch-Air\\""
pplService={
PPLService {
"fetch": [Function],
"http": [MockFunction],
}
}
removeVisualization={[MockFunction]}
savedVisualizationId="oiuccXwBYVazWqOO1e06"
showFlyout={[MockFunction]}
toTime="now"
visualizationId="panel_viz_9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
>
<EuiPanel
className="panel-full-width"
grow={false}
>
<div
className="euiPanel euiPanel--paddingMedium euiPanel--flexGrowZero panel-full-width"
=======
className="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPanel--flexGrowZero panel-full-width"
data-test-subj="VisualizationPanel"
>>>>>>> 6b15239 (Add data test subj to app analytics (#704))
>
<div
className="mouseGrabber"
Expand Down
34 changes: 17 additions & 17 deletions dashboards-observability/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ astral-regex@^1.0.0:
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==

async@^3.2.0:
version "3.2.1"
resolved "https://registry.yarnpkg.com/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8"
integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==
version "3.2.3"
resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9"
integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==

asynckit@^0.4.0:
version "0.4.0"
Expand Down Expand Up @@ -2040,17 +2040,17 @@ mimic-fn@^2.1.0:
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==

minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
minimatch@^3.0.4, minimatch@^3.0.5:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"

minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==

mkdirp@^0.5.1, mkdirp@^0.5.4:
version "0.5.5"
Expand All @@ -2060,9 +2060,9 @@ mkdirp@^0.5.1, mkdirp@^0.5.4:
minimist "^1.2.5"

moment@^2.27.0:
version "2.29.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
version "2.29.4"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==

[email protected]:
version "2.0.0"
Expand Down Expand Up @@ -2379,10 +2379,10 @@ pure-color@^1.3.0:
resolved "https://registry.yarnpkg.com/pure-color/-/pure-color-1.3.0.tgz#1fe064fb0ac851f0de61320a8bf796836422f33e"
integrity sha1-H+Bk+wrIUfDeYTIKi/eWg2Qi8z4=

qs@^6.10.3, qs@~6.5.2:
version "6.11.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
qs@~6.10.3, qs@~6.5.2:
version "6.10.5"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4"
integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ==
dependencies:
side-channel "^1.0.4"

Expand Down
7 changes: 4 additions & 3 deletions opensearch-observability/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "1.3.6-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "1.3.7-SNAPSHOT")
// 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT
opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2')
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
Expand All @@ -27,7 +27,7 @@ buildscript {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.12.0"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0"
classpath "org.jacoco:org.jacoco.agent:0.8.7"
}
}
Expand Down Expand Up @@ -80,7 +80,8 @@ configurations.all {
resolutionStrategy {
force "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
force "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}"
force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.11.4"
force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.13.4"
force "org.yaml:snakeyaml:1.32"
}
}

Expand Down
5 changes: 5 additions & 0 deletions opensearch-observability/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ style:
ReturnCount:
active: true
max: 10
complexity:
LongMethod:
threshold: 120
NestedBlockDepth:
threshold: 5
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ internal object ObservabilityIndex {
log.info("$LOG_PREFIX:Index $INDEX_NAME creation Acknowledged")
reindexNotebooks()
} else {
throw IllegalStateException("$LOG_PREFIX:Index $INDEX_NAME creation not Acknowledged")
error("$LOG_PREFIX:Index $INDEX_NAME creation not Acknowledged")
}
} catch (exception: ResourceAlreadyExistsException) {
log.warn("message: ${exception.message}")
} catch (exception: Exception) {
if (exception !is ResourceAlreadyExistsException && exception.cause !is ResourceAlreadyExistsException) {
if (exception.cause !is ResourceAlreadyExistsException) {
throw exception
}
}
Expand All @@ -130,7 +132,7 @@ internal object ObservabilityIndex {
if (response.isAcknowledged) {
log.info("$LOG_PREFIX:Index $INDEX_NAME update mapping Acknowledged")
} else {
throw IllegalStateException("$LOG_PREFIX:Index $INDEX_NAME update mapping not Acknowledged")
error("$LOG_PREFIX:Index $INDEX_NAME update mapping not Acknowledged")
}
this.mappingsUpdated = true
} catch (exception: IndexNotFoundException) {
Expand All @@ -153,11 +155,11 @@ internal object ObservabilityIndex {
.refresh(true)
.get()
if (reindexResponse.isTimedOut) {
throw IllegalStateException("$LOG_PREFIX:Index - reindex $NOTEBOOKS_INDEX_NAME timed out")
error("$LOG_PREFIX:Index - reindex $NOTEBOOKS_INDEX_NAME timed out")
} else if (reindexResponse.searchFailures.isNotEmpty()) {
throw IllegalStateException("$LOG_PREFIX:Index - reindex $NOTEBOOKS_INDEX_NAME failed with searchFailures")
error("$LOG_PREFIX:Index - reindex $NOTEBOOKS_INDEX_NAME failed with searchFailures")
} else if (reindexResponse.bulkFailures.isNotEmpty()) {
throw IllegalStateException("$LOG_PREFIX:Index - reindex $NOTEBOOKS_INDEX_NAME failed with bulkFailures")
error("$LOG_PREFIX:Index - reindex $NOTEBOOKS_INDEX_NAME failed with bulkFailures")
} else if (reindexResponse.total != reindexResponse.created + reindexResponse.updated) {
throw IllegalStateException(
"$LOG_PREFIX:Index - reindex number of docs created:${reindexResponse.created} + " +
Expand All @@ -168,8 +170,10 @@ internal object ObservabilityIndex {
"$LOG_PREFIX:Index - reindex ${reindexResponse.created} docs created " +
"and ${reindexResponse.updated} docs updated in $INDEX_NAME"
)
} catch (exception: ResourceNotFoundException) {
log.warn("message: ${exception.message}")
} catch (exception: Exception) {
if (exception !is ResourceNotFoundException && exception.cause !is ResourceNotFoundException) {
if (exception.cause !is ResourceNotFoundException) {
throw exception
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ internal class ObservabilityQueryHelper(private val types: EnumSet<Observability
}
}

private fun addTermQueryBuilder(query: BoolQueryBuilder, queryKey: String, queryValue: String) {
prefixes.forEach { query.filter(QueryBuilders.termQuery("${it.tag}.$queryKey", queryValue)) }
}

private fun addTermsQueryBuilder(query: BoolQueryBuilder, queryKey: String, queryValue: String) {
prefixes.forEach { query.filter(QueryBuilders.termsQuery("${it.tag}.$queryKey", queryValue.split(","))) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal object SecurityAccess {
SpecialPermission.check()
return try {
AccessController.doPrivileged(operation)
} catch (e: PrivilegedActionException) {
} catch (@Suppress("SwallowedException") e: PrivilegedActionException) {
throw (e.cause as Exception?)!!
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ internal object PluginSettings {
try {
settings = Settings.builder().loadFromPath(defaultSettingYmlFile).build()
} catch (exception: IOException) {
log.warn("$LOG_PREFIX:Failed to load ${defaultSettingYmlFile.toAbsolutePath()}")
log.warn("$LOG_PREFIX:Failed to load ${defaultSettingYmlFile.toAbsolutePath()} message:${exception.message}")
}
}
// Initialize the settings values to default values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
# Settings file for the observability index
index:
number_of_shards: "1"
auto_expand_replicas: "0-1"
auto_expand_replicas: "0-2"
number_of_replicas: "0"

This file was deleted.

Loading

0 comments on commit 5182ac7

Please sign in to comment.