Spring cloud atlas uses

  springcloud

Run atlas1.4.7

Download address

curl -Lo memory.conf https://raw.githubusercontent.com/Netflix/atlas/master/conf/memory.conf
java -jar atlas-1.4.7-standalone.jarmemory.conf

Or use 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"]

run

docker build -t atlas:1.4.7 .
docker run --name atlas --rm -p 7101:7101  atlas:1.4.7

Accesshttp://192.168.99.100:7101/ap …Check whether the service starts normally

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 configuration

@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 service address configuration

netflix:
  atlas:
    uri: http://192.168.99.100:7101/api/v1/publish/

Altas query

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

Screenshots

  • jvm.gc.allocationRate
    图片描述

  • jvm.gc.promotionRate
    图片描述

  • jvm.memory.used
    图片描述

  • jvm.gc.pause
    图片描述

doc