From c4b8e9124e86dd8818e734cba3077d95735c9b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Mon, 14 Jul 2025 16:24:33 +0200 Subject: [PATCH] chore(semconv): follow weaver folder structure (#6998) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (this PR is a suggestion, feel free to close if it doesn't align with the vision for this repo) Moves jinja templates for semantic conventions from the root of `semconv/` into `semconv/templates/registry/go/`, making them easier to consume. While this wasn't impeding development in `opentelemetry-go` it makes it easier to consume the templates from other packages via: ```bash weaver registry generate --templates https://github.com/open-telemetry/opentelemetry-go.git[semconv/templates] go . ``` which was previously impossible. Specific use-case would be using [weaver](https://github.com/open-telemetry/weaver) to maintain private registry of semantic conventions for companies/projects in which case it's more convenient to be able to rely on the upstream opentelemetry-go templates as opposed to having to copy them over. Tested by running: ```bash TAG='v1.34.0' make semconv-generate ``` which results into empty diff. ## Open questions Does the changelog deserve an entry for this even without changes to the API? Co-authored-by: Robert PajÄ…k --- Makefile | 2 +- semconv/{ => templates/registry/go}/attribute_group.go.j2 | 0 semconv/{ => templates/registry/go}/helpers.j2 | 0 semconv/{ => templates/registry/go}/instrument.j2 | 0 semconv/{ => templates/registry/go}/metric.go.j2 | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename semconv/{ => templates/registry/go}/attribute_group.go.j2 (100%) rename semconv/{ => templates/registry/go}/helpers.j2 (100%) rename semconv/{ => templates/registry/go}/instrument.j2 (100%) rename semconv/{ => templates/registry/go}/metric.go.j2 (100%) diff --git a/Makefile b/Makefile index 1d56a4417..bc0f1f92d 100644 --- a/Makefile +++ b/Makefile @@ -281,7 +281,7 @@ semconv-generate: $(SEMCONVKIT) docker run --rm \ -u $(DOCKER_USER) \ --env HOME=/tmp/weaver \ - --mount 'type=bind,source=$(PWD)/semconv,target=/home/weaver/templates/registry/go,readonly' \ + --mount 'type=bind,source=$(PWD)/semconv/templates,target=/home/weaver/templates,readonly' \ --mount 'type=bind,source=$(PWD)/semconv/${TAG},target=/home/weaver/target' \ --mount 'type=bind,source=$(HOME)/.weaver,target=/tmp/weaver/.weaver' \ $(WEAVER_IMAGE) registry generate \ diff --git a/semconv/attribute_group.go.j2 b/semconv/templates/registry/go/attribute_group.go.j2 similarity index 100% rename from semconv/attribute_group.go.j2 rename to semconv/templates/registry/go/attribute_group.go.j2 diff --git a/semconv/helpers.j2 b/semconv/templates/registry/go/helpers.j2 similarity index 100% rename from semconv/helpers.j2 rename to semconv/templates/registry/go/helpers.j2 diff --git a/semconv/instrument.j2 b/semconv/templates/registry/go/instrument.j2 similarity index 100% rename from semconv/instrument.j2 rename to semconv/templates/registry/go/instrument.j2 diff --git a/semconv/metric.go.j2 b/semconv/templates/registry/go/metric.go.j2 similarity index 100% rename from semconv/metric.go.j2 rename to semconv/templates/registry/go/metric.go.j2