System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) · 课时

信号与语义约定

学习 OpenTelemetry 的三种信号,了解它们如何共享资源和上下文,以及语义约定为何能让遥测数据跨工具移植。

第 4 / 4 课13 个步骤

信号与语义约定 是 CoddyKit 上的免费 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课时。 这是第 4 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

The Three Signals

OpenTelemetry defines three signals of telemetry: traces, metrics, and logs. One specification and SDK produce all three in a consistent way.

Traces

Traces capture the path of a request across services as a tree of spans, answering where time went and what failed.

span: GET /checkout
  span: query inventory
  span: charge payment

Metrics

Metrics are numeric measurements aggregated over time: counters, gauges, and histograms that answer how much and how often.

http.server.duration histogram
http.server.active_requests gauge

Logs

Logs are timestamped records of discrete events. In OTel they can be correlated with traces by carrying the same trace and span IDs.

{ "body": "order placed", "trace_id": "a9f...c1" }

The Resource

A Resource describes the entity producing telemetry, such as a service or host. It is attached to all three signals so they share identity.

resource:
  service.name: checkout
  service.version: 1.4.0

Shared Context

All signals can carry the same context. A log and a metric exemplar can point back to the trace that produced them, enabling correlation.

What Are Semantic Conventions?

Semantic conventions are agreed names for common attributes. Everyone uses http.request.method instead of inventing their own key.

Why Conventions Matter

Standard names let any backend understand your data. Dashboards, alerts, and tools work out of the box because the keys are predictable.

  • Portability across vendors
  • Reusable dashboards
  • Automatic correlation

Common Attribute Examples

Conventions cover HTTP, databases, messaging, and more.

http.request.method = "GET"
http.response.status_code = 200
db.system = "postgresql"

Resource vs Span Attributes

Resource attributes describe the producer and rarely change. Span attributes describe a single operation and vary per request.

resource: service.name (static)
span: http.route, user.tier (per request)

Signals Together

Combining the three signals with shared resources and conventions gives full observability: metrics show what is wrong, traces show where, and logs show why.

Quick Check

Identify the purpose of semantic conventions.

Recap

You learned the three OTel signals (traces, metrics, logs), how a shared Resource and context tie them together, and how semantic conventions standardize attribute names for portability and correlation across any backend.

免费开始

用 AI 导师学习 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) — 免费

在浏览器中编写并运行真实代码,获得全天候 AI 导师的即时帮助,并在网页或应用中继续学习。

课程
12
课程
48

常见问题解答

「信号与语义约定」课时是免费的吗?

是的 — 「信号与语义约定」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程的其余内容,请升级到 CoddyKit PRO。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程共包含 4 节课。

「信号与语义约定」这节课中我会学到什么?

学习 OpenTelemetry 的三种信号,了解它们如何共享资源和上下文,以及语义约定为何能让遥测数据跨工具移植。 你通过在浏览器中直接运行的动手代码来练习 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry),全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 需要有经验吗?

无需任何先前经验。CoddyKit 上的 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 4 节课,共 4 节。

「信号与语义约定」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课中编写并运行代码吗?

能。每节 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. OpenTelemetry 标准
  2. OTel 收集器与导出器
  3. 使用 OTel SDK 为应用添加检测
  4. 信号与语义约定
← 返回 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)