-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
115 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ pom.xml.asc | |
/logs | ||
/keystore.jks | ||
/.envrc | ||
/.envrc-docker | ||
/opentelemetry-javaagent.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
FROM clojure:temurin-11-lein-2.9.10-alpine as builder | ||
FROM clojure:temurin-17-lein-jammy as builder | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
COPY . /app/ | ||
RUN lein uberjar | ||
|
||
FROM gcr.io/distroless/java:11 | ||
COPY --from=builder /app/target/eduhub-rio-mapper.jar /eduhub-rio-mapper.jar | ||
# FROM gcr.io/distroless/java:11 | ||
# COPY --from=builder /app/target/eduhub-rio-mapper.jar /eduhub-rio-mapper.jar | ||
# COPY --from=builder /app/opentelemetry-javaagent.jar /opentelemetry-javaagent.jar | ||
|
||
ENTRYPOINT ["java", "-jar", "/eduhub-rio-mapper.jar"] | ||
ENTRYPOINT ["java", "-jar", "/app/target/eduhub-rio-mapper.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.PHONY: lint test check clean | ||
|
||
lint: | ||
clojure -M:lint | ||
|
||
test: | ||
clojure -M:test | ||
|
||
check: lint test | ||
|
||
clean: | ||
rm -rf classes target | ||
|
||
opentelemetry-javaagent.jar: | ||
curl -L https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar -o $@ | ||
|
||
.PHONY: docker-build test lint check | ||
|
||
docker-build: Dockerfile docker-compose.yml opentelemetry-javaagent.jar | ||
docker-compose build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# my global config | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 30s | ||
# scrape_timeout is set to the global default (10s). | ||
|
||
external_labels: | ||
monitor: codelab | ||
foo: bar | ||
|
||
#rule_files: | ||
# - "first.rules" | ||
# - "my/*.rules" | ||
|
||
scrape_configs: | ||
- job_name: scrape-static | ||
|
||
honor_labels: true | ||
# scrape_interval is defined by the configured global (15s). | ||
# scrape_timeout is defined by the global default (10s). | ||
|
||
# metrics_path defaults to '/metrics' | ||
# scheme defaults to 'http'. | ||
scheme: http | ||
|
||
static_configs: | ||
- targets: ["localhost:9090"] | ||
labels: | ||
service: prometheus | ||
# - targets: ["host.docker.internal:8080"] | ||
# labels: | ||
# service: eduhub-gateway | ||
- targets: ["worker:9464"] | ||
labels: | ||
service: worker | ||
- targets: ["api:3000"] | ||
labels: | ||
service: api | ||
- targets: ["api:9464"] | ||
labels: | ||
service: api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
services: | ||
redis: | ||
image: redis:7-alpine | ||
restart: always | ||
ports: | ||
- '6380:6379' | ||
command: redis-server --save 20 1 --loglevel warning | ||
volumes: | ||
- redis:/data | ||
prometheus: | ||
image: prom/prometheus | ||
ports: | ||
- "9090:9090" | ||
volumes: | ||
- ./dev-infra/prometheus.yml:/etc/prometheus/prometheus.yml | ||
worker: | ||
image: edumapper | ||
env_file: | ||
- .envrc-docker # read environment from local direnv settings | ||
environment: | ||
OTEL_METRICS_EXPORTER: prometheus | ||
OTEL_EXPORTER_PROMETHEUS_ENDPOINT: http://localhost:9464/metrics | ||
OTEL_SERVICE_NAME: edumapper-worker | ||
OTEL_LOGS_EXPORTER: none | ||
OTEL_TRACES_EXPORTER: none | ||
JAVA_TOOL_OPTIONS: -javaagent:./opentelemetry-javaagent.jar | ||
command: worker | ||
ports: | ||
- "9465:9464" | ||
api: | ||
image: edumapper | ||
env_file: | ||
- .envrc-docker # read environment from local direnv settings | ||
environment: | ||
OTEL_METRICS_EXPORTER: prometheus | ||
OTEL_EXPORTER_PROMETHEUS_ENDPOINT: http://localhost:9464/metrics | ||
OTEL_SERVICE_NAME: edumapper-api | ||
OTEL_LOGS_EXPORTER: none | ||
OTEL_TRACES_EXPORTER: none | ||
JAVA_TOOL_OPTIONS: -javaagent:./opentelemetry-javaagent.jar | ||
ports: | ||
- "3000:3000" | ||
- "9464:9464" | ||
command: serve-api | ||
volumes: | ||
redis: | ||
driver: local |