Skip to content

Semconv signal-type queries and log attribute validation#158

Merged
andrewh merged 2 commits into
mainfrom
claude/relaxed-franklin-rfeaz7
Jun 11, 2026
Merged

Semconv signal-type queries and log attribute validation#158
andrewh merged 2 commits into
mainfrom
claude/relaxed-franklin-rfeaz7

Conversation

@andrewh

@andrewh andrewh commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Completes the remaining work for issue 113 (work item 4 was split out to issue 157).

Signal-type query methods in pkg/semconv

The registry previously exposed only MetricByName for signal-aware lookups. This adds the type filters identified in the issue 113 audit:

  • Metrics(), Spans(), Events(), Entities() — return all groups of the given type
  • Covered by a mixed-type fixture test and an embedded-data smoke test

These are the building blocks for semconv suggestions (issue 157).

Log attribute validation in motel validate

Issue 112 added logs: to the topology DSL with arbitrary attribute maps, but attribute names were never checked against the semantic conventions. motel validate now warns when a log attribute:

  • is deprecated in the semconv registry (e.g. an attribute superseded by a renamed one), or
  • has a static value that is not a member of a known enum (e.g. log.iostream: syslog when the convention allows only stdout/stderr)

Unknown attribute names produce no warning — custom attributes remain allowed, consistent with the existing metric warnings (semconvMetricWarnings), which this mirrors.

Notes

  • Warnings go to stderr and do not fail validation
  • make test and make lint pass

https://claude.ai/code/session_0134t4ENXTnwsTJfv6LJfF5e

claude added 2 commits June 11, 2026 14:00
Metrics(), Spans(), Events(), and Entities() filter groups by type,
completing the signal-type-aware registry API from issue 113.
validate now checks log attribute names against the semantic
convention registry, warning on deprecated attributes and static
values outside a known enum's members. Unknown attribute names
remain allowed as custom attributes.
@andrewh andrewh changed the title Add signal-type query methods to semconv registry Semconv signal-type queries and log attribute validation Jun 11, 2026
@andrewh
andrewh requested a review from Copilot June 11, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds signal-type query helpers to the semantic convention registry and extends motel validate to warn about semconv log-attribute issues (deprecated attributes and invalid enum values) without failing validation.

Changes:

  • Added Metrics(), Spans(), Events(), and Entities() query methods to pkg/semconv.Registry.
  • Added semconvLogWarnings to motel validate, emitting stderr warnings for deprecated log attributes and static enum-value mismatches.
  • Added tests covering mixed-type registry queries and log warning behavior (including embedded-registry smoke assertions).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/semconv/registry.go Adds type-filtered group query helpers (Metrics/Spans/Events/Entities) via a shared groupsByType.
pkg/semconv/registry_test.go Adds mixed-type fixture test plus embedded-data smoke test for the new query helpers.
cmd/motel/main.go Invokes new log warnings during validate and implements enum membership checking for static log attribute values.
cmd/motel/main_test.go Adds focused tests for deprecated log attributes and enum membership warnings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrewh
andrewh merged commit 4014d69 into main Jun 11, 2026
3 checks passed
@andrewh
andrewh deleted the claude/relaxed-franklin-rfeaz7 branch June 11, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants