docker-compose
Код: Выделить всё
# https://www.jaegertracing.io/docs/2.2/getting-started/
jaeger:
image: jaegertracing/jaeger:2.2.0
container_name: jaeger
ports:
- "16686:16686" # the jaeger UI
- "4317:4317" # the OpenTelemetry collector grpc
environment:
- COLLECTOR_OTLP_ENABLED=true
networks:
- lab-monitoring-network
restart: always
Код: Выделить всё
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.3'
implementation "io.micrometer:micrometer-core"
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'io.opentelemetry:opentelemetry-exporter-otlp'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
Код: Выделить всё
spring:
application:
name: ms-spring-product-api
datasource:
url: jdbc:postgresql://localhost:5432/db_system
username: postgres
password: 123456
driver-class-name: org.postgresql.Driver
hikari:
maximum-pool-size: 10
minimum-idle: 5
jpa:
hibernate:
ddl-auto: update
show-sql: true
database-platform: org.hibernate.dialect.PostgreSQLDialect
logging:
level:
org.springframework.web: TRACE
io.opentelemetry: TRACE
management:
tracing:
sampling:
probability: 1.0
tracing:
url: http://localhost:4317
< /code>
Конфигурация класса < /p>
package br.com.ciceroednilson.configuration;
import io.opentelemetry.context.propagation.TextMapPropagator;
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
import io.opentelemetry.extension.trace.propagation.JaegerPropagator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class OpenTelemetryConfiguration {
@Bean
public OtlpGrpcSpanExporter otlpHttpSpanExporter(@Value("${tracing.url}") String url) {
return OtlpGrpcSpanExporter.builder().setEndpoint(url).build();
}
@Bean
public TextMapPropagator jaegerPropagator() {
return JaegerPropagator.getInstance();
}
}`
(https://i.sstatic.net/pzq7kjPf.png)
показать первый уровень
`
Я пытаюсь увидеть след приложения, но не вижу все уровни трассировки.`
Подробнее здесь: https://stackoverflow.com/questions/793 ... e-jaeger-u