Skip to content

Commit eed3b4e

Browse files
author
Alex Boten
authored
[chore] update gensemconv to use .tools (#9055)
Also updating documentation to specify the semantic-conventions repository instead of the spec repo. Signed-off-by: Alex Boten <[email protected]>
1 parent f9a38b2 commit eed3b4e

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ genpdata:
227227
$(MAKE) fmt
228228

229229
# Generate semantic convention constants. Requires a clone of the opentelemetry-specification repo
230-
gensemconv:
230+
gensemconv: $(SEMCONVGEN)
231231
@[ "${SPECPATH}" ] || ( echo ">> env var SPECPATH is not set"; exit 1 )
232232
@[ "${SPECTAG}" ] || ( echo ">> env var SPECTAG is not set"; exit 1 )
233233
@echo "Generating semantic convention constants from specification version ${SPECTAG} at ${SPECPATH}"
234-
semconvgen -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/. --only=resource -p conventionType=resource -f generated_resource.go
235-
semconvgen -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/. --only=event -p conventionType=event -f generated_event.go
236-
semconvgen -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/. --only=span -p conventionType=trace -f generated_trace.go
234+
$(SEMCONVGEN) -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/model/. --only=resource -p conventionType=resource -f generated_resource.go
235+
$(SEMCONVGEN) -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/model/. --only=event -p conventionType=event -f generated_event.go
236+
$(SEMCONVGEN) -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/model/. --only=span -p conventionType=trace -f generated_trace.go
237237

238238
# Checks that the HEAD of the contrib repo checked out in CONTRIB_PATH compiles
239239
# against the current version of this repo.

Makefile.Common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ IMPI := $(TOOLS_BIN_DIR)/impi
3131
MISSPELL := $(TOOLS_BIN_DIR)/misspell
3232
MULTIMOD := $(TOOLS_BIN_DIR)/multimod
3333
PORTO := $(TOOLS_BIN_DIR)/porto
34+
SEMCONVGEN := $(TOOLS_BIN_DIR)/semconvgen
3435
YQ := $(TOOLS_BIN_DIR)/yq
3536

3637
.PHONY: install-tools

semconv/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ from definitions in the specification.
66
## Generation
77

88
To generate the constants you can use the `gensemconv` make target. You must provide the path to the root of a clone of
9-
the `opentelemetry-specification` repository in the `SPECPATH` variable and the version of the conventions to generate
9+
the `semantic-conventions` repository in the `SPECPATH` variable and the version of the conventions to generate
1010
in the `SPECTAG` variable.
1111

1212
```console
13-
$ make gensemconv SPECPATH=~/dev/opentelemetry-specification SPECTAG=v1.5.0
14-
Generating semantic convention constants from specification version v1.5.0 at ~/dev/opentelemetry-specification
15-
semconvgen -o semconv/v1.5.0 -t semconv/template.j2 -s v1.5.0 -i ~/dev/opentelemetry-specification/semantic_conventions/resource -p conventionType=resource
16-
semconvgen -o semconv/v1.5.0 -t semconv/template.j2 -s v1.5.0 -i ~/dev/opentelemetry-specification/semantic_conventions/trace -p conventionType=trace
13+
$ make gensemconv SPECPATH=/tmp/semantic-conventions SPECTAG=v1.22.0
14+
Generating semantic convention constants from specification version v1.22.0 at /tmp/semantic-conventions
15+
.tools/semconvgen -o semconv/v1.22.0 -t semconv/template.j2 -s v1.22.0 -i /tmp/semantic-conventions/model/. --only=resource -p conventionType=resource -f generated_resource.go
16+
.tools/semconvgen -o semconv/v1.22.0 -t semconv/template.j2 -s v1.22.0 -i /tmp/semantic-conventions/model/. --only=event -p conventionType=event -f generated_event.go
17+
.tools/semconvgen -o semconv/v1.22.0 -t semconv/template.j2 -s v1.22.0 -i /tmp/semantic-conventions/model/. --only=span -p conventionType=trace -f generated_trace.go
1718
```
1819

1920
When generating the constants for a new version ot the specification it is important to note that only

0 commit comments

Comments
 (0)