二、技术文档/其他/容器服务平台-操作手册/搭建与使用遥测系统.md updated
This commit is contained in:
parent
abcb352ef6
commit
b19184987a
@ -173,6 +173,7 @@ overrides:
|
|||||||
|
|
||||||
loki配置文件:
|
loki配置文件:
|
||||||
|
|
||||||
|
```yml
|
||||||
# For more information on this configuration, see the complete reference guide at
|
# For more information on this configuration, see the complete reference guide at
|
||||||
# https://grafana.com/docs/loki/latest/configure/
|
# https://grafana.com/docs/loki/latest/configure/
|
||||||
|
|
||||||
@ -213,9 +214,11 @@ schema_config:
|
|||||||
|
|
||||||
ruler:
|
ruler:
|
||||||
alertmanager_url: http://localhost:9093
|
alertmanager_url: http://localhost:9093
|
||||||
|
```
|
||||||
|
|
||||||
prometheus配置文件:
|
prometheus配置文件:
|
||||||
|
|
||||||
|
```yml
|
||||||
# For more information on this configuration, see the complete reference guide at
|
# For more information on this configuration, see the complete reference guide at
|
||||||
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/
|
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/
|
||||||
|
|
||||||
@ -226,9 +229,11 @@ scrape_configs:
|
|||||||
- job_name: aggregated-trace-metrics
|
- job_name: aggregated-trace-metrics
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['otel:8889']
|
- targets: ['otel:8889']
|
||||||
|
```
|
||||||
|
|
||||||
opentelemetry collector配置文件:
|
opentelemetry collector配置文件:
|
||||||
|
|
||||||
|
```yml
|
||||||
# For more information on this configuration, see the complete reference guide at
|
# For more information on this configuration, see the complete reference guide at
|
||||||
# https://opentelemetry.io/docs/collector/configuration/
|
# https://opentelemetry.io/docs/collector/configuration/
|
||||||
|
|
||||||
@ -277,11 +282,13 @@ service:
|
|||||||
metrics/spanmetrics:
|
metrics/spanmetrics:
|
||||||
receivers: [spanmetrics]
|
receivers: [spanmetrics]
|
||||||
exporters: [debug, prometheus]
|
exporters: [debug, prometheus]
|
||||||
|
```
|
||||||
|
|
||||||
# **后端服务收集遥测数据**
|
# **后端服务收集遥测数据**
|
||||||
|
|
||||||
分别下载 [opentelemetry-javaagent.jar](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar) 和 [ot-java-agent-extension-1.28.0.jar](https://github.com/alibabacloud-observability/opentelemetry-best-practice/raw/main/opentelemetry-javaagent-extension/ot-java-agent-extension-1.28.0.jar) 放在 /opt/agent 目录。然后用以下命令启动应用:
|
分别下载 [opentelemetry-javaagent.jar](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar) 和 [ot-java-agent-extension-1.28.0.jar](https://github.com/alibabacloud-observability/opentelemetry-best-practice/raw/main/opentelemetry-javaagent-extension/ot-java-agent-extension-1.28.0.jar) 放在 /opt/agent 目录。然后用以下命令启动应用:
|
||||||
|
|
||||||
|
```shell
|
||||||
# For more information on this configuration, see the complete reference guide at
|
# For more information on this configuration, see the complete reference guide at
|
||||||
# https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure
|
# https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure
|
||||||
|
|
||||||
@ -291,9 +298,11 @@ java -javaagent:/opt/agent/opentelemetry-javaagent.jar \
|
|||||||
-Dotel.service.name=xxx \
|
-Dotel.service.name=xxx \
|
||||||
-Dotel.logs.exporter=otlp \
|
-Dotel.logs.exporter=otlp \
|
||||||
-jar xxx.jar
|
-jar xxx.jar
|
||||||
|
```
|
||||||
|
|
||||||
opentelemetry-javaagent 会对一些库自动记录 Span,如果想要追加一些 Span 以便更精细地追踪,则需要通过注解来控制:
|
opentelemetry-javaagent 会对一些库自动记录 Span,如果想要追加一些 Span 以便更精细地追踪,则需要通过注解来控制:
|
||||||
|
|
||||||
|
```xm
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.opentelemetry.instrumentation</groupId>
|
<groupId>io.opentelemetry.instrumentation</groupId>
|
||||||
@ -336,5 +345,5 @@ public class MyClass {
|
|||||||
|
|
||||||

|

|
||||||
<!--stackedit_data:
|
<!--stackedit_data:
|
||||||
eyJoaXN0b3J5IjpbLTUwNzcwMjcwMV19
|
eyJoaXN0b3J5IjpbMTUxNzEzMjcxNF19
|
||||||
-->
|
-->
|
Loading…
x
Reference in New Issue
Block a user