Skip to content

Commit

Permalink
monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sqshq committed Mar 28, 2016
1 parent 5e260b5 commit d95acb4
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 3 deletions.
13 changes: 12 additions & 1 deletion account-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,18 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-hystrix-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.security.oauth2.client.feign.OAuth2FeignRequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -30,6 +31,7 @@
@EnableFeignClients
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableConfigurationProperties
@EnableHystrix
@Configuration
public class AccountApplication extends ResourceServerConfigurerAdapter {

Expand Down
4 changes: 4 additions & 0 deletions config/src/main/resources/shared/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ security:
oauth2:
resource:
user-info-uri: http://auth-service:5000/uaa/users/current

spring:
rabbitmq:
host: rabbitmq
Empty file.
10 changes: 9 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: '2'
services:
rabbitmq:
ports:
- 5672:5672
- 15672:15672

config:
build: config
ports:
Expand Down Expand Up @@ -49,4 +54,7 @@ services:
notification-mongodb:
build: mongodb
ports:
- 28000:27017
- 28000:27017

monitoring:
build: monitoring
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
version: '2'
services:
rabbitmq:
image: rabbitmq:3-management
restart: always
logging:
options:
max-size: "10m"
max-file: "10"

config:
environment:
CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD
Expand Down Expand Up @@ -124,3 +132,16 @@ services:
options:
max-size: "10m"
max-file: "10"

monitoring:
environment:
CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD
image: sqshq/piggymetrics-monitoring
restart: always
ports:
- 8989:8989
- 9000:8080
logging:
options:
max-size: "10m"
max-file: "10"
7 changes: 7 additions & 0 deletions monitoring/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM java:8-jre
MAINTAINER Alexander Lukyanchikov <sqshq@sqshq.com>

ADD ./target/monitoring.jar /app/
CMD ["java", "-jar", "/app/monitoring.jar"]

EXPOSE 8989 8080
84 changes: 84 additions & 0 deletions monitoring/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.piggymetrics</groupId>
<artifactId>monitoring</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>monitoring</name>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.M4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>${project.name}</finalName>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.piggymetrics.monitoring;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.turbine.stream.EnableTurbineStream;

@SpringBootApplication
@EnableDiscoveryClient
@EnableTurbineStream
@EnableHystrixDashboard
public class MonitoringApplication {

public static void main(String[] args) {
SpringApplication.run(MonitoringApplication.class, args);
}
}
11 changes: 11 additions & 0 deletions monitoring/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
spring:
application:
name: monitoring
cloud:
config:
uri: http://config:8888
fail-fast: true
password: ${CONFIG_SERVICE_PASSWORD}
username: user
rabbitmq:
host: rabbitmq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.piggymetrics.monitoring;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = MonitoringApplication.class)
public class MonitoringApplicationTests {

@Test
public void contextLoads() {
}

}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<modules>
<module>config</module>
<module>monitoring</module>
<module>registry</module>
<module>gateway</module>
<module>auth-service</module>
Expand Down
1 change: 0 additions & 1 deletion registry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<packaging>jar</packaging>

<name>registry</name>
<description></description>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down

0 comments on commit d95acb4

Please sign in to comment.