运行atlas1.4.7
curl -Lo memory.conf https://raw.githubusercontent.com/Netflix/atlas/master/conf/memory.conf
java -jar atlas-1.4.7-standalone.jarmemory.conf
或者使用docker
FROM netflixoss/java:8
MAINTAINER Netflix Open Source Development <talent@netflix.com>
RUN apt-get -qq update &&\
apt-get -qq -y install ca-certificates &&\
mkdir -p /apps/atlas &&\
wget -q -P /apps/atlas 'https://github.com/Netflix/atlas/releases/download/v1.4.7/atlas-1.4.7-standalone.jar'
ADD ./memory.conf /apps/atlas/memory.conf
EXPOSE 7101
ENTRYPOINT ["/usr/bin/java", "-jar", "/apps/atlas/atlas-1.4.7-standalone.jar","/apps/atlas/memory.conf"]
CMD ["run"]
运行
docker build -t atlas:1.4.7 .
docker run --name atlas --rm -p 7101:7101 atlas:1.4.7
访问http://192.168.99.100:7101/ap...检查服务是否正常启动
maven
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-spectator</artifactId>
</dependency>
<dependency>
<groupId>com.netflix.spectator</groupId>
<artifactId>spectator-ext-jvm</artifactId>
<version>0.40.0</version>
</dependency>
<dependency>
<groupId>com.netflix.spectator</groupId>
<artifactId>spectator-ext-gc</artifactId>
<version>0.51.0</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-atlas</artifactId>
</dependency>
java配置
@EnableAtlas
@Configuration
public class AtlasTagProviderConfigration {
@Bean
AtlasTagProvider atlasCommonTags(@Value("${spring.application.name}") String appName) {
return () -> Collections.singletonMap("app", appName);
}
@Bean
public CommandLineRunner registerExtMetrics(Registry registry) {
return new CommandLineRunner() {
@Override
public void run(String... strings) throws Exception {
Jmx.registerStandardMXBeans(registry);
Spectator.globalRegistry().add(registry);
GcLogger gc = new GcLogger();
gc.start(null);
}
};
}
}
altas服务地址配置
netflix:
atlas:
uri: http://192.168.99.100:7101/api/v1/publish/
altas查询
Stack-Language
http://192.168.99.100:7101/api/v1/graph?q=app,review,:eq,statistic,count,:eq,:and&tz=Asia/Shanghai
http://192.168.99.100:7101/api/v1/graph?q=app,review,:eq,name,jvm.memory.used,:eq,:and&tz=Asia/Shanghai
http://192.168.99.100:7101/api/v1/graph?q=app,review,:eq,name,jvm.gc.promotionRate,:eq,:and&tz=Asia/Shanghai
http://192.168.99.100:7101/api/v1/graph?q=app,review,:eq,name,jvm.gc.liveDataSize,:eq,:and&tz=Asia/Shanghai
http://192.168.99.100:7101/api/v1/graph?q=app,review,:eq,name,jvm.gc.pause,:eq,:and&tz=Asia/Shanghai
http://192.168.99.100:7101/api/v1/graph?q=app,review,:eq,name,jvm.gc.allocationRate,:eq,:and&tz=Asia/Shanghai
http://192.168.99.100:7101/api/v1/graph?q=app,review,:eq,name,jvm.gc.pause,:eq,statistic,count,:eq,:and,:and&tz=Asia/Shanghai
截图
jvm.gc.allocationRate
jvm.gc.promotionRate
jvm.memory.used
jvm.gc.pause
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。