Skip to content

Commit 48a4f4b

Browse files
authored
Suppress weaver finding via config instead of --include-unreferenced flag (#55)
1 parent 0240f03 commit 48a4f4b

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

.weaver.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#:schema https://raw.githubusercontent.com/open-telemetry/weaver/v0.23.0/schemas/weaver-config.json
2+
3+
# OTel SDK resource attributes that don't belong to the genai registry — see
4+
# https://github.com/open-telemetry/weaver/issues/1456.
5+
[[live_check.finding_filters]]
6+
signal_type = "resource"
7+
exclude_samples = [
8+
"service.name",
9+
"telemetry.sdk.language",
10+
"telemetry.sdk.name",
11+
"telemetry.sdk.version",
12+
]

util/opentelemetry-test-util-genai/src/opentelemetry/test_util_genai/_setup_weaver.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,8 @@ def policies_dir() -> Path:
294294
def semconv_registry() -> Path:
295295
"""Return the path to ``<semantic-conventions-genai>/model`` for the pinned ref."""
296296
return _provision_genai_root() / "model"
297+
298+
299+
def weaver_config_file() -> Path:
300+
"""Return the path to the workspace ``.weaver.toml``."""
301+
return _workspace_root() / ".weaver.toml"

util/opentelemetry-test-util-genai/src/opentelemetry/test_util_genai/fixtures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
from opentelemetry.test_util_genai._setup_weaver import (
6767
policies_dir,
6868
semconv_registry,
69+
weaver_config_file,
6970
)
7071
from opentelemetry.util.genai.environment_variables import (
7172
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT,
@@ -212,6 +213,6 @@ def weaver_live_check() -> Iterator[Any]:
212213
with WeaverLiveCheck(
213214
registry=registry,
214215
policies_dir=policies,
215-
extra_args=["--include-unreferenced"],
216+
extra_args=["--config", str(weaver_config_file())],
216217
) as weaver:
217218
yield weaver

0 commit comments

Comments
 (0)