日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

具有InlfuxDB的Spring Boot和Micrometer第2部分:添加InfluxDB

發(fā)布時間:2023/12/3 javascript 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 具有InlfuxDB的Spring Boot和Micrometer第2部分:添加InfluxDB 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

自從我們添加了基本應(yīng)用程序以來,是時候啟動InfluxDB實例了。

我們將按照之前的教程進(jìn)行操作,并添加一個docker實例。

docker run –rm -p 8086:8086 –name influxdb-本地influxdb

是時候在我們的pom上添加微米InfluxDB依賴項了

< dependencies > ... < dependency > < groupId >org.springframework.boot</ groupId > < artifactId >spring-boot-starter-actuator</ artifactId > </ dependency > < dependency > < groupId >io.micrometer</ groupId > < artifactId >micrometer-core</ artifactId > < version >1.3.2</ version > </ dependency > < dependency > < groupId >io.micrometer</ groupId > < artifactId >micrometer-registry-influx</ artifactId > < version >1.3.2</ version > </ dependency > ... </ dependencies >

是時候通過application.yaml添加配置了

management: metrics: export: influx: enabled: true db: devjobsapi uri: http: / / 127.0 . 0.1 : 8086 endpoints: web: expose: "*"

讓我們啟動應(yīng)用程序并執(zhí)行一些請求。
一段時間后,我們可以檢查數(shù)據(jù)庫和其中包含的數(shù)據(jù)。

docker exec -it influxdb- local influx > SHOW DATABASES; name: databases name ---- _internal devjobsapi > use devjobsapi Using database devjobsapi > SHOW MEASUREMENTS name: measurements name ---- http_server_requests jvm_buffer_count jvm_buffer_memory_used jvm_buffer_total_capacity jvm_classes_loaded jvm_classes_unloaded jvm_gc_live_data_size jvm_gc_max_data_size jvm_gc_memory_allocated jvm_gc_memory_promoted jvm_gc_pause jvm_memory_committed jvm_memory_max jvm_memory_used jvm_threads_daemon jvm_threads_live jvm_threads_peak jvm_threads_states logback_events process_cpu_usage process_files_max process_files_open process_start_time process_uptime system_cpu_count system_cpu_usage system_load_average_1m

太棒了 讓我們檢查訪問的端點(diǎn)。

> SELECT*FROM http_server_requests; name: http_server_requests time count exception mean method metric_type outcome status sum upper uri ---- ----- --------- ---- ------ ----------- ------- ------ --- ----- --- 1582586157093000000 1 None 252.309331 GET histogram SUCCESS 200 252.309331 252.309331 /actuator 1582586157096000000 0 None 0 GET histogram SUCCESS 200 0 2866.531375 /jobs/github/{page}

太棒了! 下一步將是可視化那些指標(biāo)。

翻譯自: https://www.javacodegeeks.com/2020/02/spring-boot-and-micrometer-with-inlfuxdb-part-2-adding-influxdb.html

總結(jié)

以上是生活随笔為你收集整理的具有InlfuxDB的Spring Boot和Micrometer第2部分:添加InfluxDB的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。