|
32 | 32 | <postgresql.version>42.7.7</postgresql.version> |
33 | 33 | <jib-maven-plugin.version>3.4.5</jib-maven-plugin.version> |
34 | 34 | <testcontainers.version>1.21.1</testcontainers.version> |
| 35 | + <loki-logback-appender.version>1.5.2</loki-logback-appender.version> |
35 | 36 | </properties> |
36 | 37 | <dependencies> |
37 | 38 | <dependency> |
|
81 | 82 | <artifactId>liquibase-core</artifactId> |
82 | 83 | </dependency> |
83 | 84 |
|
| 85 | + <!-- Observability --> |
| 86 | + |
| 87 | + <!-- Metrics--> |
| 88 | + <dependency> |
| 89 | + <groupId>org.springframework.boot</groupId> |
| 90 | + <artifactId>spring-boot-starter-actuator</artifactId> |
| 91 | + </dependency> |
| 92 | + <dependency> |
| 93 | + <groupId>io.micrometer</groupId> |
| 94 | + <artifactId>micrometer-registry-prometheus</artifactId> |
| 95 | + <scope>runtime</scope> |
| 96 | + </dependency> |
| 97 | + |
| 98 | + <!-- Tracing --> |
| 99 | +<!-- <dependency>--> |
| 100 | +<!-- <groupId>io.micrometer</groupId>--> |
| 101 | +<!-- <artifactId>micrometer-tracing-bridge-brave</artifactId>--> |
| 102 | +<!-- </dependency>--> |
| 103 | +<!-- <dependency>--> |
| 104 | +<!-- <groupId>io.zipkin.reporter2</groupId>--> |
| 105 | +<!-- <artifactId>zipkin-reporter-brave</artifactId>--> |
| 106 | +<!-- </dependency>--> |
| 107 | + |
| 108 | + <!-- Logging (Loki) --> |
| 109 | +<!-- <dependency>--> |
| 110 | +<!-- <groupId>com.github.loki4j</groupId>--> |
| 111 | +<!-- <artifactId>loki-logback-appender</artifactId>--> |
| 112 | +<!-- <version>${loki-logback-appender.version}</version>--> |
| 113 | +<!-- </dependency>--> |
| 114 | + |
84 | 115 | <!-- Test dependencies --> |
85 | 116 | <dependency> |
86 | 117 | <groupId>org.testcontainers</groupId> |
|
124 | 155 | <groupId>org.springframework.boot</groupId> |
125 | 156 | <artifactId>spring-boot-maven-plugin</artifactId> |
126 | 157 | </plugin> |
| 158 | + <plugin> |
| 159 | + <groupId>org.apache.maven.plugins</groupId> |
| 160 | + <artifactId>maven-dependency-plugin</artifactId> |
| 161 | + <executions> |
| 162 | + <execution> |
| 163 | + <id>download-otel-agent</id> |
| 164 | + <phase>compile</phase> |
| 165 | + <goals> |
| 166 | + <goal>copy</goal> |
| 167 | + </goals> |
| 168 | + <configuration> |
| 169 | + <artifactItems> |
| 170 | + <artifactItem> |
| 171 | + <groupId>software.amazon.opentelemetry</groupId> |
| 172 | + <artifactId>aws-opentelemetry-agent</artifactId> |
| 173 | + <version>1.32.5</version> |
| 174 | + <type>jar</type> |
| 175 | + <outputDirectory>${project.build.directory}/agents</outputDirectory> |
| 176 | + <destFileName>aws-opentelemetry-agent.jar</destFileName> |
| 177 | + </artifactItem> |
| 178 | + </artifactItems> |
| 179 | + </configuration> |
| 180 | + </execution> |
| 181 | + </executions> |
| 182 | + </plugin> |
127 | 183 | <plugin> |
128 | 184 | <groupId>com.google.cloud.tools</groupId> |
129 | 185 | <artifactId>jib-maven-plugin</artifactId> |
130 | 186 | <version>${jib-maven-plugin.version}</version> |
| 187 | + <configuration> |
| 188 | + <container> |
| 189 | + <jvmFlags> |
| 190 | + <jvmFlag>-javaagent:/app/aws-opentelemetry-agent.jar</jvmFlag> |
| 191 | + <jvmFlag>-Dotel.traces.exporter=otlp</jvmFlag> |
| 192 | + <jvmFlag>-Dotel.exporter.otlp.endpoint=http://aws-otel-collector:4318</jvmFlag> |
| 193 | + <jvmFlag>-Dotel.exporter.otlp.protocol=http/protobuf</jvmFlag> |
| 194 | + <jvmFlag>-Dotel.service.name=springboot-ai-agent</jvmFlag> |
| 195 | + <jvmFlag>-Dotel.metrics.exporter=none</jvmFlag> |
| 196 | + <jvmFlag>-Dotel.logs.exporter=none</jvmFlag> |
| 197 | + </jvmFlags> |
| 198 | + </container> |
| 199 | + <extraDirectories> |
| 200 | + <paths> |
| 201 | + <path> |
| 202 | + <from>${project.build.directory}/agents</from> |
| 203 | + <into>/app</into> |
| 204 | + </path> |
| 205 | + </paths> |
| 206 | + </extraDirectories> |
| 207 | + </configuration> |
131 | 208 | </plugin> |
132 | 209 | </plugins> |
133 | 210 | </build> |
|
0 commit comments