Skip to content

Commit

Permalink
Update grafana/prometheus scripts to latest docker tags, move Spring …
Browse files Browse the repository at this point in the history
…integration sample to its own sample project
  • Loading branch information
Jon Schneider committed Apr 15, 2020
1 parent 4c22298 commit 259f23b
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 37 deletions.
9 changes: 1 addition & 8 deletions samples/micrometer-samples-boot2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ plugins {

dependencyManagement {
imports {
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.2.0.RELEASE'
}
dependencies {
// not necessary in real Boot 1.5.x apps because reactor is shaded inside the
// published version of micrometer-registry-statsd
dependency 'io.projectreactor:reactor-core:3.2.2.RELEASE'
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.2.6.RELEASE'
}
}

Expand All @@ -23,8 +18,6 @@ dependencies {
implementation('org.springframework.boot:spring-boot-starter-actuator') {
exclude group: 'io.micrometer', module: 'micrometer-core'
}
implementation 'org.springframework.integration:spring-integration-ws'
implementation 'org.springframework.integration:spring-integration-xml'

// For running on Java 9+
runtimeOnly 'javax.xml.soap:javax.xml.soap-api:1.4.0'
Expand Down
25 changes: 25 additions & 0 deletions samples/micrometer-samples-spring-integration/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
id "io.spring.dependency-management" version "1.0.3.RELEASE"
}

dependencyManagement {
imports {
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.2.6.RELEASE'
}
}

dependencies {
implementation project(":micrometer-core")
implementation project(":micrometer-registry-prometheus")

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation('org.springframework.boot:spring-boot-starter-actuator') {
exclude group: 'io.micrometer', module: 'micrometer-core'
}
implementation 'org.springframework.integration:spring-integration-ws'
implementation 'org.springframework.integration:spring-integration-xml'

// For running on Java 9+
runtimeOnly 'javax.xml.soap:javax.xml.soap-api:1.4.0'
runtimeOnly 'com.sun.xml.messaging.saaj:saaj-impl:1.5.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.micrometer.boot2.samples.integration;
package io.micrometer.spring.integration.samples;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
8 changes: 8 additions & 0 deletions scripts/grafana-datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: 1

datasources:
- name: prometheus
type: prometheus
access: direct
url: http://10.200.10.1:9090
isDefault: true
6 changes: 4 additions & 2 deletions scripts/grafana.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/usr/bin/env bash
docker run -i -p 3001:3000 grafana/grafana:5.1.0
#!/bin/sh
docker run -i -p 3000:3000 \
-v $(pwd)/grafana-datasource.yml:/etc/grafana/provisioning/datasources/grafana-datasource.yml \
grafana/grafana:6.7.2
3 changes: 1 addition & 2 deletions scripts/prometheus.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
docker run -p 9090:9090 \
-v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
-v $(pwd)/prometheus_rules.yml:/etc/prometheus/prometheus_rules.yml \
prom/prometheus:v2.2.0
prom/prometheus:v2.17.1
16 changes: 1 addition & 15 deletions scripts/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,11 @@ scrape_configs:
static_configs:
- targets: ['localhost:9090']

- job_name: 'pushgateway'

scrape_interval: 10s
metrics_path: '/metrics'
honor_labels: true
static_configs:
- targets: ['10.200.10.1:9091']

- job_name: 'spring-boot1'

metrics_path: '/prometheus'
static_configs:
- targets: ['10.200.10.1:8080']

- job_name: 'spring-boot2'

metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['10.200.10.1:8080']

rule_files:
- prometheus_rules.yml
- prometheus_rules.yml
8 changes: 0 additions & 8 deletions scripts/prometheus_rules.yml

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rootProject.name = 'micrometer'
include 'micrometer-core'
include 'micrometer-jersey2'

['core', 'boot2'].each { sample ->
['core', 'boot2', 'spring-integration'].each { sample ->
include "micrometer-samples-$sample"
project(":micrometer-samples-$sample").projectDir = new File(rootProject.projectDir, "samples/micrometer-samples-$sample")
}
Expand Down

0 comments on commit 259f23b

Please sign in to comment.