telemetry/providers: set service.instance.id on the OTel resource so replicas stay distinct
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 66/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go
調査の方向性
Start with telemetry/providers/providers.go and trace how New applies WithAttributes, WithFromEnv, and WithHost. Check the existing tests for provider resource attributes and how they cover CustomAttributes and OTEL_RESOURCE_ATTRIBUTES; then verify the default instance ID uses POD_NAME when set and hostname otherwise, while an explicit caller value wins.
索引モデルが issue の本文から書いたものです。
説明
Problem
The resource built in telemetry/providers/providers.go (resource.New with WithAttributes, WithFromEnv, WithHost) sets service.name and service.version but never service.instance.id, the attribute the OTel semantic conventions designate for telling instances of the same service apart.
Consumers running more than one replica and pushing OTLP metrics to a collector whose Prometheus exporter is configured the default way (resource attributes are not converted to labels) get identical label sets from every replica. Each scrape then reflects whichever replica pushed last, so cumulative counters appear to flip between replicas' values. Prometheus reads every flip as a counter reset, which makes rate() and increase() report activity when nothing is happening.
Current behavior
The only per-replica attribute is host.name, which is only visible downstream if the collector enables resource_to_telemetry_conversion. Callers can work around this with WithCustomAttributes or OTEL_RESOURCE_ATTRIBUTES, but every consumer has to know to.
Request
Set service.instance.id by default when the caller hasn't provided one (via CustomAttributes or OTEL_RESOURCE_ATTRIBUTES). A reasonable source is POD_NAME when present, falling back to the hostname. An explicit value from the caller should always win.
Impact
Any service built on this package that runs multiple replicas against a default collector exporter.
- 主要言語
- Go
- スター
- 2
- フォーク
- 6
- 平均マージ
- 23時間 44分
- マージ済み PR(30日)
- 133
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stacklok/toolhive-core のほかの issue
-
needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
stacklok/toolhive-core#466 ·
メンテナーはふだん 1 日以内に返信
-
mcpcompat/server: refuse dispatch of a request whose per-request context is gone対応中かも @jhrozek が 13 日前に担当しました。 オープンneeds-triage
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
stacklok/toolhive-core#414 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
stacklok/toolhive-core#343 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
stacklok/toolhive-core#342 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
stacklok/toolhive-core#341 ·
メンテナーはふだん 1 日以内に返信
stacklok/toolhive-core の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
agent-butler-finding chore
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
jordansmall/spindrift#6695 ·
メンテナーはふだん 1 日以内に返信
-
skills-init: commit-SHA skill refs never start (git checkout -- <sha> reads the SHA as a pathspec)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
kagent-dev/kagent#3571 ·
メンテナーはふだん 1 日以内に返信
-
book-layout.spec fails when the similar-books rail holds other projects' books対応中かも @praetorianer777 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
praetorianer777/GoTome#373 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100