Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #47 from E-Edu/issue/44
Browse files Browse the repository at this point in the history
Implemented InfluxDB metrics
  • Loading branch information
steve-hb authored Apr 3, 2020
2 parents c6b223e + 2e77533 commit f1fa908
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ dependencies {
implementation ('io.sentry:sentry-log4j2:1.7.30') {
exclude group: "org.apache.logging.log4j"
}
compile 'io.micrometer:micrometer-core:1.4.0'
compile 'io.micrometer:micrometer-registry-influx:1.4.0'

/* GraphQL */
implementation 'com.graphql-java-kickstart:graphql-spring-boot-starter:7.0.0'
implementation 'com.graphql-java:graphql-java-tools:5.2.4'
compile group: 'com.graphql-java-kickstart', name: 'playground-spring-boot-starter', version: '7.0.0'
compile 'com.careykevin:graphql-actuator:0.0.3'

/* Spring */
implementation (group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: '2.2.6.RELEASE') {
exclude group: "commons-logging", module: "commons-logging"
exclude module: "spring-boot-starter-logging"
}

implementation ('org.springframework.boot:spring-boot-starter') {
exclude group: "commons-logging", module: "commons-logging"
exclude module: "spring-boot-starter-logging"
Expand Down
22 changes: 20 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Please fill out with content

version: '3.6'

services:
influxdb:
image: influxdb:latest
ports:
- "8086:8086"

gateway_grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
user: "0"
links:
- influxdb
volumes:
- /srv/docker/grafana/data:/var/lib/grafana

gateway:
image: eedu/gateway
container_name: eedu-gateway
Expand All @@ -13,3 +26,8 @@ services:
SERVICE_SECRET: SECRET
PRODUCTIVE: "false"
SENTRY_ENABLED: "${SENTRY_ENABLED}"
INFLUX_URI: "http://influxdb:8086"
INFLUX_USERNAME: 0
INFLUX_PASSWORD: ""
INFLUX_DB: "gateway"
INFLUX_STEP: "1m"
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.themorpheus.edu.gateway;

import de.themorpheus.edu.gateway.util.GitInfo;
import com.careykevin.graphql.actuator.instrumentation.EnableGraphQLActuator;
import com.jcabi.manifests.Manifests;
import io.sentry.Sentry;
import io.sentry.SentryClient;
Expand All @@ -13,6 +14,7 @@
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.io.IOException;

@EnableGraphQLActuator
@SpringBootApplication
public class GatewayApplication {

Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
security.basic.enable=false
server.port=80
graphql.playground.settings.request.credentials=Same-Origin
management.metrics.export.influx.db=${INFLUX_DB}
management.metrics.export.influx.username=${INFLUX_USERNAME}
management.metrics.export.influx.password=${INFLUX_PASSWORD}
management.metrics.export.influx.step=${INFLUX_STEP}
management.metrics.export.influx.uri=${INFLUX_URI}
management.metrics.web.server.auto-time-request=true
2 changes: 2 additions & 0 deletions src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<Logger name="com.jcabi.manifests" level="warn"/>
<Logger name="io.sentry" level="warn"/>
<Logger name="graphql.execution" level="warn"/>
<Logger name="graphql.GraphQL" level="warn"/>
<Logger name="notprivacysafe.graphql" level="warn"/>
<Logger name="io.micrometer.influx" level="warn"/>
</Loggers>
</Configuration>

0 comments on commit f1fa908

Please sign in to comment.