- 将instrumentation-example导入Eclipse IDE
- Review代码理解模拟任务系统原理和埋点方式
- 以Spring Boot方式运行埋点案例
- 通过
http://localhost:8080/prometheus
查看metrics
添加针对instrumentation-example
的监控job
- job_name: 'instrumentation-example'
metrics_path: /prometheus
static_configs:
- targets: ['localhost:8080']
运行Prometheus
./prometheus.exe
通过Prometheus->Status
的configuration
和targets
校验配置正确
查询instrumentation-example
在UP1状态
up{job="instrumentation-example"}
运行queueUpJobs.sh产生100个job
./queueUpJobs.sh
查询JobQueueSize变化曲线(调整时间范围到5m):
job_queue_size{job="instrumentation-example"}
查询90分位Job执行延迟分布:
histogram_quantile(0.90, rate(jobs_completion_duration_seconds_bucket{job="instrumentation-example"}[5m]))