├── .dockerignore ├── .gitignore ├── .gitlab-ci.yml ├── Dockerfile ├── DockerfileBad ├── README.md ├── api-test.http ├── build.gradle.kts ├── config-server ├── build.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── src │ └── main │ ├── java │ └── com │ │ └── infratech │ │ └── configserver │ │ └── ConfigServerApplication.java │ └── resources │ └── application.properties ├── docker-compose.yml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── k8s ├── rightdevops-configmap.yaml ├── rightdevops-deployment.yaml └── rightdevops-secret.yaml ├── load-test.jmx ├── monitoring └── config │ ├── grafana │ ├── Dockerfile │ └── provisioning │ │ ├── dashboards │ │ ├── 4701_rev10.json │ │ ├── all.yaml │ │ └── spring-boot-monitoring_rev1.json │ │ └── datasources │ │ └── all.yaml │ └── prometheus.yml ├── pom.example.xml ├── postgres ├── Dockerfile ├── initdb │ └── init-db.sh └── postgresql.conf ├── settings.gradle.kts ├── src ├── main │ ├── java │ │ └── ru │ │ │ └── zencode │ │ │ └── rightdevops │ │ │ ├── BaseEntity.java │ │ │ ├── Cat.java │ │ │ ├── CatController.java │ │ │ ├── CatRepository.java │ │ │ ├── CatService.java │ │ │ ├── CatServiceImpl.java │ │ │ └── RightDevOpsApplication.java │ └── resources │ │ ├── application-docker-compose.properties │ │ ├── application-local.properties │ │ └── db │ │ └── changelog │ │ └── db.changelog-master.xml └── test │ └── java │ └── ru │ └── zencode │ └── rightdevops │ └── RightDevOpsApplicationTests.java └── wiremock ├── __files └── test.json └── mappings └── test-api.json /.dockerignore: -------------------------------------------------------------------------------- 1 | ### Java template 2 | # Compiled class file 3 | *.class 4 | 5 | # Log file 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.nar 18 | *.ear 19 | *.zip 20 | *.tar.gz 21 | *.rar 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | replay_pid* 26 | 27 | ### Maven template 28 | target/ 29 | pom.xml.tag 30 | pom.xml.releaseBackup 31 | pom.xml.versionsBackup 32 | pom.xml.next 33 | release.properties 34 | dependency-reduced-pom.xml 35 | buildNumber.properties 36 | .mvn/timing.properties 37 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 38 | .mvn/wrapper/maven-wrapper.jar 39 | 40 | # Eclipse m2e generated files 41 | # Eclipse Core 42 | .project 43 | # JDT-specific (Eclipse Java Development Tools) 44 | .classpath 45 | 46 | ### JetBrains template 47 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 48 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 49 | 50 | # User-specific stuff 51 | .idea/**/workspace.xml 52 | .idea/**/tasks.xml 53 | .idea/**/usage.statistics.xml 54 | .idea/**/dictionaries 55 | .idea/**/shelf 56 | 57 | # AWS User-specific 58 | .idea/**/aws.xml 59 | 60 | # Generated files 61 | .idea/**/contentModel.xml 62 | 63 | # Sensitive or high-churn files 64 | .idea/**/dataSources/ 65 | .idea/**/dataSources.ids 66 | .idea/**/dataSources.local.xml 67 | .idea/**/sqlDataSources.xml 68 | .idea/**/dynamic.xml 69 | .idea/**/uiDesigner.xml 70 | .idea/**/dbnavigator.xml 71 | 72 | # Gradle 73 | .idea/**/gradle.xml 74 | .idea/**/libraries 75 | 76 | # Gradle and Maven with auto-import 77 | # When using Gradle or Maven with auto-import, you should exclude module files, 78 | # since they will be recreated, and may cause churn. Uncomment if using 79 | # auto-import. 80 | # .idea/artifacts 81 | # .idea/compiler.xml 82 | # .idea/jarRepositories.xml 83 | # .idea/modules.xml 84 | # .idea/*.iml 85 | # .idea/modules 86 | # *.iml 87 | # *.ipr 88 | 89 | # CMake 90 | cmake-build-*/ 91 | 92 | # Mongo Explorer plugin 93 | .idea/**/mongoSettings.xml 94 | 95 | # File-based project format 96 | *.iws 97 | 98 | # IntelliJ 99 | out/ 100 | 101 | # mpeltonen/sbt-idea plugin 102 | .idea_modules/ 103 | 104 | # JIRA plugin 105 | atlassian-ide-plugin.xml 106 | 107 | # Cursive Clojure plugin 108 | .idea/replstate.xml 109 | 110 | # SonarLint plugin 111 | .idea/sonarlint/ 112 | 113 | # Crashlytics plugin (for Android Studio and IntelliJ) 114 | com_crashlytics_export_strings.xml 115 | crashlytics.properties 116 | crashlytics-build.properties 117 | fabric.properties 118 | 119 | # Editor-based Rest Client 120 | .idea/httpRequests 121 | 122 | # Android studio 3.1+ serialized cache file 123 | .idea/caches/build_file_checksums.ser 124 | 125 | ### Gradle template 126 | .gradle 127 | **/build/ 128 | !src/**/build/ 129 | 130 | # Ignore Gradle GUI config 131 | gradle-app.setting 132 | 133 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 134 | !gradle-wrapper.jar 135 | 136 | # Avoid ignore Gradle wrappper properties 137 | !gradle-wrapper.properties 138 | 139 | # Cache of project 140 | .gradletasknamecache 141 | 142 | # Eclipse Gradle plugin generated files 143 | # Eclipse Core 144 | # JDT-specific (Eclipse Java Development Tools) 145 | 146 | ### macOS template 147 | # General 148 | .DS_Store 149 | .AppleDouble 150 | .LSOverride 151 | 152 | # Icon must end with two \r 153 | Icon 154 | 155 | # Thumbnails 156 | ._* 157 | 158 | # Files that might appear in the root of a volume 159 | .DocumentRevisions-V100 160 | .fseventsd 161 | .Spotlight-V100 162 | .TemporaryItems 163 | .Trashes 164 | .VolumeIcon.icns 165 | .com.apple.timemachine.donotpresent 166 | 167 | # Directories potentially created on remote AFP share 168 | .AppleDB 169 | .AppleDesktop 170 | Network Trash Folder 171 | Temporary Items 172 | .apdisk 173 | 174 | ### Kotlin template 175 | # Compiled class file 176 | 177 | # Log file 178 | 179 | # BlueJ files 180 | 181 | # Mobile Tools for Java (J2ME) 182 | 183 | # Package Files # 184 | 185 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 186 | 187 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Java template 2 | # Compiled class file 3 | *.class 4 | 5 | # Log file 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.nar 18 | *.ear 19 | *.zip 20 | *.tar.gz 21 | *.rar 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | replay_pid* 26 | 27 | ### Maven template 28 | target/ 29 | pom.xml.tag 30 | pom.xml.releaseBackup 31 | pom.xml.versionsBackup 32 | pom.xml.next 33 | release.properties 34 | dependency-reduced-pom.xml 35 | buildNumber.properties 36 | .mvn/timing.properties 37 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 38 | .mvn/wrapper/maven-wrapper.jar 39 | 40 | # Eclipse m2e generated files 41 | # Eclipse Core 42 | .project 43 | # JDT-specific (Eclipse Java Development Tools) 44 | .classpath 45 | 46 | ### VisualStudioCode template 47 | .vscode/* 48 | !.vscode/settings.json 49 | !.vscode/tasks.json 50 | !.vscode/launch.json 51 | !.vscode/extensions.json 52 | !.vscode/*.code-snippets 53 | 54 | # Local History for Visual Studio Code 55 | .history/ 56 | 57 | # Built Visual Studio Code Extensions 58 | *.vsix 59 | 60 | ### JetBrains template 61 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 62 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 63 | 64 | # User-specific stuff 65 | .idea/**/workspace.xml 66 | .idea/**/tasks.xml 67 | .idea/**/usage.statistics.xml 68 | .idea/**/dictionaries 69 | .idea/**/shelf 70 | 71 | # AWS User-specific 72 | .idea/**/aws.xml 73 | 74 | # Generated files 75 | .idea/**/contentModel.xml 76 | 77 | # Sensitive or high-churn files 78 | .idea/**/dataSources/ 79 | .idea/**/dataSources.ids 80 | .idea/**/dataSources.local.xml 81 | .idea/**/sqlDataSources.xml 82 | .idea/**/dynamic.xml 83 | .idea/**/uiDesigner.xml 84 | .idea/**/dbnavigator.xml 85 | 86 | # Gradle 87 | .idea/**/gradle.xml 88 | .idea/**/libraries 89 | 90 | # Gradle and Maven with auto-import 91 | # When using Gradle or Maven with auto-import, you should exclude module files, 92 | # since they will be recreated, and may cause churn. Uncomment if using 93 | # auto-import. 94 | # .idea/artifacts 95 | # .idea/compiler.xml 96 | # .idea/jarRepositories.xml 97 | # .idea/modules.xml 98 | # .idea/*.iml 99 | # .idea/modules 100 | # *.iml 101 | # *.ipr 102 | 103 | # CMake 104 | cmake-build-*/ 105 | 106 | # Mongo Explorer plugin 107 | .idea/**/mongoSettings.xml 108 | 109 | # File-based project format 110 | *.iws 111 | 112 | # IntelliJ 113 | out/ 114 | 115 | # mpeltonen/sbt-idea plugin 116 | .idea_modules/ 117 | 118 | # JIRA plugin 119 | atlassian-ide-plugin.xml 120 | 121 | # Cursive Clojure plugin 122 | .idea/replstate.xml 123 | 124 | # SonarLint plugin 125 | .idea/sonarlint/ 126 | 127 | # Crashlytics plugin (for Android Studio and IntelliJ) 128 | com_crashlytics_export_strings.xml 129 | crashlytics.properties 130 | crashlytics-build.properties 131 | fabric.properties 132 | 133 | # Editor-based Rest Client 134 | .idea/httpRequests 135 | 136 | # Android studio 3.1+ serialized cache file 137 | .idea/caches/build_file_checksums.ser 138 | 139 | ### Linux template 140 | *~ 141 | 142 | # temporary files which can be created if a process still has a handle open of a deleted file 143 | .fuse_hidden* 144 | 145 | # KDE directory preferences 146 | .directory 147 | 148 | # Linux trash folder which might appear on any partition or disk 149 | .Trash-* 150 | 151 | # .nfs files are created when an open file is removed but is still being accessed 152 | .nfs* 153 | 154 | ### Gradle template 155 | .gradle 156 | **/build/ 157 | !src/**/build/ 158 | 159 | # Ignore Gradle GUI config 160 | gradle-app.setting 161 | 162 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 163 | !gradle-wrapper.jar 164 | 165 | # Avoid ignore Gradle wrappper properties 166 | !gradle-wrapper.properties 167 | 168 | # Cache of project 169 | .gradletasknamecache 170 | 171 | # Eclipse Gradle plugin generated files 172 | # Eclipse Core 173 | # JDT-specific (Eclipse Java Development Tools) 174 | 175 | ### Windows template 176 | # Windows thumbnail cache files 177 | Thumbs.db 178 | Thumbs.db:encryptable 179 | ehthumbs.db 180 | ehthumbs_vista.db 181 | 182 | # Dump file 183 | *.stackdump 184 | 185 | # Folder config file 186 | [Dd]esktop.ini 187 | 188 | # Recycle Bin used on file shares 189 | $RECYCLE.BIN/ 190 | 191 | # Windows Installer files 192 | *.cab 193 | *.msi 194 | *.msix 195 | *.msm 196 | *.msp 197 | 198 | # Windows shortcuts 199 | *.lnk 200 | 201 | ### macOS template 202 | # General 203 | .DS_Store 204 | .AppleDouble 205 | .LSOverride 206 | 207 | # Icon must end with two \r 208 | Icon 209 | 210 | # Thumbnails 211 | ._* 212 | 213 | # Files that might appear in the root of a volume 214 | .DocumentRevisions-V100 215 | .fseventsd 216 | .Spotlight-V100 217 | .TemporaryItems 218 | .Trashes 219 | .VolumeIcon.icns 220 | .com.apple.timemachine.donotpresent 221 | 222 | # Directories potentially created on remote AFP share 223 | .AppleDB 224 | .AppleDesktop 225 | Network Trash Folder 226 | Temporary Items 227 | .apdisk 228 | 229 | ### Kotlin template 230 | # Compiled class file 231 | 232 | # Log file 233 | 234 | # BlueJ files 235 | 236 | # Mobile Tools for Java (J2ME) 237 | 238 | # Package Files # 239 | 240 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 241 | .idea 242 | 243 | /.jpb/ 244 | /monitoring/grafana/ 245 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | variables: 3 | PROJECT: right-devops- 4 | MAVEN_CLI_OPTS: "-B" 5 | MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository" 6 | REGISTRY_OPTS: "-DREGISTRY_LOGIN=gitlab-ci-token -DREGISTRY_PASSWORD=$CI_JOB_TOKEN -DREGISTRY_URL=$CI_REGISTRY" 7 | DOCKER_HOST: tcp://docker:2375 8 | DOCKER_TLS_CERTDIR: "" 9 | DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client" 10 | VAULT_TOKEN_ROLE_DEV: zen-dev 11 | VAULT_WERF_SECRET_KEY_PATH_DEV: zen/right-devops/dev/werf 12 | VAULT_TOKEN_ROLE_PROD: zen-prod 13 | VAULT_WERF_SECRET_KEY_PATH_PROD: zen/right-devops/prod/werf 14 | 15 | stages: 16 | - migrate-db 17 | 18 | .migrate-db-vault-public-env: &migrate-db-vault-public-env 19 | VAULT_AUTH_ROLE: "gitlab-zen" 20 | VAULT_SERVER_URL: "https://zen-code.ru" 21 | 22 | .migrate-db-vault-private-env: &migrate-db-vault-private-env 23 | VAULT_AUTH_ROLE: "gitlab-zen" 24 | VAULT_SERVER_URL: "https://zen-code.ru" 25 | 26 | .migrate-db: 27 | stage: migrate-db 28 | image: maven-3-8-4-openjdk-17-master 29 | variables: 30 | VAULT_AUTH_PATH: "id_token_jwt" 31 | id_tokens: 32 | VAULT_ID_TOKEN: 33 | aud: https://zen-code.ru 34 | script: 35 | - mvn -version 36 | - mvn clean package -DskipTests 37 | - mvn liquibase:status -Dliquibase.verbose=true 38 | - mvn liquibase:updateSQL -Dliquibase.verbose=true -Dliquibase.logging=debug 39 | - mvn liquibase:update -Dliquibase.verbose=true -Dliquibase.logging=debug 40 | when: manual 41 | 42 | migrate-db-dev: 43 | extends: .migrate-db 44 | variables: 45 | DB_URL: "jdbc:postgresql://localhost:25432/rightdevops" 46 | DB_USERNAME: pg_admin 47 | <<: *migrate-db-vault-public-env 48 | secrets: 49 | LIQUIBASE_PASSWORD: 50 | vault: 51 | engine: 52 | name: kv-v2 53 | path: gitlab 54 | field: SPRING_DATASOURCE_PASSWORD 55 | path: zen/dev/env 56 | file: false 57 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.4.0-jdk17 as build 2 | WORKDIR /app 3 | COPY --chown=gradle:gradle . /app 4 | RUN gradle clean build --no-daemon 5 | 6 | FROM openjdk:17.0.2-slim as builder 7 | WORKDIR /app 8 | COPY --from=build /app/build/libs/right-devops-1.0.0.jar /app/right-devops.jar 9 | RUN java -Djarmode=layertools -jar right-devops.jar extract 10 | 11 | FROM openjdk:17.0.2-slim 12 | WORKDIR /app 13 | COPY --from=builder app/dependencies/ ./ 14 | COPY --from=builder app/spring-boot-loader/ ./ 15 | COPY --from=builder app/snapshot-dependencies/ ./ 16 | COPY --from=builder app/application/ ./ 17 | ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] 18 | -------------------------------------------------------------------------------- /DockerfileBad: -------------------------------------------------------------------------------- 1 | FROM openjdk:17.0.2-slim 2 | 3 | WORKDIR /app 4 | 5 | COPY ./build/libs/right-devops-1.0.0.jar /app/right-devops.jar 6 | 7 | EXPOSE 8080 8 | 9 | ENTRYPOINT ["java", "-jar", "right-devops.jar"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Правильный DevOps для Spring Boot и Java -------------------------------------------------------------------------------- /api-test.http: -------------------------------------------------------------------------------- 1 | POST /api/v1/cats 2 | Host: localhost:8080 3 | Content-Type: application/json 4 | 5 | { 6 | "name": "John Doe", 7 | "age": 5 8 | } 9 | 10 | ### 11 | GET /api/v1/cats 12 | Host: localhost:8080 13 | Accept: application/json -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | java 3 | id("org.springframework.boot") version "3.2.2" 4 | id("io.spring.dependency-management") version "1.1.4" 5 | 6 | id("org.liquibase.gradle") version "2.2.0" 7 | } 8 | 9 | group = "ru.zencode" 10 | version = "1.0.0" 11 | 12 | java { 13 | sourceCompatibility = JavaVersion.VERSION_17 14 | } 15 | 16 | configurations { 17 | compileOnly { 18 | extendsFrom(configurations.annotationProcessor.get()) 19 | } 20 | } 21 | 22 | repositories { 23 | mavenCentral() 24 | } 25 | 26 | extra["springCloudVersion"] = "2023.0.0" 27 | 28 | dependencies { 29 | implementation("org.springframework.boot:spring-boot-starter-actuator") 30 | implementation("org.springframework.boot:spring-boot-starter-data-jpa") 31 | implementation("org.springframework.boot:spring-boot-starter-web") 32 | 33 | liquibaseRuntime("org.liquibase:liquibase-core") 34 | liquibaseRuntime("ch.qos.logback:logback-core:1.2.3") 35 | liquibaseRuntime("ch.qos.logback:logback-classic:1.2.3") 36 | liquibaseRuntime("info.picocli:picocli:4.7.5") 37 | liquibaseRuntime("org.yaml:snakeyaml:1.33") 38 | liquibaseRuntime("org.postgresql:postgresql") 39 | 40 | implementation("org.springframework.cloud:spring-cloud-starter-config") 41 | compileOnly("org.projectlombok:lombok") 42 | runtimeOnly("org.postgresql:postgresql") 43 | runtimeOnly("io.micrometer:micrometer-registry-prometheus") 44 | annotationProcessor("org.projectlombok:lombok") 45 | testImplementation("org.springframework.boot:spring-boot-starter-test") 46 | } 47 | 48 | dependencyManagement { 49 | imports { 50 | mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}") 51 | } 52 | } 53 | 54 | liquibase { 55 | activities.register("main") { 56 | val dbUrl = System.getenv("DB_URL") 57 | val dbUser = System.getenv("DB_USERNAME") 58 | val dbPassword = System.getenv("DB_PASSWORD") 59 | this.arguments = mapOf( 60 | "logLevel" to "info", 61 | "searchPath" to "src/main/resources/", 62 | "changeLogFile" to "db/changelog/db.changelog-master.xml", 63 | "url" to dbUrl, 64 | "username" to dbUser, 65 | "password" to dbPassword 66 | ) 67 | } 68 | runList = "main" 69 | } 70 | 71 | tasks.withType { 72 | useJUnitPlatform() 73 | } 74 | -------------------------------------------------------------------------------- /config-server/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | java 3 | id("org.springframework.boot") version "2.7.3" 4 | id("io.spring.dependency-management") version "1.0.14.RELEASE" 5 | } 6 | 7 | group = "com.infratech" 8 | version = "1.0.0" 9 | java.sourceCompatibility = JavaVersion.VERSION_11 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom(configurations.annotationProcessor.get()) 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | springBoot { 22 | buildInfo() 23 | } 24 | 25 | dependencies { 26 | implementation("org.springframework.boot:spring-boot-starter-actuator") 27 | implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client") 28 | implementation("org.springframework.cloud:spring-cloud-config-server") 29 | } 30 | 31 | tasks.test { 32 | useJUnitPlatform() 33 | } 34 | 35 | ext { 36 | set("springCloudVersion", "2021.0.4") 37 | } 38 | 39 | dependencyManagement { 40 | imports { 41 | mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}") 42 | } 43 | } -------------------------------------------------------------------------------- /config-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RustamKuramshin/right-devops/80199e8ee7bb1da576bd2e4a9492afbf69f9a00d/config-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /config-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /config-server/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /config-server/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /config-server/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "config-server" 2 | -------------------------------------------------------------------------------- /config-server/src/main/java/com/infratech/configserver/ConfigServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.infratech.configserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.config.server.EnableConfigServer; 6 | 7 | @SpringBootApplication 8 | @EnableConfigServer 9 | public class ConfigServerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(ConfigServerApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /config-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=config-server 2 | 3 | spring.cloud.config.server.git.clone-on-start=true 4 | spring.cloud.config.server.git.uri=${GITLAB_REPO_URI} 5 | spring.cloud.config.server.git.username=${GITLAB_ACCESS_TOKEN_NAME} 6 | spring.cloud.config.server.git.password=${GITLAB_ACCESS_TOKEN_PASSWORD} 7 | spring.cloud.config.server.git.search-paths=dev/,dev/{application} 8 | 9 | eureka.instance.prefer-ip-address=true 10 | eureka.instance.instance-id=${POD_NAME} 11 | eureka.client.serviceUrl.defaultZone=http://${EUREKA_USER_NAME}:${EUREKA_USER_PASSWORD}@${EUREKA_DOMAIN}/eureka/ 12 | 13 | # Metrics 14 | management.endpoints.web.exposure.include=* 15 | management.endpoints.enabled-by-default=true 16 | management.info.java.enabled=true 17 | management.info.env.enabled=true 18 | management.info.os.enabled=true 19 | management.info.build.enabled=true 20 | management.info.git.enabled=true 21 | management.info.git.mode=full -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | app: 6 | build: 7 | dockerfile: Dockerfile 8 | container_name: app 9 | depends_on: 10 | - postgres 11 | ports: 12 | - "28080:8080" 13 | environment: 14 | SPRING_PROFILES_ACTIVE: docker-compose 15 | 16 | postgres: 17 | build: 18 | dockerfile: ./Dockerfile 19 | context: postgres 20 | container_name: postgres 21 | ports: 22 | - "25432:5432" 23 | restart: always 24 | volumes: 25 | - postgres_data:/var/lib/postgresql/data 26 | - ./postgres/postgresql.conf:/etc/postgresql/postgresql.conf 27 | environment: 28 | - POSTGRES_USER=pgadmin 29 | - POSTGRES_PASSWORD=pgadmin 30 | command: postgres -c config_file=/etc/postgresql/postgresql.conf 31 | 32 | grafana: 33 | build: './monitoring/config/grafana' 34 | container_name: grafana 35 | ports: 36 | - "23000:3000" 37 | restart: always 38 | volumes: 39 | - ./monitoring/grafana:/var/lib/grafana 40 | environment: 41 | - GF_SECURITY_ADMIN_USER=admin 42 | - GF_SECURITY_ADMIN_PASSWORD=admin 43 | 44 | prometheus: 45 | image: prom/prometheus 46 | container_name: prometheus 47 | ports: 48 | - "29090:9090" 49 | restart: always 50 | volumes: 51 | - ./monitoring/config/prometheus.yml:/etc/prometheus/prometheus.yml 52 | command: 53 | - '--config.file=/etc/prometheus/prometheus.yml' 54 | - '--log.level=debug' 55 | 56 | wiremock: 57 | image: wiremock/wiremock 58 | container_name: wiremock 59 | ports: 60 | - "28081:8080" 61 | restart: always 62 | volumes: 63 | - ./wiremock/__files:/home/wiremock/__files 64 | - ./wiremock:/home/wiremock 65 | entrypoint: ["/docker-entrypoint.sh", "--print-all-network-traffic", "--disable-gzip", "--verbose"] 66 | 67 | volumes: 68 | postgres_data: 69 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RustamKuramshin/right-devops/80199e8ee7bb1da576bd2e4a9492afbf69f9a00d/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /k8s/rightdevops-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: right-devops-config 5 | data: 6 | application.properties: | 7 | spring.application.name=right-devops 8 | spring.jpa.show-sql=true 9 | spring.jpa.properties.hibernate.format_sql=true 10 | spring.liquibase.change-log=db/changelog/db.changelog-master.xml 11 | spring.datasource.url=jdbc:postgresql://localhost:25432/rightdevops 12 | spring.datasource.driver-class-name=org.postgresql.Driver 13 | spring.sql.init.encoding=UTF-8 14 | spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect 15 | logging.level.org.hibernate.SQL=DEBUG 16 | logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE 17 | 18 | -------------------------------------------------------------------------------- /k8s/rightdevops-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: right-devops-deployment 5 | spec: 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: right-devops 10 | template: 11 | metadata: 12 | labels: 13 | app: right-devops 14 | spec: 15 | containers: 16 | - name: right-devops 17 | image: localhost:5000/right-devops:1.0.0 18 | ports: 19 | - containerPort: 8080 20 | volumeMounts: 21 | - name: config-volume 22 | mountPath: /config 23 | env: 24 | - name: SPRING_DATASOURCE_USERNAME 25 | valueFrom: 26 | secretKeyRef: 27 | name: right-devops-secrets 28 | key: datasource.username 29 | - name: SPRING_DATASOURCE_PASSWORD 30 | valueFrom: 31 | secretKeyRef: 32 | name: right-devops-secrets 33 | key: datasource.password 34 | volumes: 35 | - name: config-volume 36 | configMap: 37 | name: right-devops-config 38 | -------------------------------------------------------------------------------- /k8s/rightdevops-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: right-devops-secrets 5 | type: Opaque 6 | data: 7 | datasource.username: cGdhZG1pbg== 8 | datasource.password: cGdhZG1pbg== 9 | -------------------------------------------------------------------------------- /load-test.jmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 100 12 | 1 13 | true 14 | continue 15 | 16 | -1 17 | false 18 | 19 | 20 | 21 | 22 | 23 | 24 | protocol 25 | http 26 | = 27 | 28 | 29 | server 30 | localhost 31 | = 32 | 33 | 34 | port 35 | 8080 36 | = 37 | 38 | 39 | baseUrl 40 | /api/v1 41 | = 42 | 43 | 44 | 45 | 46 | 47 | ${server} 48 | ${port} 49 | ${protocol} 50 | ${baseUrl}/cats 51 | true 52 | POST 53 | true 54 | true 55 | 56 | 57 | 58 | false 59 | { 60 | "name": "${__RandomString(10,abcdefg)}", 61 | "age": ${__Random(0,10)} 62 | } 63 | = 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Content-Type 73 | application/json 74 | 75 | 76 | 77 | 78 | 79 | 80 | ${server} 81 | ${port} 82 | ${protocol} 83 | ${baseUrl}/cats 84 | true 85 | GET 86 | true 87 | false 88 | 89 | 90 | 91 | 92 | 93 | 94 | false 95 | 96 | saveConfig 97 | 98 | 99 | true 100 | true 101 | true 102 | 103 | true 104 | true 105 | true 106 | true 107 | false 108 | true 109 | true 110 | false 111 | false 112 | false 113 | true 114 | false 115 | false 116 | false 117 | true 118 | 0 119 | true 120 | true 121 | true 122 | true 123 | true 124 | true 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /monitoring/config/grafana/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM grafana/grafana 2 | ADD ./provisioning /etc/grafana/provisioning -------------------------------------------------------------------------------- /monitoring/config/grafana/provisioning/dashboards/4701_rev10.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PROMETHEUS", 5 | "label": "Prometheus", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "prometheus", 9 | "pluginName": "Prometheus" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.6.5" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "prometheus", 28 | "name": "Prometheus", 29 | "version": "1.0.0" 30 | }, 31 | { 32 | "type": "panel", 33 | "id": "singlestat", 34 | "name": "Singlestat", 35 | "version": "" 36 | } 37 | ], 38 | "annotations": { 39 | "list": [ 40 | { 41 | "builtIn": 1, 42 | "datasource": "-- Grafana --", 43 | "enable": true, 44 | "hide": true, 45 | "iconColor": "rgba(0, 211, 255, 1)", 46 | "limit": 100, 47 | "name": "Annotations & Alerts", 48 | "showIn": 0, 49 | "type": "dashboard" 50 | }, 51 | { 52 | "datasource": "${DS_PROMETHEUS}", 53 | "enable": true, 54 | "expr": "resets(process_uptime_seconds{application=\"$application\", instance=\"$instance\"}[1m]) > 0", 55 | "iconColor": "rgba(255, 96, 96, 1)", 56 | "name": "Restart Detection", 57 | "showIn": 0, 58 | "step": "1m", 59 | "tagKeys": "restart-tag", 60 | "textFormat": "uptime reset", 61 | "titleFormat": "Restart" 62 | } 63 | ] 64 | }, 65 | "description": "Dashboard for Micrometer instrumented applications (Java, Spring Boot, Micronaut)", 66 | "editable": true, 67 | "gnetId": 4701, 68 | "graphTooltip": 1, 69 | "hideControls": false, 70 | "id": null, 71 | "links": [], 72 | "refresh": "30s", 73 | "rows": [ 74 | { 75 | "collapse": false, 76 | "height": "100px", 77 | "panels": [ 78 | { 79 | "cacheTimeout": null, 80 | "colorBackground": false, 81 | "colorValue": true, 82 | "colors": [ 83 | "rgba(245, 54, 54, 0.9)", 84 | "rgba(237, 129, 40, 0.89)", 85 | "rgba(50, 172, 45, 0.97)" 86 | ], 87 | "datasource": "${DS_PROMETHEUS}", 88 | "decimals": 1, 89 | "editable": true, 90 | "error": false, 91 | "format": "s", 92 | "gauge": { 93 | "maxValue": 100, 94 | "minValue": 0, 95 | "show": false, 96 | "thresholdLabels": false, 97 | "thresholdMarkers": true 98 | }, 99 | "height": "", 100 | "id": 63, 101 | "interval": null, 102 | "links": [], 103 | "mappingType": 1, 104 | "mappingTypes": [ 105 | { 106 | "name": "value to text", 107 | "value": 1 108 | }, 109 | { 110 | "name": "range to text", 111 | "value": 2 112 | } 113 | ], 114 | "maxDataPoints": 100, 115 | "nullPointMode": "connected", 116 | "nullText": null, 117 | "postfix": "", 118 | "postfixFontSize": "50%", 119 | "prefix": "", 120 | "prefixFontSize": "70%", 121 | "rangeMaps": [ 122 | { 123 | "from": "null", 124 | "text": "N/A", 125 | "to": "null" 126 | } 127 | ], 128 | "span": 3, 129 | "sparkline": { 130 | "fillColor": "rgba(31, 118, 189, 0.18)", 131 | "full": false, 132 | "lineColor": "rgb(31, 120, 193)", 133 | "show": false 134 | }, 135 | "tableColumn": "", 136 | "targets": [ 137 | { 138 | "expr": "process_uptime_seconds{application=\"$application\", instance=\"$instance\"}", 139 | "format": "time_series", 140 | "intervalFactor": 2, 141 | "legendFormat": "", 142 | "metric": "", 143 | "refId": "A", 144 | "step": 14400 145 | } 146 | ], 147 | "thresholds": "", 148 | "title": "Uptime", 149 | "transparent": false, 150 | "type": "singlestat", 151 | "valueFontSize": "80%", 152 | "valueMaps": [ 153 | { 154 | "op": "=", 155 | "text": "N/A", 156 | "value": "null" 157 | } 158 | ], 159 | "valueName": "current" 160 | }, 161 | { 162 | "cacheTimeout": null, 163 | "colorBackground": false, 164 | "colorValue": true, 165 | "colors": [ 166 | "rgba(245, 54, 54, 0.9)", 167 | "rgba(237, 129, 40, 0.89)", 168 | "rgba(50, 172, 45, 0.97)" 169 | ], 170 | "datasource": "${DS_PROMETHEUS}", 171 | "decimals": null, 172 | "editable": true, 173 | "error": false, 174 | "format": "dateTimeAsIso", 175 | "gauge": { 176 | "maxValue": 100, 177 | "minValue": 0, 178 | "show": false, 179 | "thresholdLabels": false, 180 | "thresholdMarkers": true 181 | }, 182 | "height": "", 183 | "id": 92, 184 | "interval": null, 185 | "links": [], 186 | "mappingType": 1, 187 | "mappingTypes": [ 188 | { 189 | "name": "value to text", 190 | "value": 1 191 | }, 192 | { 193 | "name": "range to text", 194 | "value": 2 195 | } 196 | ], 197 | "maxDataPoints": 100, 198 | "nullPointMode": "connected", 199 | "nullText": null, 200 | "postfix": "", 201 | "postfixFontSize": "50%", 202 | "prefix": "", 203 | "prefixFontSize": "70%", 204 | "rangeMaps": [ 205 | { 206 | "from": "null", 207 | "text": "N/A", 208 | "to": "null" 209 | } 210 | ], 211 | "span": 3, 212 | "sparkline": { 213 | "fillColor": "rgba(31, 118, 189, 0.18)", 214 | "full": false, 215 | "lineColor": "rgb(31, 120, 193)", 216 | "show": false 217 | }, 218 | "tableColumn": "", 219 | "targets": [ 220 | { 221 | "expr": "process_start_time_seconds{application=\"$application\", instance=\"$instance\"}*1000", 222 | "format": "time_series", 223 | "intervalFactor": 2, 224 | "legendFormat": "", 225 | "metric": "", 226 | "refId": "A", 227 | "step": 14400 228 | } 229 | ], 230 | "thresholds": "", 231 | "title": "Start time", 232 | "transparent": false, 233 | "type": "singlestat", 234 | "valueFontSize": "70%", 235 | "valueMaps": [ 236 | { 237 | "op": "=", 238 | "text": "N/A", 239 | "value": "null" 240 | } 241 | ], 242 | "valueName": "current" 243 | }, 244 | { 245 | "cacheTimeout": null, 246 | "colorBackground": false, 247 | "colorValue": true, 248 | "colors": [ 249 | "rgba(50, 172, 45, 0.97)", 250 | "rgba(237, 129, 40, 0.89)", 251 | "rgba(245, 54, 54, 0.9)" 252 | ], 253 | "datasource": "${DS_PROMETHEUS}", 254 | "decimals": 2, 255 | "editable": true, 256 | "error": false, 257 | "format": "percent", 258 | "gauge": { 259 | "maxValue": 100, 260 | "minValue": 0, 261 | "show": false, 262 | "thresholdLabels": false, 263 | "thresholdMarkers": true 264 | }, 265 | "id": 65, 266 | "interval": null, 267 | "links": [], 268 | "mappingType": 1, 269 | "mappingTypes": [ 270 | { 271 | "name": "value to text", 272 | "value": 1 273 | }, 274 | { 275 | "name": "range to text", 276 | "value": 2 277 | } 278 | ], 279 | "maxDataPoints": 100, 280 | "nullPointMode": "connected", 281 | "nullText": null, 282 | "postfix": "", 283 | "postfixFontSize": "50%", 284 | "prefix": "", 285 | "prefixFontSize": "70%", 286 | "rangeMaps": [ 287 | { 288 | "from": "null", 289 | "text": "N/A", 290 | "to": "null" 291 | } 292 | ], 293 | "span": 3, 294 | "sparkline": { 295 | "fillColor": "rgba(31, 118, 189, 0.18)", 296 | "full": false, 297 | "lineColor": "rgb(31, 120, 193)", 298 | "show": false 299 | }, 300 | "tableColumn": "", 301 | "targets": [ 302 | { 303 | "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})*100/sum(jvm_memory_max_bytes{application=\"$application\",instance=\"$instance\", area=\"heap\"})", 304 | "format": "time_series", 305 | "intervalFactor": 2, 306 | "legendFormat": "", 307 | "refId": "A", 308 | "step": 14400 309 | } 310 | ], 311 | "thresholds": "70,90", 312 | "title": "Heap used", 313 | "type": "singlestat", 314 | "valueFontSize": "80%", 315 | "valueMaps": [ 316 | { 317 | "op": "=", 318 | "text": "N/A", 319 | "value": "null" 320 | } 321 | ], 322 | "valueName": "current" 323 | }, 324 | { 325 | "cacheTimeout": null, 326 | "colorBackground": false, 327 | "colorValue": true, 328 | "colors": [ 329 | "rgba(50, 172, 45, 0.97)", 330 | "rgba(237, 129, 40, 0.89)", 331 | "rgba(245, 54, 54, 0.9)" 332 | ], 333 | "datasource": "${DS_PROMETHEUS}", 334 | "decimals": 2, 335 | "editable": true, 336 | "error": false, 337 | "format": "percent", 338 | "gauge": { 339 | "maxValue": 100, 340 | "minValue": 0, 341 | "show": false, 342 | "thresholdLabels": false, 343 | "thresholdMarkers": true 344 | }, 345 | "id": 75, 346 | "interval": null, 347 | "links": [], 348 | "mappingType": 2, 349 | "mappingTypes": [ 350 | { 351 | "name": "value to text", 352 | "value": 1 353 | }, 354 | { 355 | "name": "range to text", 356 | "value": 2 357 | } 358 | ], 359 | "maxDataPoints": 100, 360 | "nullPointMode": "connected", 361 | "nullText": null, 362 | "postfix": "", 363 | "postfixFontSize": "50%", 364 | "prefix": "", 365 | "prefixFontSize": "70%", 366 | "rangeMaps": [ 367 | { 368 | "from": "null", 369 | "text": "N/A", 370 | "to": "null" 371 | }, 372 | { 373 | "from": "-99999999999999999999999999999999", 374 | "text": "N/A", 375 | "to": "0" 376 | } 377 | ], 378 | "span": 3, 379 | "sparkline": { 380 | "fillColor": "rgba(31, 118, 189, 0.18)", 381 | "full": false, 382 | "lineColor": "rgb(31, 120, 193)", 383 | "show": false 384 | }, 385 | "tableColumn": "", 386 | "targets": [ 387 | { 388 | "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})*100/sum(jvm_memory_max_bytes{application=\"$application\",instance=\"$instance\", area=\"nonheap\"})", 389 | "format": "time_series", 390 | "intervalFactor": 2, 391 | "legendFormat": "", 392 | "refId": "A", 393 | "step": 14400 394 | } 395 | ], 396 | "thresholds": "70,90", 397 | "title": "Non-Heap used", 398 | "type": "singlestat", 399 | "valueFontSize": "80%", 400 | "valueMaps": [ 401 | { 402 | "op": "=", 403 | "text": "N/A", 404 | "value": "null" 405 | }, 406 | { 407 | "op": "=", 408 | "text": "x", 409 | "value": "" 410 | } 411 | ], 412 | "valueName": "current" 413 | } 414 | ], 415 | "repeat": null, 416 | "repeatIteration": null, 417 | "repeatRowId": null, 418 | "showTitle": true, 419 | "title": "Quick Facts", 420 | "titleSize": "h6" 421 | }, 422 | { 423 | "collapse": false, 424 | "height": 250, 425 | "panels": [ 426 | { 427 | "aliasColors": {}, 428 | "bars": false, 429 | "dashLength": 10, 430 | "dashes": false, 431 | "datasource": "${DS_PROMETHEUS}", 432 | "fill": 1, 433 | "id": 111, 434 | "legend": { 435 | "avg": false, 436 | "current": true, 437 | "max": false, 438 | "min": false, 439 | "show": true, 440 | "total": false, 441 | "values": true 442 | }, 443 | "lines": true, 444 | "linewidth": 1, 445 | "links": [], 446 | "nullPointMode": "null", 447 | "percentage": false, 448 | "pointradius": 5, 449 | "points": false, 450 | "renderer": "flot", 451 | "seriesOverrides": [], 452 | "spaceLength": 10, 453 | "span": 3, 454 | "stack": false, 455 | "steppedLine": false, 456 | "targets": [ 457 | { 458 | "expr": "sum(rate(http_server_requests_seconds_count{application=\"$application\", instance=\"$instance\"}[1m]))", 459 | "format": "time_series", 460 | "intervalFactor": 1, 461 | "legendFormat": "HTTP", 462 | "refId": "A" 463 | } 464 | ], 465 | "thresholds": [], 466 | "timeFrom": null, 467 | "timeShift": null, 468 | "title": "Rate", 469 | "tooltip": { 470 | "shared": true, 471 | "sort": 0, 472 | "value_type": "individual" 473 | }, 474 | "type": "graph", 475 | "xaxis": { 476 | "buckets": null, 477 | "mode": "time", 478 | "name": null, 479 | "show": true, 480 | "values": [] 481 | }, 482 | "yaxes": [ 483 | { 484 | "decimals": null, 485 | "format": "ops", 486 | "label": null, 487 | "logBase": 1, 488 | "max": null, 489 | "min": "0", 490 | "show": true 491 | }, 492 | { 493 | "format": "short", 494 | "label": null, 495 | "logBase": 1, 496 | "max": null, 497 | "min": null, 498 | "show": true 499 | } 500 | ] 501 | }, 502 | { 503 | "aliasColors": { 504 | "HTTP": "#890f02", 505 | "HTTP - 5xx": "#bf1b00" 506 | }, 507 | "bars": false, 508 | "dashLength": 10, 509 | "dashes": false, 510 | "datasource": "${DS_PROMETHEUS}", 511 | "fill": 1, 512 | "id": 112, 513 | "legend": { 514 | "avg": false, 515 | "current": true, 516 | "max": false, 517 | "min": false, 518 | "show": true, 519 | "total": false, 520 | "values": true 521 | }, 522 | "lines": true, 523 | "linewidth": 1, 524 | "links": [], 525 | "nullPointMode": "null", 526 | "percentage": false, 527 | "pointradius": 5, 528 | "points": false, 529 | "renderer": "flot", 530 | "seriesOverrides": [], 531 | "spaceLength": 10, 532 | "span": 3, 533 | "stack": false, 534 | "steppedLine": false, 535 | "targets": [ 536 | { 537 | "expr": "sum(rate(http_server_requests_seconds_count{application=\"$application\", instance=\"$instance\", status=~\"5..\"}[1m]))", 538 | "format": "time_series", 539 | "intervalFactor": 1, 540 | "legendFormat": "HTTP - 5xx", 541 | "refId": "A" 542 | } 543 | ], 544 | "thresholds": [], 545 | "timeFrom": null, 546 | "timeShift": null, 547 | "title": "Errors", 548 | "tooltip": { 549 | "shared": true, 550 | "sort": 0, 551 | "value_type": "individual" 552 | }, 553 | "type": "graph", 554 | "xaxis": { 555 | "buckets": null, 556 | "mode": "time", 557 | "name": null, 558 | "show": true, 559 | "values": [] 560 | }, 561 | "yaxes": [ 562 | { 563 | "decimals": null, 564 | "format": "ops", 565 | "label": null, 566 | "logBase": 1, 567 | "max": null, 568 | "min": "0", 569 | "show": true 570 | }, 571 | { 572 | "format": "short", 573 | "label": null, 574 | "logBase": 1, 575 | "max": null, 576 | "min": null, 577 | "show": true 578 | } 579 | ] 580 | }, 581 | { 582 | "aliasColors": {}, 583 | "bars": false, 584 | "dashLength": 10, 585 | "dashes": false, 586 | "datasource": "${DS_PROMETHEUS}", 587 | "fill": 1, 588 | "id": 113, 589 | "legend": { 590 | "avg": false, 591 | "current": true, 592 | "max": false, 593 | "min": false, 594 | "show": true, 595 | "total": false, 596 | "values": true 597 | }, 598 | "lines": true, 599 | "linewidth": 1, 600 | "links": [], 601 | "nullPointMode": "null", 602 | "percentage": false, 603 | "pointradius": 5, 604 | "points": false, 605 | "renderer": "flot", 606 | "seriesOverrides": [], 607 | "spaceLength": 10, 608 | "span": 3, 609 | "stack": false, 610 | "steppedLine": false, 611 | "targets": [ 612 | { 613 | "expr": "sum(rate(http_server_requests_seconds_sum{application=\"$application\", instance=\"$instance\", status!~\"5..\"}[1m]))/sum(rate(http_server_requests_seconds_count{application=\"$application\", instance=\"$instance\", status!~\"5..\"}[1m]))", 614 | "format": "time_series", 615 | "hide": false, 616 | "intervalFactor": 1, 617 | "legendFormat": "HTTP - AVG", 618 | "refId": "A" 619 | }, 620 | { 621 | "expr": "max(http_server_requests_seconds_max{application=\"$application\", instance=\"$instance\", status!~\"5..\"})", 622 | "format": "time_series", 623 | "hide": false, 624 | "intervalFactor": 1, 625 | "legendFormat": "HTTP - MAX", 626 | "refId": "B" 627 | } 628 | ], 629 | "thresholds": [], 630 | "timeFrom": null, 631 | "timeShift": null, 632 | "title": "Duration", 633 | "tooltip": { 634 | "shared": true, 635 | "sort": 0, 636 | "value_type": "individual" 637 | }, 638 | "type": "graph", 639 | "xaxis": { 640 | "buckets": null, 641 | "mode": "time", 642 | "name": null, 643 | "show": true, 644 | "values": [] 645 | }, 646 | "yaxes": [ 647 | { 648 | "format": "s", 649 | "label": null, 650 | "logBase": 1, 651 | "max": null, 652 | "min": "0", 653 | "show": true 654 | }, 655 | { 656 | "format": "short", 657 | "label": null, 658 | "logBase": 1, 659 | "max": null, 660 | "min": null, 661 | "show": true 662 | } 663 | ] 664 | }, 665 | { 666 | "aliasColors": {}, 667 | "bars": false, 668 | "dashLength": 10, 669 | "dashes": false, 670 | "datasource": "${DS_PROMETHEUS}", 671 | "description": "", 672 | "fill": 1, 673 | "id": 119, 674 | "legend": { 675 | "alignAsTable": false, 676 | "avg": false, 677 | "current": true, 678 | "max": false, 679 | "min": false, 680 | "show": true, 681 | "total": false, 682 | "values": true 683 | }, 684 | "lines": true, 685 | "linewidth": 1, 686 | "links": [], 687 | "nullPointMode": "null", 688 | "percentage": false, 689 | "pointradius": 5, 690 | "points": false, 691 | "renderer": "flot", 692 | "seriesOverrides": [], 693 | "spaceLength": 10, 694 | "span": 3, 695 | "stack": false, 696 | "steppedLine": false, 697 | "targets": [ 698 | { 699 | "expr": "tomcat_threads_busy_threads{application=\"$application\", instance=\"$instance\"}", 700 | "format": "time_series", 701 | "hide": false, 702 | "intervalFactor": 2, 703 | "legendFormat": "TOMCAT - BSY", 704 | "refId": "A" 705 | }, 706 | { 707 | "expr": "tomcat_threads_current_threads{application=\"$application\", instance=\"$instance\"}", 708 | "format": "time_series", 709 | "hide": false, 710 | "intervalFactor": 2, 711 | "legendFormat": "TOMCAT - CUR", 712 | "refId": "B" 713 | }, 714 | { 715 | "expr": "tomcat_threads_config_max_threads{application=\"$application\", instance=\"$instance\"}", 716 | "format": "time_series", 717 | "hide": false, 718 | "intervalFactor": 2, 719 | "legendFormat": "TOMCAT - MAX", 720 | "refId": "C" 721 | }, 722 | { 723 | "expr": "jetty_threads_busy{application=\"$application\", instance=\"$instance\"}", 724 | "format": "time_series", 725 | "hide": false, 726 | "intervalFactor": 2, 727 | "legendFormat": "JETTY - BSY", 728 | "refId": "D" 729 | }, 730 | { 731 | "expr": "jetty_threads_current{application=\"$application\", instance=\"$instance\"}", 732 | "format": "time_series", 733 | "hide": false, 734 | "intervalFactor": 2, 735 | "legendFormat": "JETTY - CUR", 736 | "refId": "E" 737 | }, 738 | { 739 | "expr": "jetty_threads_config_max{application=\"$application\", instance=\"$instance\"}", 740 | "format": "time_series", 741 | "hide": false, 742 | "intervalFactor": 2, 743 | "legendFormat": "JETTY - MAX", 744 | "refId": "F" 745 | } 746 | ], 747 | "thresholds": [], 748 | "timeFrom": null, 749 | "timeShift": null, 750 | "title": "Utilisation", 751 | "tooltip": { 752 | "shared": true, 753 | "sort": 0, 754 | "value_type": "individual" 755 | }, 756 | "type": "graph", 757 | "xaxis": { 758 | "buckets": null, 759 | "mode": "time", 760 | "name": null, 761 | "show": true, 762 | "values": [] 763 | }, 764 | "yaxes": [ 765 | { 766 | "format": "short", 767 | "label": null, 768 | "logBase": 1, 769 | "max": null, 770 | "min": "0", 771 | "show": true 772 | }, 773 | { 774 | "format": "short", 775 | "label": null, 776 | "logBase": 1, 777 | "max": null, 778 | "min": null, 779 | "show": true 780 | } 781 | ] 782 | } 783 | ], 784 | "repeat": null, 785 | "repeatIteration": null, 786 | "repeatRowId": null, 787 | "showTitle": true, 788 | "title": "I/O Overview", 789 | "titleSize": "h6" 790 | }, 791 | { 792 | "collapse": false, 793 | "height": "250px", 794 | "panels": [ 795 | { 796 | "aliasColors": {}, 797 | "bars": false, 798 | "dashLength": 10, 799 | "dashes": false, 800 | "datasource": "${DS_PROMETHEUS}", 801 | "editable": true, 802 | "error": false, 803 | "fill": 1, 804 | "grid": { 805 | "leftLogBase": 1, 806 | "leftMax": null, 807 | "leftMin": null, 808 | "rightLogBase": 1, 809 | "rightMax": null, 810 | "rightMin": null 811 | }, 812 | "id": 24, 813 | "legend": { 814 | "avg": false, 815 | "current": true, 816 | "max": true, 817 | "min": false, 818 | "show": true, 819 | "total": false, 820 | "values": true 821 | }, 822 | "lines": true, 823 | "linewidth": 1, 824 | "links": [], 825 | "nullPointMode": "null", 826 | "percentage": false, 827 | "pointradius": 5, 828 | "points": false, 829 | "renderer": "flot", 830 | "seriesOverrides": [], 831 | "spaceLength": 10, 832 | "span": 3, 833 | "stack": false, 834 | "steppedLine": false, 835 | "targets": [ 836 | { 837 | "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})", 838 | "format": "time_series", 839 | "intervalFactor": 2, 840 | "legendFormat": "used", 841 | "metric": "", 842 | "refId": "A", 843 | "step": 2400 844 | }, 845 | { 846 | "expr": "sum(jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})", 847 | "format": "time_series", 848 | "intervalFactor": 2, 849 | "legendFormat": "committed", 850 | "refId": "B", 851 | "step": 2400 852 | }, 853 | { 854 | "expr": "sum(jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})", 855 | "format": "time_series", 856 | "intervalFactor": 2, 857 | "legendFormat": "max", 858 | "refId": "C", 859 | "step": 2400 860 | } 861 | ], 862 | "thresholds": [], 863 | "timeFrom": null, 864 | "timeShift": null, 865 | "title": "JVM Heap", 866 | "tooltip": { 867 | "msResolution": false, 868 | "shared": true, 869 | "sort": 0, 870 | "value_type": "cumulative" 871 | }, 872 | "type": "graph", 873 | "x-axis": true, 874 | "xaxis": { 875 | "buckets": null, 876 | "mode": "time", 877 | "name": null, 878 | "show": true, 879 | "values": [] 880 | }, 881 | "y-axis": true, 882 | "y_formats": [ 883 | "mbytes", 884 | "short" 885 | ], 886 | "yaxes": [ 887 | { 888 | "format": "bytes", 889 | "label": null, 890 | "logBase": 1, 891 | "max": null, 892 | "min": 0, 893 | "show": true 894 | }, 895 | { 896 | "format": "short", 897 | "label": null, 898 | "logBase": 1, 899 | "max": null, 900 | "min": null, 901 | "show": true 902 | } 903 | ] 904 | }, 905 | { 906 | "aliasColors": {}, 907 | "bars": false, 908 | "dashLength": 10, 909 | "dashes": false, 910 | "datasource": "${DS_PROMETHEUS}", 911 | "editable": true, 912 | "error": false, 913 | "fill": 1, 914 | "grid": { 915 | "leftLogBase": 1, 916 | "leftMax": null, 917 | "leftMin": null, 918 | "rightLogBase": 1, 919 | "rightMax": null, 920 | "rightMin": null 921 | }, 922 | "id": 25, 923 | "legend": { 924 | "avg": false, 925 | "current": true, 926 | "max": true, 927 | "min": false, 928 | "show": true, 929 | "total": false, 930 | "values": true 931 | }, 932 | "lines": true, 933 | "linewidth": 1, 934 | "links": [], 935 | "nullPointMode": "null", 936 | "percentage": false, 937 | "pointradius": 5, 938 | "points": false, 939 | "renderer": "flot", 940 | "seriesOverrides": [], 941 | "spaceLength": 10, 942 | "span": 3, 943 | "stack": false, 944 | "steppedLine": false, 945 | "targets": [ 946 | { 947 | "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})", 948 | "format": "time_series", 949 | "interval": "", 950 | "intervalFactor": 2, 951 | "legendFormat": "used", 952 | "metric": "", 953 | "refId": "A", 954 | "step": 2400 955 | }, 956 | { 957 | "expr": "sum(jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})", 958 | "format": "time_series", 959 | "intervalFactor": 2, 960 | "legendFormat": "committed", 961 | "refId": "B", 962 | "step": 2400 963 | }, 964 | { 965 | "expr": "sum(jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})", 966 | "format": "time_series", 967 | "intervalFactor": 2, 968 | "legendFormat": "max", 969 | "refId": "C", 970 | "step": 2400 971 | } 972 | ], 973 | "thresholds": [], 974 | "timeFrom": null, 975 | "timeShift": null, 976 | "title": "JVM Non-Heap", 977 | "tooltip": { 978 | "msResolution": false, 979 | "shared": true, 980 | "sort": 0, 981 | "value_type": "cumulative" 982 | }, 983 | "type": "graph", 984 | "x-axis": true, 985 | "xaxis": { 986 | "buckets": null, 987 | "mode": "time", 988 | "name": null, 989 | "show": true, 990 | "values": [] 991 | }, 992 | "y-axis": true, 993 | "y_formats": [ 994 | "mbytes", 995 | "short" 996 | ], 997 | "yaxes": [ 998 | { 999 | "format": "bytes", 1000 | "label": null, 1001 | "logBase": 1, 1002 | "max": null, 1003 | "min": 0, 1004 | "show": true 1005 | }, 1006 | { 1007 | "format": "short", 1008 | "label": null, 1009 | "logBase": 1, 1010 | "max": null, 1011 | "min": null, 1012 | "show": true 1013 | } 1014 | ] 1015 | }, 1016 | { 1017 | "aliasColors": {}, 1018 | "bars": false, 1019 | "dashLength": 10, 1020 | "dashes": false, 1021 | "datasource": "${DS_PROMETHEUS}", 1022 | "editable": true, 1023 | "error": false, 1024 | "fill": 1, 1025 | "grid": { 1026 | "leftLogBase": 1, 1027 | "leftMax": null, 1028 | "leftMin": null, 1029 | "rightLogBase": 1, 1030 | "rightMax": null, 1031 | "rightMin": null 1032 | }, 1033 | "id": 26, 1034 | "legend": { 1035 | "alignAsTable": false, 1036 | "avg": false, 1037 | "current": true, 1038 | "max": true, 1039 | "min": false, 1040 | "show": true, 1041 | "total": false, 1042 | "values": true 1043 | }, 1044 | "lines": true, 1045 | "linewidth": 1, 1046 | "links": [], 1047 | "nullPointMode": "null", 1048 | "percentage": false, 1049 | "pointradius": 5, 1050 | "points": false, 1051 | "renderer": "flot", 1052 | "seriesOverrides": [], 1053 | "spaceLength": 10, 1054 | "span": 3, 1055 | "stack": false, 1056 | "steppedLine": false, 1057 | "targets": [ 1058 | { 1059 | "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\"})", 1060 | "format": "time_series", 1061 | "intervalFactor": 2, 1062 | "legendFormat": "used", 1063 | "metric": "", 1064 | "refId": "A", 1065 | "step": 2400 1066 | }, 1067 | { 1068 | "expr": "sum(jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\"})", 1069 | "format": "time_series", 1070 | "intervalFactor": 2, 1071 | "legendFormat": "committed", 1072 | "refId": "B", 1073 | "step": 2400 1074 | }, 1075 | { 1076 | "expr": "sum(jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\"})", 1077 | "format": "time_series", 1078 | "intervalFactor": 2, 1079 | "legendFormat": "max", 1080 | "refId": "C", 1081 | "step": 2400 1082 | } 1083 | ], 1084 | "thresholds": [], 1085 | "timeFrom": null, 1086 | "timeShift": null, 1087 | "title": "JVM Total", 1088 | "tooltip": { 1089 | "msResolution": false, 1090 | "shared": true, 1091 | "sort": 0, 1092 | "value_type": "cumulative" 1093 | }, 1094 | "type": "graph", 1095 | "x-axis": true, 1096 | "xaxis": { 1097 | "buckets": null, 1098 | "mode": "time", 1099 | "name": null, 1100 | "show": true, 1101 | "values": [] 1102 | }, 1103 | "y-axis": true, 1104 | "y_formats": [ 1105 | "mbytes", 1106 | "short" 1107 | ], 1108 | "yaxes": [ 1109 | { 1110 | "format": "bytes", 1111 | "label": "", 1112 | "logBase": 1, 1113 | "max": null, 1114 | "min": 0, 1115 | "show": true 1116 | }, 1117 | { 1118 | "format": "short", 1119 | "label": null, 1120 | "logBase": 1, 1121 | "max": null, 1122 | "min": null, 1123 | "show": true 1124 | } 1125 | ] 1126 | }, 1127 | { 1128 | "aliasColors": {}, 1129 | "bars": false, 1130 | "dashLength": 10, 1131 | "dashes": false, 1132 | "datasource": "${DS_PROMETHEUS}", 1133 | "editable": true, 1134 | "error": false, 1135 | "fill": 1, 1136 | "grid": { 1137 | "leftLogBase": 1, 1138 | "leftMax": null, 1139 | "leftMin": null, 1140 | "rightLogBase": 1, 1141 | "rightMax": null, 1142 | "rightMin": null 1143 | }, 1144 | "id": 86, 1145 | "legend": { 1146 | "avg": false, 1147 | "current": true, 1148 | "max": true, 1149 | "min": false, 1150 | "show": true, 1151 | "total": false, 1152 | "values": true 1153 | }, 1154 | "lines": true, 1155 | "linewidth": 1, 1156 | "links": [], 1157 | "nullPointMode": "null", 1158 | "percentage": false, 1159 | "pointradius": 5, 1160 | "points": false, 1161 | "renderer": "flot", 1162 | "seriesOverrides": [], 1163 | "spaceLength": 10, 1164 | "span": 3, 1165 | "stack": false, 1166 | "steppedLine": false, 1167 | "targets": [ 1168 | { 1169 | "expr": "process_memory_vss_bytes{application=\"$application\", instance=\"$instance\"}", 1170 | "format": "time_series", 1171 | "hide": true, 1172 | "intervalFactor": 2, 1173 | "legendFormat": "vss", 1174 | "metric": "", 1175 | "refId": "A", 1176 | "step": 2400 1177 | }, 1178 | { 1179 | "expr": "process_memory_rss_bytes{application=\"$application\", instance=\"$instance\"}", 1180 | "format": "time_series", 1181 | "intervalFactor": 2, 1182 | "legendFormat": "rss", 1183 | "refId": "B" 1184 | }, 1185 | { 1186 | "expr": "process_memory_swap_bytes{application=\"$application\", instance=\"$instance\"}", 1187 | "format": "time_series", 1188 | "intervalFactor": 2, 1189 | "legendFormat": "swap", 1190 | "refId": "C" 1191 | }, 1192 | { 1193 | "expr": "process_memory_rss_bytes{application=\"$application\", instance=\"$instance\"} + process_memory_swap_bytes{application=\"$application\", instance=\"$instance\"}", 1194 | "format": "time_series", 1195 | "intervalFactor": 2, 1196 | "legendFormat": "total", 1197 | "refId": "D" 1198 | } 1199 | ], 1200 | "thresholds": [], 1201 | "timeFrom": null, 1202 | "timeShift": null, 1203 | "title": "JVM Process Memory", 1204 | "tooltip": { 1205 | "msResolution": false, 1206 | "shared": true, 1207 | "sort": 0, 1208 | "value_type": "cumulative" 1209 | }, 1210 | "type": "graph", 1211 | "x-axis": true, 1212 | "xaxis": { 1213 | "buckets": null, 1214 | "mode": "time", 1215 | "name": null, 1216 | "show": true, 1217 | "values": [] 1218 | }, 1219 | "y-axis": true, 1220 | "y_formats": [ 1221 | "mbytes", 1222 | "short" 1223 | ], 1224 | "yaxes": [ 1225 | { 1226 | "format": "bytes", 1227 | "label": "", 1228 | "logBase": 1, 1229 | "max": null, 1230 | "min": "0", 1231 | "show": true 1232 | }, 1233 | { 1234 | "format": "short", 1235 | "label": null, 1236 | "logBase": 1, 1237 | "max": null, 1238 | "min": null, 1239 | "show": true 1240 | } 1241 | ] 1242 | } 1243 | ], 1244 | "repeat": null, 1245 | "repeatIteration": null, 1246 | "repeatRowId": null, 1247 | "showTitle": true, 1248 | "title": "JVM Memory", 1249 | "titleSize": "h6" 1250 | }, 1251 | { 1252 | "collapse": false, 1253 | "height": 250, 1254 | "panels": [ 1255 | { 1256 | "aliasColors": {}, 1257 | "bars": false, 1258 | "dashLength": 10, 1259 | "dashes": false, 1260 | "datasource": "${DS_PROMETHEUS}", 1261 | "editable": true, 1262 | "error": false, 1263 | "fill": 1, 1264 | "grid": { 1265 | "leftLogBase": 1, 1266 | "leftMax": null, 1267 | "leftMin": null, 1268 | "rightLogBase": 1, 1269 | "rightMax": null, 1270 | "rightMin": null 1271 | }, 1272 | "id": 106, 1273 | "legend": { 1274 | "avg": false, 1275 | "current": true, 1276 | "max": true, 1277 | "min": false, 1278 | "show": true, 1279 | "total": false, 1280 | "values": true 1281 | }, 1282 | "lines": true, 1283 | "linewidth": 1, 1284 | "links": [], 1285 | "nullPointMode": "null", 1286 | "percentage": false, 1287 | "pointradius": 5, 1288 | "points": false, 1289 | "renderer": "flot", 1290 | "seriesOverrides": [], 1291 | "spaceLength": 10, 1292 | "span": 3, 1293 | "stack": false, 1294 | "steppedLine": false, 1295 | "targets": [ 1296 | { 1297 | "expr": "system_cpu_usage{application=\"$application\", instance=\"$instance\"}", 1298 | "format": "time_series", 1299 | "hide": false, 1300 | "intervalFactor": 1, 1301 | "legendFormat": "system", 1302 | "metric": "", 1303 | "refId": "A", 1304 | "step": 2400 1305 | }, 1306 | { 1307 | "expr": "process_cpu_usage{application=\"$application\", instance=\"$instance\"}", 1308 | "format": "time_series", 1309 | "hide": false, 1310 | "intervalFactor": 1, 1311 | "legendFormat": "process", 1312 | "refId": "B" 1313 | }, 1314 | { 1315 | "expr": "avg_over_time(process_cpu_usage{application=\"$application\", instance=\"$instance\"}[15m])", 1316 | "format": "time_series", 1317 | "hide": false, 1318 | "intervalFactor": 1, 1319 | "legendFormat": "process-15m", 1320 | "refId": "C" 1321 | } 1322 | ], 1323 | "thresholds": [], 1324 | "timeFrom": null, 1325 | "timeShift": null, 1326 | "title": "CPU Usage", 1327 | "tooltip": { 1328 | "msResolution": false, 1329 | "shared": true, 1330 | "sort": 0, 1331 | "value_type": "cumulative" 1332 | }, 1333 | "type": "graph", 1334 | "x-axis": true, 1335 | "xaxis": { 1336 | "buckets": null, 1337 | "mode": "time", 1338 | "name": null, 1339 | "show": true, 1340 | "values": [] 1341 | }, 1342 | "y-axis": true, 1343 | "y_formats": [ 1344 | "short", 1345 | "short" 1346 | ], 1347 | "yaxes": [ 1348 | { 1349 | "decimals": 1, 1350 | "format": "percentunit", 1351 | "label": "", 1352 | "logBase": 1, 1353 | "max": "1", 1354 | "min": 0, 1355 | "show": true 1356 | }, 1357 | { 1358 | "format": "short", 1359 | "label": null, 1360 | "logBase": 1, 1361 | "max": null, 1362 | "min": null, 1363 | "show": true 1364 | } 1365 | ] 1366 | }, 1367 | { 1368 | "aliasColors": {}, 1369 | "bars": false, 1370 | "dashLength": 10, 1371 | "dashes": false, 1372 | "datasource": "${DS_PROMETHEUS}", 1373 | "editable": true, 1374 | "error": false, 1375 | "fill": 1, 1376 | "grid": { 1377 | "leftLogBase": 1, 1378 | "leftMax": null, 1379 | "leftMin": null, 1380 | "rightLogBase": 1, 1381 | "rightMax": null, 1382 | "rightMin": null 1383 | }, 1384 | "id": 93, 1385 | "legend": { 1386 | "avg": false, 1387 | "current": true, 1388 | "max": true, 1389 | "min": false, 1390 | "show": true, 1391 | "total": false, 1392 | "values": true 1393 | }, 1394 | "lines": true, 1395 | "linewidth": 1, 1396 | "links": [], 1397 | "nullPointMode": "null", 1398 | "percentage": false, 1399 | "pointradius": 5, 1400 | "points": false, 1401 | "renderer": "flot", 1402 | "seriesOverrides": [], 1403 | "spaceLength": 10, 1404 | "span": 3, 1405 | "stack": false, 1406 | "steppedLine": false, 1407 | "targets": [ 1408 | { 1409 | "expr": "system_load_average_1m{application=\"$application\", instance=\"$instance\"}", 1410 | "format": "time_series", 1411 | "intervalFactor": 2, 1412 | "legendFormat": "system-1m", 1413 | "metric": "", 1414 | "refId": "A", 1415 | "step": 2400 1416 | }, 1417 | { 1418 | "expr": "system_cpu_count{application=\"$application\", instance=\"$instance\"}", 1419 | "format": "time_series", 1420 | "intervalFactor": 2, 1421 | "legendFormat": "cpus", 1422 | "refId": "B" 1423 | } 1424 | ], 1425 | "thresholds": [], 1426 | "timeFrom": null, 1427 | "timeShift": null, 1428 | "title": "Load", 1429 | "tooltip": { 1430 | "msResolution": false, 1431 | "shared": true, 1432 | "sort": 0, 1433 | "value_type": "cumulative" 1434 | }, 1435 | "type": "graph", 1436 | "x-axis": true, 1437 | "xaxis": { 1438 | "buckets": null, 1439 | "mode": "time", 1440 | "name": null, 1441 | "show": true, 1442 | "values": [] 1443 | }, 1444 | "y-axis": true, 1445 | "y_formats": [ 1446 | "short", 1447 | "short" 1448 | ], 1449 | "yaxes": [ 1450 | { 1451 | "decimals": 1, 1452 | "format": "short", 1453 | "label": "", 1454 | "logBase": 1, 1455 | "max": null, 1456 | "min": 0, 1457 | "show": true 1458 | }, 1459 | { 1460 | "format": "short", 1461 | "label": null, 1462 | "logBase": 1, 1463 | "max": null, 1464 | "min": null, 1465 | "show": true 1466 | } 1467 | ] 1468 | }, 1469 | { 1470 | "aliasColors": {}, 1471 | "bars": false, 1472 | "dashLength": 10, 1473 | "dashes": false, 1474 | "datasource": "${DS_PROMETHEUS}", 1475 | "editable": true, 1476 | "error": false, 1477 | "fill": 1, 1478 | "grid": { 1479 | "leftLogBase": 1, 1480 | "leftMax": null, 1481 | "leftMin": null, 1482 | "rightLogBase": 1, 1483 | "rightMax": null, 1484 | "rightMin": null 1485 | }, 1486 | "id": 32, 1487 | "legend": { 1488 | "avg": false, 1489 | "current": true, 1490 | "max": true, 1491 | "min": false, 1492 | "show": true, 1493 | "total": false, 1494 | "values": true 1495 | }, 1496 | "lines": true, 1497 | "linewidth": 1, 1498 | "links": [], 1499 | "nullPointMode": "null", 1500 | "percentage": false, 1501 | "pointradius": 5, 1502 | "points": false, 1503 | "renderer": "flot", 1504 | "seriesOverrides": [], 1505 | "spaceLength": 10, 1506 | "span": 3, 1507 | "stack": false, 1508 | "steppedLine": false, 1509 | "targets": [ 1510 | { 1511 | "expr": "jvm_threads_live_threads{application=\"$application\", instance=\"$instance\"}", 1512 | "format": "time_series", 1513 | "intervalFactor": 2, 1514 | "legendFormat": "live", 1515 | "metric": "", 1516 | "refId": "A", 1517 | "step": 2400 1518 | }, 1519 | { 1520 | "expr": "jvm_threads_daemon_threads{application=\"$application\", instance=\"$instance\"}", 1521 | "format": "time_series", 1522 | "intervalFactor": 2, 1523 | "legendFormat": "daemon", 1524 | "metric": "", 1525 | "refId": "B", 1526 | "step": 2400 1527 | }, 1528 | { 1529 | "expr": "jvm_threads_peak_threads{application=\"$application\", instance=\"$instance\"}", 1530 | "format": "time_series", 1531 | "intervalFactor": 2, 1532 | "legendFormat": "peak", 1533 | "refId": "C", 1534 | "step": 2400 1535 | }, 1536 | { 1537 | "expr": "process_threads{application=\"$application\", instance=\"$instance\"}", 1538 | "format": "time_series", 1539 | "interval": "", 1540 | "intervalFactor": 2, 1541 | "legendFormat": "process", 1542 | "refId": "D", 1543 | "step": 2400 1544 | } 1545 | ], 1546 | "thresholds": [], 1547 | "timeFrom": null, 1548 | "timeShift": null, 1549 | "title": "Threads", 1550 | "tooltip": { 1551 | "msResolution": false, 1552 | "shared": true, 1553 | "sort": 0, 1554 | "value_type": "cumulative" 1555 | }, 1556 | "type": "graph", 1557 | "x-axis": true, 1558 | "xaxis": { 1559 | "buckets": null, 1560 | "mode": "time", 1561 | "name": null, 1562 | "show": true, 1563 | "values": [] 1564 | }, 1565 | "y-axis": true, 1566 | "y_formats": [ 1567 | "short", 1568 | "short" 1569 | ], 1570 | "yaxes": [ 1571 | { 1572 | "decimals": 0, 1573 | "format": "short", 1574 | "label": null, 1575 | "logBase": 1, 1576 | "max": null, 1577 | "min": 0, 1578 | "show": true 1579 | }, 1580 | { 1581 | "format": "short", 1582 | "label": null, 1583 | "logBase": 1, 1584 | "max": null, 1585 | "min": null, 1586 | "show": true 1587 | } 1588 | ] 1589 | }, 1590 | { 1591 | "aliasColors": { 1592 | "blocked": "#bf1b00", 1593 | "new": "#fce2de", 1594 | "runnable": "#7eb26d", 1595 | "terminated": "#511749", 1596 | "timed-waiting": "#c15c17", 1597 | "waiting": "#eab839" 1598 | }, 1599 | "bars": false, 1600 | "dashLength": 10, 1601 | "dashes": false, 1602 | "datasource": "${DS_PROMETHEUS}", 1603 | "fill": 1, 1604 | "id": 124, 1605 | "legend": { 1606 | "alignAsTable": false, 1607 | "avg": false, 1608 | "current": true, 1609 | "max": true, 1610 | "min": false, 1611 | "rightSide": false, 1612 | "show": true, 1613 | "total": false, 1614 | "values": true 1615 | }, 1616 | "lines": true, 1617 | "linewidth": 1, 1618 | "links": [], 1619 | "nullPointMode": "null", 1620 | "percentage": false, 1621 | "pointradius": 5, 1622 | "points": false, 1623 | "renderer": "flot", 1624 | "seriesOverrides": [], 1625 | "spaceLength": 10, 1626 | "span": 3, 1627 | "stack": false, 1628 | "steppedLine": false, 1629 | "targets": [ 1630 | { 1631 | "expr": "jvm_threads_states_threads{application=\"$application\", instance=\"$instance\"}", 1632 | "format": "time_series", 1633 | "intervalFactor": 2, 1634 | "legendFormat": "{{state}}", 1635 | "refId": "A" 1636 | } 1637 | ], 1638 | "thresholds": [], 1639 | "timeFrom": null, 1640 | "timeShift": null, 1641 | "title": "Thread States", 1642 | "tooltip": { 1643 | "shared": true, 1644 | "sort": 0, 1645 | "value_type": "individual" 1646 | }, 1647 | "type": "graph", 1648 | "xaxis": { 1649 | "buckets": null, 1650 | "mode": "time", 1651 | "name": null, 1652 | "show": true, 1653 | "values": [] 1654 | }, 1655 | "yaxes": [ 1656 | { 1657 | "format": "short", 1658 | "label": null, 1659 | "logBase": 1, 1660 | "max": null, 1661 | "min": null, 1662 | "show": true 1663 | }, 1664 | { 1665 | "format": "short", 1666 | "label": null, 1667 | "logBase": 1, 1668 | "max": null, 1669 | "min": null, 1670 | "show": true 1671 | } 1672 | ] 1673 | }, 1674 | { 1675 | "aliasColors": {}, 1676 | "bars": false, 1677 | "dashLength": 10, 1678 | "dashes": false, 1679 | "datasource": "${DS_PROMETHEUS}", 1680 | "description": "The percent of time spent on Garbage Collection over all CPUs assigned to the JVM process.", 1681 | "fill": 1, 1682 | "id": 138, 1683 | "legend": { 1684 | "avg": false, 1685 | "current": true, 1686 | "max": true, 1687 | "min": false, 1688 | "show": true, 1689 | "total": false, 1690 | "values": true 1691 | }, 1692 | "lines": true, 1693 | "linewidth": 1, 1694 | "links": [], 1695 | "nullPointMode": "null", 1696 | "percentage": false, 1697 | "pointradius": 5, 1698 | "points": false, 1699 | "renderer": "flot", 1700 | "seriesOverrides": [], 1701 | "spaceLength": 10, 1702 | "span": 3, 1703 | "stack": false, 1704 | "steppedLine": false, 1705 | "targets": [ 1706 | { 1707 | "expr": "sum(rate(jvm_gc_pause_seconds_sum{application=\"$application\", instance=\"$instance\"}[1m])) by (application, instance) / on(application, instance) system_cpu_count", 1708 | "format": "time_series", 1709 | "intervalFactor": 1, 1710 | "legendFormat": "CPU time spent on GC", 1711 | "refId": "A" 1712 | } 1713 | ], 1714 | "thresholds": [], 1715 | "timeFrom": null, 1716 | "timeShift": null, 1717 | "title": "GC Pressure", 1718 | "tooltip": { 1719 | "shared": true, 1720 | "sort": 0, 1721 | "value_type": "individual" 1722 | }, 1723 | "type": "graph", 1724 | "xaxis": { 1725 | "buckets": null, 1726 | "mode": "time", 1727 | "name": null, 1728 | "show": true, 1729 | "values": [] 1730 | }, 1731 | "yaxes": [ 1732 | { 1733 | "decimals": 1, 1734 | "format": "percentunit", 1735 | "label": null, 1736 | "logBase": 1, 1737 | "max": "1", 1738 | "min": "0", 1739 | "show": true 1740 | }, 1741 | { 1742 | "format": "short", 1743 | "label": null, 1744 | "logBase": 1, 1745 | "max": null, 1746 | "min": null, 1747 | "show": true 1748 | } 1749 | ] 1750 | }, 1751 | { 1752 | "aliasColors": { 1753 | "debug": "#1F78C1", 1754 | "error": "#BF1B00", 1755 | "info": "#508642", 1756 | "trace": "#6ED0E0", 1757 | "warn": "#EAB839" 1758 | }, 1759 | "bars": false, 1760 | "dashLength": 10, 1761 | "dashes": false, 1762 | "datasource": "${DS_PROMETHEUS}", 1763 | "editable": true, 1764 | "error": false, 1765 | "fill": 1, 1766 | "grid": { 1767 | "leftLogBase": 1, 1768 | "leftMax": null, 1769 | "leftMin": null, 1770 | "rightLogBase": 1, 1771 | "rightMax": null, 1772 | "rightMin": null 1773 | }, 1774 | "height": "", 1775 | "id": 91, 1776 | "legend": { 1777 | "alignAsTable": false, 1778 | "avg": false, 1779 | "current": true, 1780 | "hideEmpty": false, 1781 | "hideZero": false, 1782 | "max": true, 1783 | "min": false, 1784 | "rightSide": false, 1785 | "show": true, 1786 | "total": false, 1787 | "values": true 1788 | }, 1789 | "lines": true, 1790 | "linewidth": 1, 1791 | "links": [], 1792 | "nullPointMode": "null", 1793 | "percentage": true, 1794 | "pointradius": 5, 1795 | "points": false, 1796 | "renderer": "flot", 1797 | "seriesOverrides": [ 1798 | { 1799 | "alias": "error", 1800 | "yaxis": 1 1801 | }, 1802 | { 1803 | "alias": "warn", 1804 | "yaxis": 1 1805 | } 1806 | ], 1807 | "spaceLength": 10, 1808 | "span": 6, 1809 | "stack": false, 1810 | "steppedLine": false, 1811 | "targets": [ 1812 | { 1813 | "expr": "increase(logback_events_total{application=\"$application\", instance=\"$instance\"}[1m])", 1814 | "format": "time_series", 1815 | "interval": "", 1816 | "intervalFactor": 2, 1817 | "legendFormat": "{{level}}", 1818 | "metric": "", 1819 | "refId": "A", 1820 | "step": 1200 1821 | } 1822 | ], 1823 | "thresholds": [], 1824 | "timeFrom": null, 1825 | "timeShift": null, 1826 | "title": "Log Events", 1827 | "tooltip": { 1828 | "msResolution": false, 1829 | "shared": true, 1830 | "sort": 0, 1831 | "value_type": "individual" 1832 | }, 1833 | "transparent": false, 1834 | "type": "graph", 1835 | "x-axis": true, 1836 | "xaxis": { 1837 | "buckets": null, 1838 | "mode": "time", 1839 | "name": null, 1840 | "show": true, 1841 | "values": [] 1842 | }, 1843 | "y-axis": true, 1844 | "y_formats": [ 1845 | "short", 1846 | "short" 1847 | ], 1848 | "yaxes": [ 1849 | { 1850 | "decimals": 0, 1851 | "format": "opm", 1852 | "label": null, 1853 | "logBase": 1, 1854 | "max": null, 1855 | "min": "0", 1856 | "show": true 1857 | }, 1858 | { 1859 | "format": "short", 1860 | "label": null, 1861 | "logBase": 1, 1862 | "max": null, 1863 | "min": null, 1864 | "show": true 1865 | } 1866 | ] 1867 | }, 1868 | { 1869 | "aliasColors": {}, 1870 | "bars": false, 1871 | "dashLength": 10, 1872 | "dashes": false, 1873 | "datasource": "${DS_PROMETHEUS}", 1874 | "editable": true, 1875 | "error": false, 1876 | "fill": 1, 1877 | "grid": { 1878 | "leftLogBase": 1, 1879 | "leftMax": null, 1880 | "leftMin": null, 1881 | "rightLogBase": 1, 1882 | "rightMax": null, 1883 | "rightMin": null 1884 | }, 1885 | "id": 61, 1886 | "legend": { 1887 | "avg": false, 1888 | "current": true, 1889 | "max": true, 1890 | "min": false, 1891 | "show": true, 1892 | "total": false, 1893 | "values": true 1894 | }, 1895 | "lines": true, 1896 | "linewidth": 1, 1897 | "links": [], 1898 | "nullPointMode": "null", 1899 | "percentage": false, 1900 | "pointradius": 5, 1901 | "points": false, 1902 | "renderer": "flot", 1903 | "seriesOverrides": [], 1904 | "spaceLength": 10, 1905 | "span": 3, 1906 | "stack": false, 1907 | "steppedLine": false, 1908 | "targets": [ 1909 | { 1910 | "expr": "process_files_open_files{application=\"$application\", instance=\"$instance\"}", 1911 | "format": "time_series", 1912 | "hide": false, 1913 | "intervalFactor": 2, 1914 | "legendFormat": "open", 1915 | "metric": "", 1916 | "refId": "A", 1917 | "step": 2400 1918 | }, 1919 | { 1920 | "expr": "process_files_max_files{application=\"$application\", instance=\"$instance\"}", 1921 | "format": "time_series", 1922 | "hide": false, 1923 | "intervalFactor": 2, 1924 | "legendFormat": "max", 1925 | "metric": "", 1926 | "refId": "B", 1927 | "step": 2400 1928 | } 1929 | ], 1930 | "thresholds": [], 1931 | "timeFrom": null, 1932 | "timeShift": null, 1933 | "title": "File Descriptors", 1934 | "tooltip": { 1935 | "msResolution": false, 1936 | "shared": true, 1937 | "sort": 0, 1938 | "value_type": "cumulative" 1939 | }, 1940 | "type": "graph", 1941 | "x-axis": true, 1942 | "xaxis": { 1943 | "buckets": null, 1944 | "mode": "time", 1945 | "name": null, 1946 | "show": true, 1947 | "values": [] 1948 | }, 1949 | "y-axis": true, 1950 | "y_formats": [ 1951 | "short", 1952 | "short" 1953 | ], 1954 | "yaxes": [ 1955 | { 1956 | "decimals": 0, 1957 | "format": "short", 1958 | "label": null, 1959 | "logBase": 10, 1960 | "max": null, 1961 | "min": 0, 1962 | "show": true 1963 | }, 1964 | { 1965 | "format": "short", 1966 | "label": null, 1967 | "logBase": 1, 1968 | "max": null, 1969 | "min": null, 1970 | "show": true 1971 | } 1972 | ] 1973 | } 1974 | ], 1975 | "repeat": null, 1976 | "repeatIteration": null, 1977 | "repeatRowId": null, 1978 | "showTitle": true, 1979 | "title": "JVM Misc", 1980 | "titleSize": "h6" 1981 | }, 1982 | { 1983 | "collapse": false, 1984 | "height": "250px", 1985 | "panels": [ 1986 | { 1987 | "aliasColors": {}, 1988 | "bars": false, 1989 | "dashLength": 10, 1990 | "dashes": false, 1991 | "datasource": "${DS_PROMETHEUS}", 1992 | "editable": true, 1993 | "error": false, 1994 | "fill": 1, 1995 | "grid": { 1996 | "leftLogBase": 1, 1997 | "leftMax": null, 1998 | "leftMin": null, 1999 | "rightLogBase": 1, 2000 | "rightMax": null, 2001 | "rightMin": null 2002 | }, 2003 | "id": 3, 2004 | "legend": { 2005 | "alignAsTable": false, 2006 | "avg": false, 2007 | "current": true, 2008 | "max": true, 2009 | "min": false, 2010 | "rightSide": false, 2011 | "show": true, 2012 | "total": false, 2013 | "values": true 2014 | }, 2015 | "lines": true, 2016 | "linewidth": 1, 2017 | "links": [], 2018 | "minSpan": 4, 2019 | "nullPointMode": "null", 2020 | "percentage": false, 2021 | "pointradius": 5, 2022 | "points": false, 2023 | "renderer": "flot", 2024 | "repeat": "jvm_memory_pool_heap", 2025 | "seriesOverrides": [], 2026 | "spaceLength": 10, 2027 | "span": 4, 2028 | "stack": false, 2029 | "steppedLine": false, 2030 | "targets": [ 2031 | { 2032 | "expr": "jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_heap\"}", 2033 | "format": "time_series", 2034 | "hide": false, 2035 | "interval": "", 2036 | "intervalFactor": 2, 2037 | "legendFormat": "used", 2038 | "metric": "", 2039 | "refId": "A", 2040 | "step": 1800 2041 | }, 2042 | { 2043 | "expr": "jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_heap\"}", 2044 | "format": "time_series", 2045 | "hide": false, 2046 | "interval": "", 2047 | "intervalFactor": 2, 2048 | "legendFormat": "commited", 2049 | "metric": "", 2050 | "refId": "B", 2051 | "step": 1800 2052 | }, 2053 | { 2054 | "expr": "jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_heap\"}", 2055 | "format": "time_series", 2056 | "hide": false, 2057 | "interval": "", 2058 | "intervalFactor": 2, 2059 | "legendFormat": "max", 2060 | "metric": "", 2061 | "refId": "C", 2062 | "step": 1800 2063 | } 2064 | ], 2065 | "thresholds": [], 2066 | "timeFrom": null, 2067 | "timeShift": null, 2068 | "title": "$jvm_memory_pool_heap", 2069 | "tooltip": { 2070 | "msResolution": false, 2071 | "shared": true, 2072 | "sort": 0, 2073 | "value_type": "cumulative" 2074 | }, 2075 | "type": "graph", 2076 | "x-axis": true, 2077 | "xaxis": { 2078 | "buckets": null, 2079 | "mode": "time", 2080 | "name": null, 2081 | "show": true, 2082 | "values": [] 2083 | }, 2084 | "y-axis": true, 2085 | "y_formats": [ 2086 | "mbytes", 2087 | "short" 2088 | ], 2089 | "yaxes": [ 2090 | { 2091 | "format": "bytes", 2092 | "label": null, 2093 | "logBase": 1, 2094 | "max": null, 2095 | "min": 0, 2096 | "show": true 2097 | }, 2098 | { 2099 | "format": "short", 2100 | "label": null, 2101 | "logBase": 1, 2102 | "max": null, 2103 | "min": null, 2104 | "show": true 2105 | } 2106 | ] 2107 | } 2108 | ], 2109 | "repeat": "persistence_counts", 2110 | "repeatIteration": null, 2111 | "repeatRowId": null, 2112 | "showTitle": true, 2113 | "title": "JVM Memory Pools (Heap)", 2114 | "titleSize": "h6" 2115 | }, 2116 | { 2117 | "collapse": false, 2118 | "height": 250, 2119 | "panels": [ 2120 | { 2121 | "aliasColors": {}, 2122 | "bars": false, 2123 | "dashLength": 10, 2124 | "dashes": false, 2125 | "datasource": "${DS_PROMETHEUS}", 2126 | "editable": true, 2127 | "error": false, 2128 | "fill": 1, 2129 | "grid": { 2130 | "leftLogBase": 1, 2131 | "leftMax": null, 2132 | "leftMin": null, 2133 | "rightLogBase": 1, 2134 | "rightMax": null, 2135 | "rightMin": null 2136 | }, 2137 | "id": 78, 2138 | "legend": { 2139 | "alignAsTable": false, 2140 | "avg": false, 2141 | "current": true, 2142 | "max": true, 2143 | "min": false, 2144 | "rightSide": false, 2145 | "show": true, 2146 | "total": false, 2147 | "values": true 2148 | }, 2149 | "lines": true, 2150 | "linewidth": 1, 2151 | "links": [], 2152 | "minSpan": 4, 2153 | "nullPointMode": "null", 2154 | "percentage": false, 2155 | "pointradius": 5, 2156 | "points": false, 2157 | "renderer": "flot", 2158 | "repeat": "jvm_memory_pool_nonheap", 2159 | "seriesOverrides": [], 2160 | "spaceLength": 10, 2161 | "span": 4, 2162 | "stack": false, 2163 | "steppedLine": false, 2164 | "targets": [ 2165 | { 2166 | "expr": "jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_nonheap\"}", 2167 | "format": "time_series", 2168 | "hide": false, 2169 | "interval": "", 2170 | "intervalFactor": 2, 2171 | "legendFormat": "used", 2172 | "metric": "", 2173 | "refId": "A", 2174 | "step": 1800 2175 | }, 2176 | { 2177 | "expr": "jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_nonheap\"}", 2178 | "format": "time_series", 2179 | "hide": false, 2180 | "interval": "", 2181 | "intervalFactor": 2, 2182 | "legendFormat": "commited", 2183 | "metric": "", 2184 | "refId": "B", 2185 | "step": 1800 2186 | }, 2187 | { 2188 | "expr": "jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_nonheap\"}", 2189 | "format": "time_series", 2190 | "hide": false, 2191 | "interval": "", 2192 | "intervalFactor": 2, 2193 | "legendFormat": "max", 2194 | "metric": "", 2195 | "refId": "C", 2196 | "step": 1800 2197 | } 2198 | ], 2199 | "thresholds": [], 2200 | "timeFrom": null, 2201 | "timeShift": null, 2202 | "title": "$jvm_memory_pool_nonheap", 2203 | "tooltip": { 2204 | "msResolution": false, 2205 | "shared": true, 2206 | "sort": 0, 2207 | "value_type": "cumulative" 2208 | }, 2209 | "type": "graph", 2210 | "x-axis": true, 2211 | "xaxis": { 2212 | "buckets": null, 2213 | "mode": "time", 2214 | "name": null, 2215 | "show": true, 2216 | "values": [] 2217 | }, 2218 | "y-axis": true, 2219 | "y_formats": [ 2220 | "mbytes", 2221 | "short" 2222 | ], 2223 | "yaxes": [ 2224 | { 2225 | "format": "bytes", 2226 | "label": null, 2227 | "logBase": 1, 2228 | "max": null, 2229 | "min": 0, 2230 | "show": true 2231 | }, 2232 | { 2233 | "format": "short", 2234 | "label": null, 2235 | "logBase": 1, 2236 | "max": null, 2237 | "min": null, 2238 | "show": true 2239 | } 2240 | ] 2241 | } 2242 | ], 2243 | "repeat": null, 2244 | "repeatIteration": null, 2245 | "repeatRowId": null, 2246 | "showTitle": true, 2247 | "title": "JVM Memory Pools (Non-Heap)", 2248 | "titleSize": "h6" 2249 | }, 2250 | { 2251 | "collapse": false, 2252 | "height": 250, 2253 | "panels": [ 2254 | { 2255 | "aliasColors": {}, 2256 | "bars": false, 2257 | "dashLength": 10, 2258 | "dashes": false, 2259 | "datasource": "${DS_PROMETHEUS}", 2260 | "fill": 1, 2261 | "id": 98, 2262 | "legend": { 2263 | "avg": false, 2264 | "current": false, 2265 | "max": false, 2266 | "min": false, 2267 | "show": true, 2268 | "total": false, 2269 | "values": false 2270 | }, 2271 | "lines": true, 2272 | "linewidth": 1, 2273 | "links": [], 2274 | "nullPointMode": "null", 2275 | "percentage": false, 2276 | "pointradius": 5, 2277 | "points": false, 2278 | "renderer": "flot", 2279 | "seriesOverrides": [], 2280 | "spaceLength": 10, 2281 | "span": 4, 2282 | "stack": false, 2283 | "steppedLine": false, 2284 | "targets": [ 2285 | { 2286 | "expr": "rate(jvm_gc_pause_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])", 2287 | "format": "time_series", 2288 | "hide": false, 2289 | "intervalFactor": 1, 2290 | "legendFormat": "{{action}} ({{cause}})", 2291 | "refId": "A" 2292 | } 2293 | ], 2294 | "thresholds": [], 2295 | "timeFrom": null, 2296 | "timeShift": null, 2297 | "title": "Collections", 2298 | "tooltip": { 2299 | "shared": true, 2300 | "sort": 0, 2301 | "value_type": "individual" 2302 | }, 2303 | "type": "graph", 2304 | "xaxis": { 2305 | "buckets": null, 2306 | "mode": "time", 2307 | "name": null, 2308 | "show": true, 2309 | "values": [] 2310 | }, 2311 | "yaxes": [ 2312 | { 2313 | "format": "ops", 2314 | "label": null, 2315 | "logBase": 1, 2316 | "max": null, 2317 | "min": "0", 2318 | "show": true 2319 | }, 2320 | { 2321 | "format": "short", 2322 | "label": "", 2323 | "logBase": 1, 2324 | "max": null, 2325 | "min": null, 2326 | "show": true 2327 | } 2328 | ] 2329 | }, 2330 | { 2331 | "aliasColors": {}, 2332 | "bars": false, 2333 | "dashLength": 10, 2334 | "dashes": false, 2335 | "datasource": "${DS_PROMETHEUS}", 2336 | "fill": 1, 2337 | "id": 101, 2338 | "legend": { 2339 | "avg": false, 2340 | "current": false, 2341 | "max": false, 2342 | "min": false, 2343 | "show": true, 2344 | "total": false, 2345 | "values": false 2346 | }, 2347 | "lines": true, 2348 | "linewidth": 1, 2349 | "links": [], 2350 | "nullPointMode": "null", 2351 | "percentage": false, 2352 | "pointradius": 5, 2353 | "points": false, 2354 | "renderer": "flot", 2355 | "seriesOverrides": [], 2356 | "spaceLength": 10, 2357 | "span": 4, 2358 | "stack": false, 2359 | "steppedLine": false, 2360 | "targets": [ 2361 | { 2362 | "expr": "rate(jvm_gc_pause_seconds_sum{application=\"$application\", instance=\"$instance\"}[1m])/rate(jvm_gc_pause_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])", 2363 | "format": "time_series", 2364 | "hide": false, 2365 | "instant": false, 2366 | "intervalFactor": 1, 2367 | "legendFormat": "avg {{action}} ({{cause}})", 2368 | "refId": "A" 2369 | }, 2370 | { 2371 | "expr": "jvm_gc_pause_seconds_max{application=\"$application\", instance=\"$instance\"}", 2372 | "format": "time_series", 2373 | "hide": false, 2374 | "instant": false, 2375 | "intervalFactor": 1, 2376 | "legendFormat": "max {{action}} ({{cause}})", 2377 | "refId": "B" 2378 | } 2379 | ], 2380 | "thresholds": [], 2381 | "timeFrom": null, 2382 | "timeShift": null, 2383 | "title": "Pause Durations", 2384 | "tooltip": { 2385 | "shared": true, 2386 | "sort": 0, 2387 | "value_type": "individual" 2388 | }, 2389 | "type": "graph", 2390 | "xaxis": { 2391 | "buckets": null, 2392 | "mode": "time", 2393 | "name": null, 2394 | "show": true, 2395 | "values": [] 2396 | }, 2397 | "yaxes": [ 2398 | { 2399 | "format": "s", 2400 | "label": null, 2401 | "logBase": 1, 2402 | "max": null, 2403 | "min": "0", 2404 | "show": true 2405 | }, 2406 | { 2407 | "format": "short", 2408 | "label": "", 2409 | "logBase": 1, 2410 | "max": null, 2411 | "min": null, 2412 | "show": true 2413 | } 2414 | ] 2415 | }, 2416 | { 2417 | "aliasColors": {}, 2418 | "bars": false, 2419 | "dashLength": 10, 2420 | "dashes": false, 2421 | "datasource": "${DS_PROMETHEUS}", 2422 | "fill": 1, 2423 | "id": 99, 2424 | "legend": { 2425 | "avg": false, 2426 | "current": false, 2427 | "max": false, 2428 | "min": false, 2429 | "show": true, 2430 | "total": false, 2431 | "values": false 2432 | }, 2433 | "lines": true, 2434 | "linewidth": 1, 2435 | "links": [], 2436 | "nullPointMode": "null", 2437 | "percentage": false, 2438 | "pointradius": 5, 2439 | "points": false, 2440 | "renderer": "flot", 2441 | "seriesOverrides": [], 2442 | "spaceLength": 10, 2443 | "span": 4, 2444 | "stack": false, 2445 | "steppedLine": false, 2446 | "targets": [ 2447 | { 2448 | "expr": "rate(jvm_gc_memory_allocated_bytes_total{application=\"$application\", instance=\"$instance\"}[1m])", 2449 | "format": "time_series", 2450 | "interval": "", 2451 | "intervalFactor": 1, 2452 | "legendFormat": "allocated", 2453 | "refId": "A" 2454 | }, 2455 | { 2456 | "expr": "rate(jvm_gc_memory_promoted_bytes_total{application=\"$application\", instance=\"$instance\"}[1m])", 2457 | "format": "time_series", 2458 | "interval": "", 2459 | "intervalFactor": 1, 2460 | "legendFormat": "promoted", 2461 | "refId": "B" 2462 | } 2463 | ], 2464 | "thresholds": [], 2465 | "timeFrom": null, 2466 | "timeShift": null, 2467 | "title": "Allocated/Promoted", 2468 | "tooltip": { 2469 | "shared": true, 2470 | "sort": 0, 2471 | "value_type": "individual" 2472 | }, 2473 | "type": "graph", 2474 | "xaxis": { 2475 | "buckets": null, 2476 | "mode": "time", 2477 | "name": null, 2478 | "show": true, 2479 | "values": [] 2480 | }, 2481 | "yaxes": [ 2482 | { 2483 | "format": "Bps", 2484 | "label": null, 2485 | "logBase": 1, 2486 | "max": null, 2487 | "min": "0", 2488 | "show": true 2489 | }, 2490 | { 2491 | "format": "short", 2492 | "label": null, 2493 | "logBase": 1, 2494 | "max": null, 2495 | "min": null, 2496 | "show": true 2497 | } 2498 | ] 2499 | } 2500 | ], 2501 | "repeat": null, 2502 | "repeatIteration": null, 2503 | "repeatRowId": null, 2504 | "showTitle": true, 2505 | "title": "Garbage Collection", 2506 | "titleSize": "h6" 2507 | }, 2508 | { 2509 | "collapse": false, 2510 | "height": "250px", 2511 | "panels": [ 2512 | { 2513 | "aliasColors": {}, 2514 | "bars": false, 2515 | "dashLength": 10, 2516 | "dashes": false, 2517 | "datasource": "${DS_PROMETHEUS}", 2518 | "editable": true, 2519 | "error": false, 2520 | "fill": 1, 2521 | "grid": { 2522 | "leftLogBase": 1, 2523 | "leftMax": null, 2524 | "leftMin": null, 2525 | "rightLogBase": 1, 2526 | "rightMax": null, 2527 | "rightMin": null 2528 | }, 2529 | "id": 37, 2530 | "legend": { 2531 | "avg": false, 2532 | "current": false, 2533 | "max": false, 2534 | "min": false, 2535 | "show": true, 2536 | "total": false, 2537 | "values": false 2538 | }, 2539 | "lines": true, 2540 | "linewidth": 1, 2541 | "links": [], 2542 | "nullPointMode": "null", 2543 | "percentage": false, 2544 | "pointradius": 5, 2545 | "points": false, 2546 | "renderer": "flot", 2547 | "seriesOverrides": [], 2548 | "spaceLength": 10, 2549 | "span": 6, 2550 | "stack": false, 2551 | "steppedLine": false, 2552 | "targets": [ 2553 | { 2554 | "expr": "jvm_classes_loaded_classes{application=\"$application\", instance=\"$instance\"}", 2555 | "format": "time_series", 2556 | "intervalFactor": 2, 2557 | "legendFormat": "loaded", 2558 | "metric": "", 2559 | "refId": "A", 2560 | "step": 1200 2561 | } 2562 | ], 2563 | "thresholds": [], 2564 | "timeFrom": null, 2565 | "timeShift": null, 2566 | "title": "Classes loaded", 2567 | "tooltip": { 2568 | "msResolution": false, 2569 | "shared": true, 2570 | "sort": 0, 2571 | "value_type": "cumulative" 2572 | }, 2573 | "type": "graph", 2574 | "x-axis": true, 2575 | "xaxis": { 2576 | "buckets": null, 2577 | "mode": "time", 2578 | "name": null, 2579 | "show": true, 2580 | "values": [] 2581 | }, 2582 | "y-axis": true, 2583 | "y_formats": [ 2584 | "short", 2585 | "short" 2586 | ], 2587 | "yaxes": [ 2588 | { 2589 | "format": "short", 2590 | "label": null, 2591 | "logBase": 1, 2592 | "max": null, 2593 | "min": 0, 2594 | "show": true 2595 | }, 2596 | { 2597 | "format": "short", 2598 | "label": null, 2599 | "logBase": 1, 2600 | "max": null, 2601 | "min": null, 2602 | "show": true 2603 | } 2604 | ] 2605 | }, 2606 | { 2607 | "aliasColors": {}, 2608 | "bars": false, 2609 | "dashLength": 10, 2610 | "dashes": false, 2611 | "datasource": "${DS_PROMETHEUS}", 2612 | "editable": true, 2613 | "error": false, 2614 | "fill": 1, 2615 | "grid": { 2616 | "leftLogBase": 1, 2617 | "leftMax": null, 2618 | "leftMin": null, 2619 | "rightLogBase": 1, 2620 | "rightMax": null, 2621 | "rightMin": null 2622 | }, 2623 | "id": 38, 2624 | "legend": { 2625 | "avg": false, 2626 | "current": false, 2627 | "max": false, 2628 | "min": false, 2629 | "show": true, 2630 | "total": false, 2631 | "values": false 2632 | }, 2633 | "lines": true, 2634 | "linewidth": 1, 2635 | "links": [], 2636 | "nullPointMode": "null", 2637 | "percentage": false, 2638 | "pointradius": 5, 2639 | "points": false, 2640 | "renderer": "flot", 2641 | "seriesOverrides": [], 2642 | "spaceLength": 10, 2643 | "span": 6, 2644 | "stack": false, 2645 | "steppedLine": false, 2646 | "targets": [ 2647 | { 2648 | "expr": "delta(jvm_classes_loaded_classes{application=\"$application\",instance=\"$instance\"}[1m])", 2649 | "format": "time_series", 2650 | "hide": false, 2651 | "interval": "", 2652 | "intervalFactor": 1, 2653 | "legendFormat": "delta-1m", 2654 | "metric": "", 2655 | "refId": "A", 2656 | "step": 1200 2657 | } 2658 | ], 2659 | "thresholds": [], 2660 | "timeFrom": null, 2661 | "timeShift": null, 2662 | "title": "Class delta", 2663 | "tooltip": { 2664 | "msResolution": false, 2665 | "shared": true, 2666 | "sort": 0, 2667 | "value_type": "cumulative" 2668 | }, 2669 | "type": "graph", 2670 | "x-axis": true, 2671 | "xaxis": { 2672 | "buckets": null, 2673 | "mode": "time", 2674 | "name": null, 2675 | "show": true, 2676 | "values": [] 2677 | }, 2678 | "y-axis": true, 2679 | "y_formats": [ 2680 | "ops", 2681 | "short" 2682 | ], 2683 | "yaxes": [ 2684 | { 2685 | "decimals": null, 2686 | "format": "short", 2687 | "label": "", 2688 | "logBase": 1, 2689 | "max": null, 2690 | "min": null, 2691 | "show": true 2692 | }, 2693 | { 2694 | "format": "short", 2695 | "label": null, 2696 | "logBase": 1, 2697 | "max": null, 2698 | "min": null, 2699 | "show": true 2700 | } 2701 | ] 2702 | } 2703 | ], 2704 | "repeat": null, 2705 | "repeatIteration": null, 2706 | "repeatRowId": null, 2707 | "showTitle": true, 2708 | "title": "Classloading", 2709 | "titleSize": "h6" 2710 | }, 2711 | { 2712 | "collapse": false, 2713 | "height": "250px", 2714 | "panels": [ 2715 | { 2716 | "aliasColors": {}, 2717 | "bars": false, 2718 | "dashLength": 10, 2719 | "dashes": false, 2720 | "datasource": "${DS_PROMETHEUS}", 2721 | "fill": 1, 2722 | "id": 131, 2723 | "legend": { 2724 | "avg": false, 2725 | "current": false, 2726 | "max": false, 2727 | "min": false, 2728 | "show": true, 2729 | "total": false, 2730 | "values": false 2731 | }, 2732 | "lines": true, 2733 | "linewidth": 1, 2734 | "links": [], 2735 | "minSpan": 4, 2736 | "nullPointMode": "null", 2737 | "percentage": false, 2738 | "pointradius": 5, 2739 | "points": false, 2740 | "renderer": "flot", 2741 | "repeat": "jvm_buffer_pool", 2742 | "seriesOverrides": [ 2743 | { 2744 | "alias": "count", 2745 | "yaxis": 2 2746 | }, 2747 | { 2748 | "alias": "buffers", 2749 | "yaxis": 2 2750 | } 2751 | ], 2752 | "spaceLength": 10, 2753 | "span": 4, 2754 | "stack": false, 2755 | "steppedLine": false, 2756 | "targets": [ 2757 | { 2758 | "expr": "jvm_buffer_memory_used_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_buffer_pool\"}", 2759 | "format": "time_series", 2760 | "intervalFactor": 2, 2761 | "legendFormat": "used", 2762 | "refId": "A" 2763 | }, 2764 | { 2765 | "expr": "jvm_buffer_total_capacity_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_buffer_pool\"}", 2766 | "format": "time_series", 2767 | "intervalFactor": 2, 2768 | "legendFormat": "capacity", 2769 | "refId": "B" 2770 | }, 2771 | { 2772 | "expr": "jvm_buffer_count_buffers{application=\"$application\", instance=\"$instance\", id=~\"$jvm_buffer_pool\"}", 2773 | "format": "time_series", 2774 | "hide": false, 2775 | "intervalFactor": 2, 2776 | "legendFormat": "buffers", 2777 | "refId": "C" 2778 | } 2779 | ], 2780 | "thresholds": [], 2781 | "timeFrom": null, 2782 | "timeShift": null, 2783 | "title": "$jvm_buffer_pool", 2784 | "tooltip": { 2785 | "shared": true, 2786 | "sort": 0, 2787 | "value_type": "individual" 2788 | }, 2789 | "type": "graph", 2790 | "xaxis": { 2791 | "buckets": null, 2792 | "mode": "time", 2793 | "name": null, 2794 | "show": true, 2795 | "values": [] 2796 | }, 2797 | "yaxes": [ 2798 | { 2799 | "format": "decbytes", 2800 | "label": null, 2801 | "logBase": 1, 2802 | "max": null, 2803 | "min": "0", 2804 | "show": true 2805 | }, 2806 | { 2807 | "decimals": 0, 2808 | "format": "short", 2809 | "label": "", 2810 | "logBase": 1, 2811 | "max": null, 2812 | "min": "0", 2813 | "show": true 2814 | } 2815 | ] 2816 | } 2817 | ], 2818 | "repeat": null, 2819 | "repeatIteration": null, 2820 | "repeatRowId": null, 2821 | "showTitle": true, 2822 | "title": "Buffer Pools", 2823 | "titleSize": "h6" 2824 | } 2825 | ], 2826 | "schemaVersion": 14, 2827 | "style": "dark", 2828 | "tags": [], 2829 | "templating": { 2830 | "list": [ 2831 | { 2832 | "allValue": null, 2833 | "current": {}, 2834 | "datasource": "${DS_PROMETHEUS}", 2835 | "hide": 0, 2836 | "includeAll": false, 2837 | "label": "Application", 2838 | "multi": false, 2839 | "name": "application", 2840 | "options": [], 2841 | "query": "label_values(application)", 2842 | "refresh": 2, 2843 | "regex": "", 2844 | "sort": 0, 2845 | "tagValuesQuery": "", 2846 | "tags": [], 2847 | "tagsQuery": "", 2848 | "type": "query", 2849 | "useTags": false 2850 | }, 2851 | { 2852 | "allFormat": "glob", 2853 | "allValue": null, 2854 | "current": {}, 2855 | "datasource": "${DS_PROMETHEUS}", 2856 | "hide": 0, 2857 | "includeAll": false, 2858 | "label": "Instance", 2859 | "multi": false, 2860 | "multiFormat": "glob", 2861 | "name": "instance", 2862 | "options": [], 2863 | "query": "label_values(jvm_memory_used_bytes{application=\"$application\"}, instance)", 2864 | "refresh": 2, 2865 | "regex": "", 2866 | "sort": 0, 2867 | "tagValuesQuery": "", 2868 | "tags": [], 2869 | "tagsQuery": "", 2870 | "type": "query", 2871 | "useTags": false 2872 | }, 2873 | { 2874 | "allFormat": "glob", 2875 | "allValue": null, 2876 | "current": {}, 2877 | "datasource": "${DS_PROMETHEUS}", 2878 | "hide": 2, 2879 | "includeAll": true, 2880 | "label": "JVM Memory Pools Heap", 2881 | "multi": false, 2882 | "multiFormat": "glob", 2883 | "name": "jvm_memory_pool_heap", 2884 | "options": [], 2885 | "query": "label_values(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"},id)", 2886 | "refresh": 1, 2887 | "regex": "", 2888 | "sort": 1, 2889 | "tagValuesQuery": "", 2890 | "tags": [], 2891 | "tagsQuery": "", 2892 | "type": "query", 2893 | "useTags": false 2894 | }, 2895 | { 2896 | "allFormat": "glob", 2897 | "allValue": null, 2898 | "current": {}, 2899 | "datasource": "${DS_PROMETHEUS}", 2900 | "hide": 2, 2901 | "includeAll": true, 2902 | "label": "JVM Memory Pools Non-Heap", 2903 | "multi": false, 2904 | "multiFormat": "glob", 2905 | "name": "jvm_memory_pool_nonheap", 2906 | "options": [], 2907 | "query": "label_values(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"},id)", 2908 | "refresh": 1, 2909 | "regex": "", 2910 | "sort": 2, 2911 | "tagValuesQuery": "", 2912 | "tags": [], 2913 | "tagsQuery": "", 2914 | "type": "query", 2915 | "useTags": false 2916 | }, 2917 | { 2918 | "allFormat": "glob", 2919 | "allValue": null, 2920 | "current": {}, 2921 | "datasource": "${DS_PROMETHEUS}", 2922 | "hide": 2, 2923 | "includeAll": true, 2924 | "label": "JVM Buffer Pools", 2925 | "multi": false, 2926 | "multiFormat": "glob", 2927 | "name": "jvm_buffer_pool", 2928 | "options": [], 2929 | "query": "label_values(jvm_buffer_memory_used_bytes{application=\"$application\", instance=\"$instance\"},id)", 2930 | "refresh": 1, 2931 | "regex": "", 2932 | "sort": 1, 2933 | "tagValuesQuery": "", 2934 | "tags": [], 2935 | "tagsQuery": "", 2936 | "type": "query", 2937 | "useTags": false 2938 | } 2939 | ] 2940 | }, 2941 | "time": { 2942 | "from": "now-24h", 2943 | "to": "now" 2944 | }, 2945 | "timepicker": { 2946 | "now": true, 2947 | "refresh_intervals": [ 2948 | "5s", 2949 | "10s", 2950 | "30s", 2951 | "1m", 2952 | "5m", 2953 | "15m", 2954 | "30m", 2955 | "1h", 2956 | "2h", 2957 | "1d" 2958 | ], 2959 | "time_options": [ 2960 | "5m", 2961 | "15m", 2962 | "1h", 2963 | "6h", 2964 | "12h", 2965 | "24h", 2966 | "2d", 2967 | "7d", 2968 | "30d" 2969 | ] 2970 | }, 2971 | "timezone": "browser", 2972 | "title": "JVM (Micrometer)", 2973 | "version": 33 2974 | } -------------------------------------------------------------------------------- /monitoring/config/grafana/provisioning/dashboards/all.yaml: -------------------------------------------------------------------------------- 1 | # grafana/provisioning/dashboards/all.yaml 2 | apiVersion: 1 3 | 4 | providers: 5 | - name: 'default' 6 | folder: 'default' 7 | type: file 8 | allowUiUpdates: true 9 | updateIntervalSeconds: 30 10 | options: 11 | path: /etc/grafana/provisioning/dashboards 12 | foldersFromFilesStructure: true -------------------------------------------------------------------------------- /monitoring/config/grafana/provisioning/dashboards/spring-boot-monitoring_rev1.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": { 7 | "type": "grafana", 8 | "uid": "-- Grafana --" 9 | }, 10 | "enable": true, 11 | "hide": true, 12 | "iconColor": "rgba(0, 211, 255, 1)", 13 | "name": "Annotations & Alerts", 14 | "type": "dashboard" 15 | } 16 | ] 17 | }, 18 | "description": "Useful metrics of Spring Boot Applications", 19 | "editable": true, 20 | "fiscalYearStartMonth": 0, 21 | "graphTooltip": 1, 22 | "id": 2, 23 | "links": [], 24 | "liveNow": false, 25 | "panels": [ 26 | { 27 | "collapsed": false, 28 | "gridPos": { 29 | "h": 1, 30 | "w": 24, 31 | "x": 0, 32 | "y": 0 33 | }, 34 | "id": 1, 35 | "panels": [], 36 | "title": "Incoming HTTP requests", 37 | "type": "row" 38 | }, 39 | { 40 | "datasource": { 41 | "type": "prometheus", 42 | "uid": "PBFA97CFB590B2093" 43 | }, 44 | "fieldConfig": { 45 | "defaults": { 46 | "color": { 47 | "mode": "palette-classic" 48 | }, 49 | "custom": { 50 | "axisBorderShow": true, 51 | "axisCenteredZero": false, 52 | "axisColorMode": "text", 53 | "axisLabel": "RPS", 54 | "axisPlacement": "auto", 55 | "barAlignment": 0, 56 | "drawStyle": "line", 57 | "fillOpacity": 25, 58 | "gradientMode": "opacity", 59 | "hideFrom": { 60 | "legend": false, 61 | "tooltip": false, 62 | "viz": false 63 | }, 64 | "insertNulls": false, 65 | "lineInterpolation": "smooth", 66 | "lineStyle": { 67 | "fill": "solid" 68 | }, 69 | "lineWidth": 5, 70 | "pointSize": 5, 71 | "scaleDistribution": { 72 | "type": "linear" 73 | }, 74 | "showPoints": "auto", 75 | "spanNulls": false, 76 | "stacking": { 77 | "group": "A", 78 | "mode": "none" 79 | }, 80 | "thresholdsStyle": { 81 | "mode": "off" 82 | } 83 | }, 84 | "fieldMinMax": false, 85 | "mappings": [], 86 | "thresholds": { 87 | "mode": "absolute", 88 | "steps": [ 89 | { 90 | "color": "green", 91 | "value": null 92 | } 93 | ] 94 | }, 95 | "unit": "reqps" 96 | }, 97 | "overrides": [] 98 | }, 99 | "gridPos": { 100 | "h": 8, 101 | "w": 24, 102 | "x": 0, 103 | "y": 1 104 | }, 105 | "id": 2, 106 | "options": { 107 | "legend": { 108 | "calcs": [ 109 | "min", 110 | "max", 111 | "mean" 112 | ], 113 | "displayMode": "table", 114 | "placement": "right", 115 | "showLegend": true 116 | }, 117 | "tooltip": { 118 | "mode": "single", 119 | "sort": "none" 120 | } 121 | }, 122 | "targets": [ 123 | { 124 | "datasource": { 125 | "type": "prometheus", 126 | "uid": "PBFA97CFB590B2093" 127 | }, 128 | "disableTextWrap": false, 129 | "editorMode": "code", 130 | "exemplar": false, 131 | "expr": "rate(http_server_requests_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])", 132 | "fullMetaSearch": false, 133 | "hide": false, 134 | "includeNullMetadata": true, 135 | "instant": false, 136 | "legendFormat": "{{method}}-{{status}}-{{uri}}", 137 | "range": true, 138 | "refId": "A", 139 | "useBackend": false 140 | } 141 | ], 142 | "title": "Throughput", 143 | "type": "timeseries" 144 | }, 145 | { 146 | "datasource": { 147 | "type": "prometheus", 148 | "uid": "PBFA97CFB590B2093" 149 | }, 150 | "description": "", 151 | "fieldConfig": { 152 | "defaults": { 153 | "color": { 154 | "mode": "palette-classic" 155 | }, 156 | "custom": { 157 | "axisBorderShow": true, 158 | "axisCenteredZero": false, 159 | "axisColorMode": "text", 160 | "axisLabel": "ms", 161 | "axisPlacement": "auto", 162 | "barAlignment": 0, 163 | "drawStyle": "line", 164 | "fillOpacity": 25, 165 | "gradientMode": "opacity", 166 | "hideFrom": { 167 | "legend": false, 168 | "tooltip": false, 169 | "viz": false 170 | }, 171 | "insertNulls": false, 172 | "lineInterpolation": "smooth", 173 | "lineWidth": 5, 174 | "pointSize": 5, 175 | "scaleDistribution": { 176 | "type": "linear" 177 | }, 178 | "showPoints": "auto", 179 | "spanNulls": false, 180 | "stacking": { 181 | "group": "A", 182 | "mode": "none" 183 | }, 184 | "thresholdsStyle": { 185 | "mode": "off" 186 | } 187 | }, 188 | "mappings": [], 189 | "thresholds": { 190 | "mode": "absolute", 191 | "steps": [ 192 | { 193 | "color": "green", 194 | "value": null 195 | }, 196 | { 197 | "color": "red", 198 | "value": 80 199 | } 200 | ] 201 | }, 202 | "unit": "s" 203 | }, 204 | "overrides": [] 205 | }, 206 | "gridPos": { 207 | "h": 8, 208 | "w": 24, 209 | "x": 0, 210 | "y": 9 211 | }, 212 | "id": 3, 213 | "options": { 214 | "legend": { 215 | "calcs": [ 216 | "min", 217 | "max", 218 | "mean" 219 | ], 220 | "displayMode": "table", 221 | "placement": "right", 222 | "showLegend": true 223 | }, 224 | "tooltip": { 225 | "mode": "single", 226 | "sort": "none" 227 | } 228 | }, 229 | "targets": [ 230 | { 231 | "datasource": { 232 | "type": "prometheus", 233 | "uid": "PBFA97CFB590B2093" 234 | }, 235 | "editorMode": "code", 236 | "expr": "rate(http_server_requests_seconds_sum{application=\"$application\", instance=\"$instance\"}[1m])/rate(http_server_requests_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])", 237 | "instant": false, 238 | "legendFormat": "{{method}}-{{status}}-{{uri}}", 239 | "range": true, 240 | "refId": "A" 241 | } 242 | ], 243 | "title": "Average latency", 244 | "type": "timeseries" 245 | }, 246 | { 247 | "collapsed": false, 248 | "gridPos": { 249 | "h": 1, 250 | "w": 24, 251 | "x": 0, 252 | "y": 17 253 | }, 254 | "id": 4, 255 | "panels": [], 256 | "title": "Outgoing HTTP requests", 257 | "type": "row" 258 | }, 259 | { 260 | "datasource": { 261 | "type": "prometheus", 262 | "uid": "PBFA97CFB590B2093" 263 | }, 264 | "fieldConfig": { 265 | "defaults": { 266 | "color": { 267 | "mode": "palette-classic" 268 | }, 269 | "custom": { 270 | "axisBorderShow": true, 271 | "axisCenteredZero": false, 272 | "axisColorMode": "text", 273 | "axisLabel": "RPS", 274 | "axisPlacement": "auto", 275 | "barAlignment": 0, 276 | "drawStyle": "line", 277 | "fillOpacity": 25, 278 | "gradientMode": "opacity", 279 | "hideFrom": { 280 | "legend": false, 281 | "tooltip": false, 282 | "viz": false 283 | }, 284 | "insertNulls": false, 285 | "lineInterpolation": "smooth", 286 | "lineStyle": { 287 | "fill": "solid" 288 | }, 289 | "lineWidth": 5, 290 | "pointSize": 5, 291 | "scaleDistribution": { 292 | "type": "linear" 293 | }, 294 | "showPoints": "auto", 295 | "spanNulls": false, 296 | "stacking": { 297 | "group": "A", 298 | "mode": "none" 299 | }, 300 | "thresholdsStyle": { 301 | "mode": "off" 302 | } 303 | }, 304 | "fieldMinMax": false, 305 | "mappings": [], 306 | "thresholds": { 307 | "mode": "absolute", 308 | "steps": [ 309 | { 310 | "color": "green", 311 | "value": null 312 | } 313 | ] 314 | }, 315 | "unit": "reqps" 316 | }, 317 | "overrides": [] 318 | }, 319 | "gridPos": { 320 | "h": 8, 321 | "w": 24, 322 | "x": 0, 323 | "y": 18 324 | }, 325 | "id": 5, 326 | "options": { 327 | "legend": { 328 | "calcs": [ 329 | "min", 330 | "max", 331 | "mean" 332 | ], 333 | "displayMode": "table", 334 | "placement": "right", 335 | "showLegend": true 336 | }, 337 | "tooltip": { 338 | "mode": "single", 339 | "sort": "none" 340 | } 341 | }, 342 | "targets": [ 343 | { 344 | "datasource": { 345 | "type": "prometheus", 346 | "uid": "PBFA97CFB590B2093" 347 | }, 348 | "disableTextWrap": false, 349 | "editorMode": "code", 350 | "exemplar": false, 351 | "expr": "rate(http_client_requests_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])", 352 | "fullMetaSearch": false, 353 | "hide": false, 354 | "includeNullMetadata": true, 355 | "instant": false, 356 | "legendFormat": "{{method}}-{{status}}-{{uri}}", 357 | "range": true, 358 | "refId": "A", 359 | "useBackend": false 360 | } 361 | ], 362 | "title": "Throughput", 363 | "type": "timeseries" 364 | }, 365 | { 366 | "datasource": { 367 | "type": "prometheus", 368 | "uid": "PBFA97CFB590B2093" 369 | }, 370 | "description": "", 371 | "fieldConfig": { 372 | "defaults": { 373 | "color": { 374 | "mode": "palette-classic" 375 | }, 376 | "custom": { 377 | "axisBorderShow": true, 378 | "axisCenteredZero": false, 379 | "axisColorMode": "text", 380 | "axisLabel": "ms", 381 | "axisPlacement": "auto", 382 | "barAlignment": 0, 383 | "drawStyle": "line", 384 | "fillOpacity": 25, 385 | "gradientMode": "opacity", 386 | "hideFrom": { 387 | "legend": false, 388 | "tooltip": false, 389 | "viz": false 390 | }, 391 | "insertNulls": false, 392 | "lineInterpolation": "smooth", 393 | "lineWidth": 5, 394 | "pointSize": 5, 395 | "scaleDistribution": { 396 | "type": "linear" 397 | }, 398 | "showPoints": "auto", 399 | "spanNulls": false, 400 | "stacking": { 401 | "group": "A", 402 | "mode": "none" 403 | }, 404 | "thresholdsStyle": { 405 | "mode": "off" 406 | } 407 | }, 408 | "mappings": [], 409 | "thresholds": { 410 | "mode": "absolute", 411 | "steps": [ 412 | { 413 | "color": "green", 414 | "value": null 415 | }, 416 | { 417 | "color": "red", 418 | "value": 80 419 | } 420 | ] 421 | }, 422 | "unit": "s" 423 | }, 424 | "overrides": [] 425 | }, 426 | "gridPos": { 427 | "h": 8, 428 | "w": 24, 429 | "x": 0, 430 | "y": 26 431 | }, 432 | "id": 6, 433 | "options": { 434 | "legend": { 435 | "calcs": [ 436 | "min", 437 | "max", 438 | "mean" 439 | ], 440 | "displayMode": "table", 441 | "placement": "right", 442 | "showLegend": true 443 | }, 444 | "tooltip": { 445 | "mode": "single", 446 | "sort": "none" 447 | } 448 | }, 449 | "targets": [ 450 | { 451 | "datasource": { 452 | "type": "prometheus", 453 | "uid": "PBFA97CFB590B2093" 454 | }, 455 | "editorMode": "code", 456 | "expr": "rate(http_client_requests_seconds_sum{application=\"$application\", instance=\"$instance\"}[1m])/rate(http_client_requests_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])", 457 | "instant": false, 458 | "legendFormat": "{{method}}-{{status}}-{{client_name}}{{uri}}", 459 | "range": true, 460 | "refId": "A" 461 | } 462 | ], 463 | "title": "Average latency", 464 | "type": "timeseries" 465 | }, 466 | { 467 | "collapsed": false, 468 | "gridPos": { 469 | "h": 1, 470 | "w": 24, 471 | "x": 0, 472 | "y": 34 473 | }, 474 | "id": 7, 475 | "panels": [], 476 | "title": "Spring Data Repository", 477 | "type": "row" 478 | }, 479 | { 480 | "datasource": { 481 | "type": "prometheus", 482 | "uid": "PBFA97CFB590B2093" 483 | }, 484 | "description": "", 485 | "fieldConfig": { 486 | "defaults": { 487 | "color": { 488 | "mode": "palette-classic" 489 | }, 490 | "custom": { 491 | "axisBorderShow": true, 492 | "axisCenteredZero": false, 493 | "axisColorMode": "text", 494 | "axisLabel": "ms", 495 | "axisPlacement": "auto", 496 | "barAlignment": 0, 497 | "drawStyle": "line", 498 | "fillOpacity": 25, 499 | "gradientMode": "opacity", 500 | "hideFrom": { 501 | "legend": false, 502 | "tooltip": false, 503 | "viz": false 504 | }, 505 | "insertNulls": false, 506 | "lineInterpolation": "smooth", 507 | "lineWidth": 5, 508 | "pointSize": 5, 509 | "scaleDistribution": { 510 | "type": "linear" 511 | }, 512 | "showPoints": "auto", 513 | "spanNulls": false, 514 | "stacking": { 515 | "group": "A", 516 | "mode": "none" 517 | }, 518 | "thresholdsStyle": { 519 | "mode": "off" 520 | } 521 | }, 522 | "mappings": [], 523 | "thresholds": { 524 | "mode": "absolute", 525 | "steps": [ 526 | { 527 | "color": "green", 528 | "value": null 529 | }, 530 | { 531 | "color": "red", 532 | "value": 80 533 | } 534 | ] 535 | }, 536 | "unit": "s" 537 | }, 538 | "overrides": [] 539 | }, 540 | "gridPos": { 541 | "h": 8, 542 | "w": 24, 543 | "x": 0, 544 | "y": 35 545 | }, 546 | "id": 8, 547 | "options": { 548 | "legend": { 549 | "calcs": [ 550 | "min", 551 | "max", 552 | "mean" 553 | ], 554 | "displayMode": "table", 555 | "placement": "right", 556 | "showLegend": true, 557 | "sortBy": "Name", 558 | "sortDesc": true 559 | }, 560 | "tooltip": { 561 | "mode": "single", 562 | "sort": "none" 563 | } 564 | }, 565 | "targets": [ 566 | { 567 | "datasource": { 568 | "type": "prometheus", 569 | "uid": "PBFA97CFB590B2093" 570 | }, 571 | "editorMode": "code", 572 | "expr": "rate(spring_data_repository_invocations_seconds_sum{application=\"$application\", instance=\"$instance\"}[1m])/rate(spring_data_repository_invocations_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])", 573 | "instant": false, 574 | "legendFormat": "{{state}} - {{repository}}.{{method}}()", 575 | "range": true, 576 | "refId": "A" 577 | } 578 | ], 579 | "title": "Average latency", 580 | "type": "timeseries" 581 | } 582 | ], 583 | "refresh": "5s", 584 | "schemaVersion": 38, 585 | "tags": [], 586 | "templating": { 587 | "list": [ 588 | { 589 | "current": { 590 | "selected": false, 591 | "text": "rightdevops", 592 | "value": "rightdevops" 593 | }, 594 | "datasource": { 595 | "type": "prometheus", 596 | "uid": "PBFA97CFB590B2093" 597 | }, 598 | "definition": "label_values(application)", 599 | "hide": 0, 600 | "includeAll": false, 601 | "label": "Application", 602 | "multi": false, 603 | "name": "application", 604 | "options": [], 605 | "query": { 606 | "qryType": 1, 607 | "query": "label_values(application)", 608 | "refId": "PrometheusVariableQueryEditor-VariableQuery" 609 | }, 610 | "refresh": 1, 611 | "regex": "", 612 | "skipUrlSync": false, 613 | "sort": 0, 614 | "type": "query" 615 | }, 616 | { 617 | "current": { 618 | "selected": false, 619 | "text": "host.docker.internal:8081", 620 | "value": "host.docker.internal:8081" 621 | }, 622 | "datasource": { 623 | "type": "prometheus", 624 | "uid": "PBFA97CFB590B2093" 625 | }, 626 | "definition": "label_values({application=\"$application\"},instance)", 627 | "hide": 0, 628 | "includeAll": false, 629 | "label": "Instance", 630 | "multi": false, 631 | "name": "instance", 632 | "options": [], 633 | "query": { 634 | "qryType": 1, 635 | "query": "label_values({application=\"$application\"},instance)", 636 | "refId": "PrometheusVariableQueryEditor-VariableQuery" 637 | }, 638 | "refresh": 1, 639 | "regex": "", 640 | "skipUrlSync": false, 641 | "sort": 0, 642 | "type": "query" 643 | } 644 | ] 645 | }, 646 | "time": { 647 | "from": "now-1h", 648 | "to": "now" 649 | }, 650 | "timepicker": {}, 651 | "timezone": "browser", 652 | "title": "Spring Boot Monitoring", 653 | "uid": "aff1fc1c-bec1-4ccd-9ed0-11d28986dd47", 654 | "version": 4, 655 | "weekStart": "" 656 | } -------------------------------------------------------------------------------- /monitoring/config/grafana/provisioning/datasources/all.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | datasources: 4 | - name: Prometheus 5 | label: Prometheus 6 | type: prometheus 7 | access: proxy 8 | url: http://prometheus:9090 9 | isDefault: true 10 | -------------------------------------------------------------------------------- /monitoring/config/prometheus.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'rightdevops' 3 | scrape_interval: 5s 4 | metrics_path: '/actuator/prometheus' 5 | static_configs: 6 | - targets: ['host.docker.internal:8080'] 7 | -------------------------------------------------------------------------------- /pom.example.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | right-devops 8 | 9 | 10 | 4.21.1 11 | 12 | 13 | 14 | 15 | 16 | org.liquibase 17 | liquibase-core 18 | ${liquibase.version} 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | org.liquibase 27 | liquibase-maven-plugin 28 | ${liquibase.version} 29 | 30 | db/changelog/db.changelog-master.xml 31 | src/main/resources/ 32 | ${env.DB_URL} 33 | ${env.DB_USERNAME} 34 | ${env.DB_PASSWORD} 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:14 2 | 3 | RUN apt update && \ 4 | apt install dos2unix -y 5 | 6 | COPY ./initdb /docker-entrypoint-initdb.d/ 7 | 8 | RUN dos2unix /docker-entrypoint-initdb.d/init-db.sh && \ 9 | chmod +x /docker-entrypoint-initdb.d/init-db.sh -------------------------------------------------------------------------------- /postgres/initdb/init-db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | psql -v ON_ERROR_STOP=1 --username pgadmin --dbname pgadmin <<-EOSQL 4 | 5 | CREATE DATABASE rightdevops WITH OWNER pgadmin; 6 | EOSQL 7 | 8 | BACKUP_DIR=/docker-entrypoint-initdb.d/db_backup 9 | 10 | DATABASES=( 11 | "rightdevops" 12 | ) 13 | 14 | export PGPASSWORD=pgadmin 15 | 16 | #for db in "${DATABASES[@]}"; do 17 | # psql -U pgadmin -d "$db" < "$BACKUP_DIR/$db.sql" 18 | #done 19 | -------------------------------------------------------------------------------- /postgres/postgresql.conf: -------------------------------------------------------------------------------- 1 | # ----------------------------- 2 | # PostgreSQL configuration file 3 | # ----------------------------- 4 | # 5 | # This file consists of lines of the form: 6 | # 7 | # name = value 8 | # 9 | # (The "=" is optional.) Whitespace may be used. Comments are introduced with 10 | # "#" anywhere on a line. The complete list of parameter names and allowed 11 | # values can be found in the PostgreSQL documentation. 12 | # 13 | # The commented-out settings shown in this file represent the default values. 14 | # Re-commenting a setting is NOT sufficient to revert it to the default value; 15 | # you need to reload the server. 16 | # 17 | # This file is read on server startup and when the server receives a SIGHUP 18 | # signal. If you edit the file on a running system, you have to SIGHUP the 19 | # server for the changes to take effect, run "pg_ctl reload", or execute 20 | # "SELECT pg_reload_conf()". Some parameters, which are marked below, 21 | # require a server shutdown and restart to take effect. 22 | # 23 | # Any parameter can also be given as a command-line option to the server, e.g., 24 | # "postgres -c log_connections=on". Some parameters can be changed at run time 25 | # with the "SET" SQL command. 26 | # 27 | # Memory units: B = bytes Time units: us = microseconds 28 | # kB = kilobytes ms = milliseconds 29 | # MB = megabytes s = seconds 30 | # GB = gigabytes min = minutes 31 | # TB = terabytes h = hours 32 | # d = days 33 | 34 | 35 | #------------------------------------------------------------------------------ 36 | # FILE LOCATIONS 37 | #------------------------------------------------------------------------------ 38 | 39 | # The default values of these variables are driven from the -D command-line 40 | # option or PGDATA environment variable, represented here as ConfigDir. 41 | 42 | #data_directory = 'ConfigDir' # use data in another directory 43 | # (change requires restart) 44 | #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file 45 | # (change requires restart) 46 | #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file 47 | # (change requires restart) 48 | 49 | # If external_pid_file is not explicitly set, no extra PID file is written. 50 | #external_pid_file = '' # write an extra PID file 51 | # (change requires restart) 52 | 53 | 54 | #------------------------------------------------------------------------------ 55 | # CONNECTIONS AND AUTHENTICATION 56 | #------------------------------------------------------------------------------ 57 | 58 | # - Connection Settings - 59 | 60 | listen_addresses = '*' 61 | # comma-separated list of addresses; 62 | # defaults to 'localhost'; use '*' for all 63 | # (change requires restart) 64 | #port = 5432 # (change requires restart) 65 | max_connections = 500 # (change requires restart) 66 | #superuser_reserved_connections = 3 # (change requires restart) 67 | #unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories 68 | # (change requires restart) 69 | #unix_socket_group = '' # (change requires restart) 70 | #unix_socket_permissions = 0777 # begin with 0 to use octal notation 71 | # (change requires restart) 72 | #bonjour = off # advertise server via Bonjour 73 | # (change requires restart) 74 | #bonjour_name = '' # defaults to the computer name 75 | # (change requires restart) 76 | 77 | # - TCP settings - 78 | # see "man 7 tcp" for details 79 | 80 | #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; 81 | # 0 selects the system default 82 | #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; 83 | # 0 selects the system default 84 | #tcp_keepalives_count = 0 # TCP_KEEPCNT; 85 | # 0 selects the system default 86 | #tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds; 87 | # 0 selects the system default 88 | 89 | # - Authentication - 90 | 91 | #authentication_timeout = 1min # 1s-600s 92 | #password_encryption = md5 # md5 or scram-sha-256 93 | #db_user_namespace = off 94 | 95 | # GSSAPI using Kerberos 96 | #krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab' 97 | #krb_caseins_users = off 98 | 99 | # - SSL - 100 | 101 | #ssl = off 102 | #ssl_ca_file = '' 103 | #ssl_cert_file = 'server.crt' 104 | #ssl_crl_file = '' 105 | #ssl_key_file = 'server.key' 106 | #ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers 107 | #ssl_prefer_server_ciphers = on 108 | #ssl_ecdh_curve = 'prime256v1' 109 | #ssl_min_protocol_version = 'TLSv1' 110 | #ssl_max_protocol_version = '' 111 | #ssl_dh_params_file = '' 112 | #ssl_passphrase_command = '' 113 | #ssl_passphrase_command_supports_reload = off 114 | 115 | 116 | #------------------------------------------------------------------------------ 117 | # RESOURCE USAGE (except WAL) 118 | #------------------------------------------------------------------------------ 119 | 120 | # - Memory - 121 | 122 | shared_buffers = 128MB # min 128kB 123 | # (change requires restart) 124 | #huge_pages = try # on, off, or try 125 | # (change requires restart) 126 | #temp_buffers = 8MB # min 800kB 127 | #max_prepared_transactions = 0 # zero disables the feature 128 | # (change requires restart) 129 | # Caution: it is not advisable to set max_prepared_transactions nonzero unless 130 | # you actively intend to use prepared transactions. 131 | #work_mem = 4MB # min 64kB 132 | #maintenance_work_mem = 64MB # min 1MB 133 | #autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem 134 | #max_stack_depth = 2MB # min 100kB 135 | #shared_memory_type = mmap # the default is the first option 136 | # supported by the operating system: 137 | # mmap 138 | # sysv 139 | # windows 140 | # (change requires restart) 141 | dynamic_shared_memory_type = posix # the default is the first option 142 | # supported by the operating system: 143 | # posix 144 | # sysv 145 | # windows 146 | # mmap 147 | # (change requires restart) 148 | 149 | # - Disk - 150 | 151 | #temp_file_limit = -1 # limits per-process temp file space 152 | # in kB, or -1 for no limit 153 | 154 | # - Kernel Resources - 155 | 156 | #max_files_per_process = 1000 # min 25 157 | # (change requires restart) 158 | 159 | # - Cost-Based Vacuum Delay - 160 | 161 | #vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables) 162 | #vacuum_cost_page_hit = 1 # 0-10000 credits 163 | #vacuum_cost_page_miss = 10 # 0-10000 credits 164 | #vacuum_cost_page_dirty = 20 # 0-10000 credits 165 | #vacuum_cost_limit = 200 # 1-10000 credits 166 | 167 | # - Background Writer - 168 | 169 | #bgwriter_delay = 200ms # 10-10000ms between rounds 170 | #bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables 171 | #bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round 172 | #bgwriter_flush_after = 512kB # measured in pages, 0 disables 173 | 174 | # - Asynchronous Behavior - 175 | 176 | #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching 177 | #max_worker_processes = 8 # (change requires restart) 178 | #max_parallel_maintenance_workers = 2 # taken from max_parallel_workers 179 | #max_parallel_workers_per_gather = 2 # taken from max_parallel_workers 180 | #parallel_leader_participation = on 181 | #max_parallel_workers = 8 # maximum number of max_worker_processes that 182 | # can be used in parallel operations 183 | #old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate 184 | # (change requires restart) 185 | #backend_flush_after = 0 # measured in pages, 0 disables 186 | 187 | 188 | #------------------------------------------------------------------------------ 189 | # WRITE-AHEAD LOG 190 | #------------------------------------------------------------------------------ 191 | 192 | # - Settings - 193 | 194 | #wal_level = replica # minimal, replica, or logical 195 | # (change requires restart) 196 | #fsync = on # flush data to disk for crash safety 197 | # (turning this off can cause 198 | # unrecoverable data corruption) 199 | #synchronous_commit = on # synchronization level; 200 | # off, local, remote_write, remote_apply, or on 201 | #wal_sync_method = fsync # the default is the first option 202 | # supported by the operating system: 203 | # open_datasync 204 | # fdatasync (default on Linux and FreeBSD) 205 | # fsync 206 | # fsync_writethrough 207 | # open_sync 208 | #full_page_writes = on # recover from partial page writes 209 | #wal_compression = off # enable compression of full-page writes 210 | #wal_log_hints = off # also do full page writes of non-critical updates 211 | # (change requires restart) 212 | #wal_init_zero = on # zero-fill new WAL files 213 | #wal_recycle = on # recycle WAL files 214 | #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers 215 | # (change requires restart) 216 | #wal_writer_delay = 200ms # 1-10000 milliseconds 217 | #wal_writer_flush_after = 1MB # measured in pages, 0 disables 218 | 219 | #commit_delay = 0 # range 0-100000, in microseconds 220 | #commit_siblings = 5 # range 1-1000 221 | 222 | # - Checkpoints - 223 | 224 | #checkpoint_timeout = 5min # range 30s-1d 225 | max_wal_size = 1GB 226 | min_wal_size = 80MB 227 | #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 228 | #checkpoint_flush_after = 256kB # measured in pages, 0 disables 229 | #checkpoint_warning = 30s # 0 disables 230 | 231 | # - Archiving - 232 | 233 | #archive_mode = off # enables archiving; off, on, or always 234 | # (change requires restart) 235 | #archive_command = '' # command to use to archive a logfile segment 236 | # placeholders: %p = path of file to archive 237 | # %f = file name only 238 | # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' 239 | #archive_timeout = 0 # force a logfile segment switch after this 240 | # number of seconds; 0 disables 241 | 242 | # - Archive Recovery - 243 | 244 | # These are only used in recovery mode. 245 | 246 | #restore_command = '' # command to use to restore an archived logfile segment 247 | # placeholders: %p = path of file to restore 248 | # %f = file name only 249 | # e.g. 'cp /mnt/server/archivedir/%f %p' 250 | # (change requires restart) 251 | #archive_cleanup_command = '' # command to execute at every restartpoint 252 | #recovery_end_command = '' # command to execute at completion of recovery 253 | 254 | # - Recovery Target - 255 | 256 | # Set these only when performing a targeted recovery. 257 | 258 | #recovery_target = '' # 'immediate' to end recovery as soon as a 259 | # consistent state is reached 260 | # (change requires restart) 261 | #recovery_target_name = '' # the named restore point to which recovery will proceed 262 | # (change requires restart) 263 | #recovery_target_time = '' # the time stamp up to which recovery will proceed 264 | # (change requires restart) 265 | #recovery_target_xid = '' # the transaction ID up to which recovery will proceed 266 | # (change requires restart) 267 | #recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed 268 | # (change requires restart) 269 | #recovery_target_inclusive = on # Specifies whether to stop: 270 | # just after the specified recovery target (on) 271 | # just before the recovery target (off) 272 | # (change requires restart) 273 | #recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID 274 | # (change requires restart) 275 | #recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' 276 | # (change requires restart) 277 | 278 | 279 | #------------------------------------------------------------------------------ 280 | # REPLICATION 281 | #------------------------------------------------------------------------------ 282 | 283 | # - Sending Servers - 284 | 285 | # Set these on the master and on any standby that will send replication data. 286 | 287 | #max_wal_senders = 10 # max number of walsender processes 288 | # (change requires restart) 289 | #wal_keep_segments = 0 # in logfile segments; 0 disables 290 | #wal_sender_timeout = 60s # in milliseconds; 0 disables 291 | 292 | #max_replication_slots = 10 # max number of replication slots 293 | # (change requires restart) 294 | #track_commit_timestamp = off # collect timestamp of transaction commit 295 | # (change requires restart) 296 | 297 | # - Master Server - 298 | 299 | # These settings are ignored on a standby server. 300 | 301 | #synchronous_standby_names = '' # standby servers that provide sync rep 302 | # method to choose sync standbys, number of sync standbys, 303 | # and comma-separated list of application_name 304 | # from standby(s); '*' = all 305 | #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed 306 | 307 | # - Standby Servers - 308 | 309 | # These settings are ignored on a master server. 310 | 311 | #primary_conninfo = '' # connection string to sending server 312 | # (change requires restart) 313 | #primary_slot_name = '' # replication slot on sending server 314 | # (change requires restart) 315 | #promote_trigger_file = '' # file name whose presence ends recovery 316 | #hot_standby = on # "off" disallows queries during recovery 317 | # (change requires restart) 318 | #max_standby_archive_delay = 30s # max delay before canceling queries 319 | # when reading WAL from archive; 320 | # -1 allows indefinite delay 321 | #max_standby_streaming_delay = 30s # max delay before canceling queries 322 | # when reading streaming WAL; 323 | # -1 allows indefinite delay 324 | #wal_receiver_status_interval = 10s # send replies at least this often 325 | # 0 disables 326 | #hot_standby_feedback = off # send info from standby to prevent 327 | # query conflicts 328 | #wal_receiver_timeout = 60s # time that receiver waits for 329 | # communication from master 330 | # in milliseconds; 0 disables 331 | #wal_retrieve_retry_interval = 5s # time to wait before retrying to 332 | # retrieve WAL after a failed attempt 333 | #recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery 334 | 335 | # - Subscribers - 336 | 337 | # These settings are ignored on a publisher. 338 | 339 | #max_logical_replication_workers = 4 # taken from max_worker_processes 340 | # (change requires restart) 341 | #max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers 342 | 343 | 344 | #------------------------------------------------------------------------------ 345 | # QUERY TUNING 346 | #------------------------------------------------------------------------------ 347 | 348 | # - Planner Method Configuration - 349 | 350 | #enable_bitmapscan = on 351 | #enable_hashagg = on 352 | #enable_hashjoin = on 353 | #enable_indexscan = on 354 | #enable_indexonlyscan = on 355 | #enable_material = on 356 | #enable_mergejoin = on 357 | #enable_nestloop = on 358 | #enable_parallel_append = on 359 | #enable_seqscan = on 360 | #enable_sort = on 361 | #enable_tidscan = on 362 | #enable_partitionwise_join = off 363 | #enable_partitionwise_aggregate = off 364 | #enable_parallel_hash = on 365 | #enable_partition_pruning = on 366 | 367 | # - Planner Cost Constants - 368 | 369 | #seq_page_cost = 1.0 # measured on an arbitrary scale 370 | #random_page_cost = 4.0 # same scale as above 371 | #cpu_tuple_cost = 0.01 # same scale as above 372 | #cpu_index_tuple_cost = 0.005 # same scale as above 373 | #cpu_operator_cost = 0.0025 # same scale as above 374 | #parallel_tuple_cost = 0.1 # same scale as above 375 | #parallel_setup_cost = 1000.0 # same scale as above 376 | 377 | #jit_above_cost = 100000 # perform JIT compilation if available 378 | # and query more expensive than this; 379 | # -1 disables 380 | #jit_inline_above_cost = 500000 # inline small functions if query is 381 | # more expensive than this; -1 disables 382 | #jit_optimize_above_cost = 500000 # use expensive JIT optimizations if 383 | # query is more expensive than this; 384 | # -1 disables 385 | 386 | #min_parallel_table_scan_size = 8MB 387 | #min_parallel_index_scan_size = 512kB 388 | #effective_cache_size = 4GB 389 | 390 | # - Genetic Query Optimizer - 391 | 392 | #geqo = on 393 | #geqo_threshold = 12 394 | #geqo_effort = 5 # range 1-10 395 | #geqo_pool_size = 0 # selects default based on effort 396 | #geqo_generations = 0 # selects default based on effort 397 | #geqo_selection_bias = 2.0 # range 1.5-2.0 398 | #geqo_seed = 0.0 # range 0.0-1.0 399 | 400 | # - Other Planner Options - 401 | 402 | #default_statistics_target = 100 # range 1-10000 403 | #constraint_exclusion = partition # on, off, or partition 404 | #cursor_tuple_fraction = 0.1 # range 0.0-1.0 405 | #from_collapse_limit = 8 406 | #join_collapse_limit = 8 # 1 disables collapsing of explicit 407 | # JOIN clauses 408 | #force_parallel_mode = off 409 | #jit = on # allow JIT compilation 410 | #plan_cache_mode = auto # auto, force_generic_plan or 411 | # force_custom_plan 412 | 413 | 414 | #------------------------------------------------------------------------------ 415 | # REPORTING AND LOGGING 416 | #------------------------------------------------------------------------------ 417 | 418 | # - Where to Log - 419 | 420 | #log_destination = 'stderr' # Valid values are combinations of 421 | # stderr, csvlog, syslog, and eventlog, 422 | # depending on platform. csvlog 423 | # requires logging_collector to be on. 424 | 425 | # This is used when logging to stderr: 426 | #logging_collector = on # Enable capturing of stderr and csvlog 427 | # into log files. Required to be on for 428 | # csvlogs. 429 | # (change requires restart) 430 | 431 | # These are only used if logging_collector is on: 432 | #log_directory = 'pg_log' # directory where log files are written, 433 | # can be absolute or relative to PGDATA 434 | #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, 435 | # can include strftime() escapes 436 | #log_file_mode = 0600 # creation mode for log files, 437 | # begin with 0 to use octal notation 438 | #log_truncate_on_rotation = off # If on, an existing log file with the 439 | # same name as the new log file will be 440 | # truncated rather than appended to. 441 | # But such truncation only occurs on 442 | # time-driven rotation, not on restarts 443 | # or size-driven rotation. Default is 444 | # off, meaning append to existing files 445 | # in all cases. 446 | #log_rotation_age = 1d # Automatic rotation of logfiles will 447 | # happen after that time. 0 disables. 448 | #log_rotation_size = 10MB # Automatic rotation of logfiles will 449 | # happen after that much log output. 450 | # 0 disables. 451 | 452 | # These are relevant when logging to syslog: 453 | #syslog_facility = 'LOCAL0' 454 | #syslog_ident = 'postgres' 455 | #syslog_sequence_numbers = on 456 | #syslog_split_messages = on 457 | 458 | # This is only relevant when logging to eventlog (win32): 459 | # (change requires restart) 460 | #event_source = 'PostgreSQL' 461 | 462 | # - When to Log - 463 | 464 | #log_min_messages = warning # values in order of decreasing detail: 465 | # debug5 466 | # debug4 467 | # debug3 468 | # debug2 469 | # debug1 470 | # info 471 | # notice 472 | # warning 473 | # error 474 | # log 475 | # fatal 476 | # panic 477 | 478 | #log_min_error_statement = error # values in order of decreasing detail: 479 | # debug5 480 | # debug4 481 | # debug3 482 | # debug2 483 | # debug1 484 | # info 485 | # notice 486 | # warning 487 | # error 488 | # log 489 | # fatal 490 | # panic (effectively off) 491 | 492 | #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements 493 | # and their durations, > 0 logs only 494 | # statements running at least this number 495 | # of milliseconds 496 | 497 | #log_transaction_sample_rate = 0.0 # Fraction of transactions whose statements 498 | # are logged regardless of their duration. 1.0 logs all 499 | # statements from all transactions, 0.0 never logs. 500 | 501 | # - What to Log - 502 | 503 | #debug_print_parse = off 504 | #debug_print_rewritten = off 505 | #debug_print_plan = off 506 | #debug_pretty_print = on 507 | #log_checkpoints = off 508 | #log_connections = off 509 | #log_disconnections = off 510 | #log_duration = off 511 | #log_error_verbosity = default # terse, default, or verbose messages 512 | #log_hostname = off 513 | #log_line_prefix = '%m [%p] ' # special values: 514 | # %a = application name 515 | # %u = user name 516 | # %d = database name 517 | # %r = remote host and port 518 | # %h = remote host 519 | # %p = process ID 520 | # %t = timestamp without milliseconds 521 | # %m = timestamp with milliseconds 522 | # %n = timestamp with milliseconds (as a Unix epoch) 523 | # %i = command tag 524 | # %e = SQL state 525 | # %c = session ID 526 | # %l = session line number 527 | # %s = session start timestamp 528 | # %v = virtual transaction ID 529 | # %x = transaction ID (0 if none) 530 | # %q = stop here in non-session 531 | # processes 532 | # %% = '%' 533 | # e.g. '<%u%%%d> ' 534 | #log_lock_waits = off # log lock waits >= deadlock_timeout 535 | log_statement = 'all' # none, ddl, mod, all 536 | #log_replication_commands = off 537 | #log_temp_files = -1 # log temporary files equal or larger 538 | # than the specified size in kilobytes; 539 | # -1 disables, 0 logs all temp files 540 | log_timezone = 'Etc/UTC' 541 | 542 | #------------------------------------------------------------------------------ 543 | # PROCESS TITLE 544 | #------------------------------------------------------------------------------ 545 | 546 | #cluster_name = '' # added to process titles if nonempty 547 | # (change requires restart) 548 | #update_process_title = on 549 | 550 | 551 | #------------------------------------------------------------------------------ 552 | # STATISTICS 553 | #------------------------------------------------------------------------------ 554 | 555 | # - Query and Index Statistics Collector - 556 | 557 | #track_activities = on 558 | #track_counts = on 559 | #track_io_timing = off 560 | #track_functions = none # none, pl, all 561 | #track_activity_query_size = 1024 # (change requires restart) 562 | #stats_temp_directory = 'pg_stat_tmp' 563 | 564 | 565 | # - Monitoring - 566 | 567 | #log_parser_stats = off 568 | #log_planner_stats = off 569 | #log_executor_stats = off 570 | #log_statement_stats = off 571 | 572 | 573 | #------------------------------------------------------------------------------ 574 | # AUTOVACUUM 575 | #------------------------------------------------------------------------------ 576 | 577 | #autovacuum = on # Enable autovacuum subprocess? 'on' 578 | # requires track_counts to also be on. 579 | #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and 580 | # their durations, > 0 logs only 581 | # actions running at least this number 582 | # of milliseconds. 583 | #autovacuum_max_workers = 3 # max number of autovacuum subprocesses 584 | # (change requires restart) 585 | #autovacuum_naptime = 1min # time between autovacuum runs 586 | #autovacuum_vacuum_threshold = 50 # min number of row updates before 587 | # vacuum 588 | #autovacuum_analyze_threshold = 50 # min number of row updates before 589 | # analyze 590 | #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum 591 | #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze 592 | #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum 593 | # (change requires restart) 594 | #autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age 595 | # before forced vacuum 596 | # (change requires restart) 597 | #autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for 598 | # autovacuum, in milliseconds; 599 | # -1 means use vacuum_cost_delay 600 | #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for 601 | # autovacuum, -1 means use 602 | # vacuum_cost_limit 603 | 604 | 605 | #------------------------------------------------------------------------------ 606 | # CLIENT CONNECTION DEFAULTS 607 | #------------------------------------------------------------------------------ 608 | 609 | # - Statement Behavior - 610 | 611 | #client_min_messages = notice # values in order of decreasing detail: 612 | # debug5 613 | # debug4 614 | # debug3 615 | # debug2 616 | # debug1 617 | # log 618 | # notice 619 | # warning 620 | # error 621 | #search_path = '"$user", public' # schema names 622 | #row_security = on 623 | #default_tablespace = '' # a tablespace name, '' uses the default 624 | #temp_tablespaces = '' # a list of tablespace names, '' uses 625 | # only default tablespace 626 | #default_table_access_method = 'heap' 627 | #check_function_bodies = on 628 | #default_transaction_isolation = 'read committed' 629 | #default_transaction_read_only = off 630 | #default_transaction_deferrable = off 631 | #session_replication_role = 'origin' 632 | #statement_timeout = 0 # in milliseconds, 0 is disabled 633 | #lock_timeout = 0 # in milliseconds, 0 is disabled 634 | #idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled 635 | #vacuum_freeze_min_age = 50000000 636 | #vacuum_freeze_table_age = 150000000 637 | #vacuum_multixact_freeze_min_age = 5000000 638 | #vacuum_multixact_freeze_table_age = 150000000 639 | #vacuum_cleanup_index_scale_factor = 0.1 # fraction of total number of tuples 640 | # before index cleanup, 0 always performs 641 | # index cleanup 642 | #bytea_output = 'hex' # hex, escape 643 | #xmlbinary = 'base64' 644 | #xmloption = 'content' 645 | #gin_fuzzy_search_limit = 0 646 | #gin_pending_list_limit = 4MB 647 | 648 | # - Locale and Formatting - 649 | 650 | datestyle = 'iso, mdy' 651 | #intervalstyle = 'postgres' 652 | timezone = 'Etc/UTC' 653 | #timezone_abbreviations = 'Default' # Select the set of available time zone 654 | # abbreviations. Currently, there are 655 | # Default 656 | # Australia (historical usage) 657 | # India 658 | # You can create your own file in 659 | # share/timezonesets/. 660 | #extra_float_digits = 1 # min -15, max 3; any value >0 actually 661 | # selects precise output mode 662 | #client_encoding = sql_ascii # actually, defaults to database 663 | # encoding 664 | 665 | # These settings are initialized by initdb, but they can be changed. 666 | lc_messages = 'en_US.utf8' # locale for system error message 667 | # strings 668 | lc_monetary = 'en_US.utf8' # locale for monetary formatting 669 | lc_numeric = 'en_US.utf8' # locale for number formatting 670 | lc_time = 'en_US.utf8' # locale for time formatting 671 | 672 | # default configuration for text search 673 | default_text_search_config = 'pg_catalog.english' 674 | 675 | # - Shared Library Preloading - 676 | 677 | #shared_preload_libraries = '' # (change requires restart) 678 | #local_preload_libraries = '' 679 | #session_preload_libraries = '' 680 | #jit_provider = 'llvmjit' # JIT library to use 681 | 682 | # - Other Defaults - 683 | 684 | #dynamic_library_path = '$libdir' 685 | #extension_destdir = '' # prepend path when loading extensions 686 | # and shared objects (added by Debian) 687 | 688 | 689 | #------------------------------------------------------------------------------ 690 | # LOCK MANAGEMENT 691 | #------------------------------------------------------------------------------ 692 | 693 | #deadlock_timeout = 1s 694 | #max_locks_per_transaction = 64 # min 10 695 | # (change requires restart) 696 | #max_pred_locks_per_transaction = 64 # min 10 697 | # (change requires restart) 698 | #max_pred_locks_per_relation = -2 # negative values mean 699 | # (max_pred_locks_per_transaction 700 | # / -max_pred_locks_per_relation) - 1 701 | #max_pred_locks_per_page = 2 # min 0 702 | 703 | 704 | #------------------------------------------------------------------------------ 705 | # VERSION AND PLATFORM COMPATIBILITY 706 | #------------------------------------------------------------------------------ 707 | 708 | # - Previous PostgreSQL Versions - 709 | 710 | #array_nulls = on 711 | #backslash_quote = safe_encoding # on, off, or safe_encoding 712 | #escape_string_warning = on 713 | #lo_compat_privileges = off 714 | #operator_precedence_warning = off 715 | #quote_all_identifiers = off 716 | #standard_conforming_strings = on 717 | #synchronize_seqscans = on 718 | 719 | # - Other Platforms and Clients - 720 | 721 | #transform_null_equals = off 722 | 723 | 724 | #------------------------------------------------------------------------------ 725 | # ERROR HANDLING 726 | #------------------------------------------------------------------------------ 727 | 728 | #exit_on_error = off # terminate session on any error? 729 | #restart_after_crash = on # reinitialize after backend crash? 730 | #data_sync_retry = off # retry or panic on failure to fsync 731 | # data? 732 | # (change requires restart) 733 | 734 | 735 | #------------------------------------------------------------------------------ 736 | # CONFIG FILE INCLUDES 737 | #------------------------------------------------------------------------------ 738 | 739 | # These options allow settings to be loaded from files other than the 740 | # default postgresql.conf. Note that these are directives, not variable 741 | # assignments, so they can usefully be given more than once. 742 | 743 | #include_dir = '...' # include files ending in '.conf' from 744 | # a directory, e.g., 'conf.d' 745 | #include_if_exists = '...' # include file only if it exists 746 | #include = '...' # include file 747 | 748 | 749 | #------------------------------------------------------------------------------ 750 | # CUSTOMIZED OPTIONS 751 | #------------------------------------------------------------------------------ 752 | 753 | # Add settings for extensions here 754 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "right-devops" 2 | -------------------------------------------------------------------------------- /src/main/java/ru/zencode/rightdevops/BaseEntity.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import jakarta.persistence.*; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | import org.hibernate.annotations.GenericGenerator; 7 | 8 | import java.util.Objects; 9 | import java.util.UUID; 10 | 11 | @Getter 12 | @Setter 13 | @MappedSuperclass 14 | public abstract class BaseEntity { 15 | 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid") 18 | @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator") 19 | @Column(name = "id") 20 | private UUID id; 21 | 22 | @Override 23 | public boolean equals(Object o) { 24 | if (this == o) return true; 25 | if (o == null || getClass() != o.getClass()) return false; 26 | BaseEntity that = (BaseEntity) o; 27 | return id != null && Objects.equals(getId(), that.getId()); 28 | } 29 | 30 | @Override 31 | public int hashCode() { 32 | return 13; 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/ru/zencode/rightdevops/Cat.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import jakarta.persistence.Column; 4 | import jakarta.persistence.Entity; 5 | import jakarta.persistence.Table; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter 10 | @Setter 11 | @Entity 12 | @Table(name = "cat") 13 | public class Cat extends BaseEntity { 14 | 15 | @Column(name = "name") 16 | private String name; 17 | 18 | @Column(name = "age") 19 | private Integer age; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/ru/zencode/rightdevops/CatController.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import java.util.List; 8 | 9 | @RequiredArgsConstructor 10 | @RestController 11 | @RequestMapping("/api/v1/cats") 12 | public class CatController { 13 | 14 | private final CatService catService; 15 | 16 | @GetMapping 17 | @ResponseStatus(HttpStatus.OK) 18 | public List getAllCats() { 19 | return catService.getAllCats(); 20 | } 21 | 22 | @PostMapping 23 | @ResponseStatus(HttpStatus.CREATED) 24 | public Cat createCat(@RequestBody Cat cat) { 25 | return catService.createCat(cat); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/ru/zencode/rightdevops/CatRepository.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.UUID; 7 | 8 | @Repository 9 | public interface CatRepository extends JpaRepository { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ru/zencode/rightdevops/CatService.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import java.util.List; 4 | 5 | public interface CatService { 6 | 7 | List getAllCats(); 8 | 9 | Cat createCat(Cat cat); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ru/zencode/rightdevops/CatServiceImpl.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import org.springframework.stereotype.Service; 5 | 6 | import java.util.List; 7 | 8 | @RequiredArgsConstructor 9 | @Service 10 | public class CatServiceImpl implements CatService { 11 | 12 | private final CatRepository catRepository; 13 | 14 | @Override 15 | public List getAllCats() { 16 | return catRepository.findAll(); 17 | } 18 | 19 | @Override 20 | public Cat createCat(Cat cat) { 21 | return catRepository.save(cat); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/ru/zencode/rightdevops/RightDevOpsApplication.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RightDevOpsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RightDevOpsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/application-docker-compose.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=right-devops 2 | 3 | # Hibernate 4 | spring.jpa.show-sql=true 5 | spring.jpa.properties.hibernate.format_sql=true 6 | 7 | #Liquibase 8 | spring.liquibase.change-log=db/changelog/db.changelog-master.xml 9 | 10 | # Spring Data 11 | spring.datasource.url=jdbc:postgresql://postgres:5432/rightdevops 12 | spring.datasource.username=pgadmin 13 | spring.datasource.password=pgadmin 14 | spring.datasource.driver-class-name=org.postgresql.Driver 15 | 16 | spring.sql.init.encoding=UTF-8 17 | spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect 18 | 19 | # Logging 20 | logging.level.org.hibernate.SQL=DEBUG 21 | logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE 22 | 23 | spring.cloud.config.enabled=false -------------------------------------------------------------------------------- /src/main/resources/application-local.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=right-devops 2 | 3 | # Hibernate 4 | spring.jpa.show-sql=true 5 | spring.jpa.properties.hibernate.format_sql=true 6 | 7 | #Liquibase 8 | spring.liquibase.change-log=db/changelog/db.changelog-master.xml 9 | spring.liquibase.enabled=true 10 | 11 | # Spring Data 12 | spring.datasource.url=jdbc:postgresql://localhost:25432/rightdevops 13 | spring.datasource.username=pgadmin 14 | spring.datasource.password=pgadmin 15 | spring.datasource.driver-class-name=org.postgresql.Driver 16 | 17 | spring.sql.init.encoding=UTF-8 18 | spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect 19 | 20 | # Logging 21 | logging.level.org.hibernate.SQL=DEBUG 22 | logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE 23 | 24 | spring.cloud.config.enabled=false 25 | 26 | management.endpoints.web.exposure.include=* 27 | management.endpoint.prometheus.enabled=true 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/db.changelog-master.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/java/ru/zencode/rightdevops/RightDevOpsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package ru.zencode.rightdevops; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | //@SpringBootTest 6 | class RightDevOpsApplicationTests { 7 | 8 | @Test 9 | void contextLoads() { 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /wiremock/__files/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": "test" 3 | } 4 | -------------------------------------------------------------------------------- /wiremock/mappings/test-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "method": "GET", 4 | "url": "/test" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "delayDistribution": { 9 | "type": "lognormal", 10 | "median": 80, 11 | "sigma": 0.4 12 | }, 13 | "bodyFileName": "test.json", 14 | "headers": { 15 | "Content-Type": "application/json" 16 | } 17 | } 18 | } 19 | --------------------------------------------------------------------------------