Skip to content

Commit

Permalink
Update code to clean up unused resources and optimize the configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Loi Nguyen Xuan committed Oct 10, 2023
1 parent 1869a60 commit 0dbe653
Show file tree
Hide file tree
Showing 13 changed files with 3,379 additions and 2,799 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ OTEL_METRICS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_INSECURE=true
OTEL_JAVAAGENT_LOGGING=application
OTEL_JAVAAGENT_ENABLED=true
OTEL_JAVAAGENT_DEBUG=true
OTEL_JAVAAGENT_DEBUG=false
OTEL_INSTRUMENTATION_MESSAGING_EXPERIMENTAL_RECEIVE_TELEMETRY_ENABLED=true
# OpenTelemetry Resource Definitions
OTEL_RESOURCE_ATTRIBUTES="service.namespace=yas-msa"

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.project
.settings
.settings*
.project
.vscode
10 changes: 7 additions & 3 deletions deployment/app-config/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<include
resource="org/springframework/boot/logging/logback/console-appender.xml" />
<!-- Define own appender to be used in the logger to append the data into -->
<!-- <appender name="CONSOLE"
<appender name="JSON_APPENDER"
class="ch.qos.logback.core.ConsoleAppender">
<Target>${user-system}.out</Target>
<encoder
Expand Down Expand Up @@ -40,8 +40,12 @@
</providers>
</encoder>
</appender>
-->

<appender name="OTEL" class="io.opentelemetry.instrumentation.logback.mdc.v1_0.OpenTelemetryAppender">
<captureExperimentalAttributes>true</captureExperimentalAttributes>
<captureMdcAttributes>*</captureMdcAttributes>
<appender-ref ref="JSON_APPENDER" />
</appender>
<!-- This appender is to define the log to console that human friendly on
dev machine -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
Expand All @@ -53,6 +57,6 @@
name="org.springframework.web.filter.CommonsRequestLoggingFilter"
level="DEBUG" />
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="OTEL" />
</root>
</configuration>
5 changes: 3 additions & 2 deletions docker-compose.o11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ services:
- yas-network
prometheus:
image: prom/prometheus:v2.42.0
container_name: prometheus
hostname: ${PROMETHEUS_SERVICE_HOST}
container_name: prometheus
command:
- --web.console.templates=/etc/prometheus/consoles
- --web.console.libraries=/etc/prometheus/console_libraries
Expand All @@ -55,7 +56,7 @@ services:
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- "9090:9090"
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
healthcheck:
interval: 5s
retries: 10
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ services:
- OTEL_JAVAAGENT_LOGGING
- OTEL_JAVAAGENT_ENABLED
- OTEL_JAVAAGENT_DEBUG
- OTEL_INSTRUMENTATION_MESSAGING_EXPERIMENTAL_RECEIVE_TELEMETRY_ENABLED
- OTEL.INSTRUMENTATION.LOGBACK-MDC.ADD-BAGGAGE=true
volumes:
- ./docker/libs/opentelemetry-javaagent_1.30.0.jar:/opentelemetry-javaagent.jar
- ./deployment/app-config:/app-config
Expand Down
Loading

0 comments on commit 0dbe653

Please sign in to comment.