Skip to content

Commit

Permalink
Remove internal/semconv-gen (open-telemetry#2155)
Browse files Browse the repository at this point in the history
* Removed internal semconvgen

* fix Makefile and update releasing docs

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

Co-authored-by: Eddy Lin <elindy26@gmail.com>
  • Loading branch information
Aneurysm9 and eddyleelin authored Aug 2, 2021
1 parent 39acab3 commit 23cb939
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 416 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ $(TOOLS)/%: | $(TOOLS)
cd $(TOOLS_MOD_DIR) && \
$(GO) build -o $@ $(PACKAGE)

SEMCONVGEN = $(TOOLS)/semconv-gen
$(TOOLS)/semconv-gen: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconv-gen
SEMCONVGEN = $(TOOLS)/semconvgen
$(TOOLS)/semconvgen: PACKAGE=go.opentelemetry.io/build-tools/semconvgen

CROSSLINK = $(TOOLS)/crosslink
$(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/crosslink
Expand Down
9 changes: 4 additions & 5 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
## Semantic Convention Generation

If a new version of the OpenTelemetry Specification has been released it will be necessary to generate a new
semantic convention package from the YAML definitions in the specification repository. There is a utility in
`internal/tools/semconv-gen` that can be used to generate the a package with the name matching the specification
semantic convention package from the YAML definitions in the specification repository. There is a `semconvgen` utility
installed by `make tools` that can be used to generate the a package with the name matching the specification
version number under the `semconv` package. This will ideally be done soon after the specification release is
tagged. Make sure that the specification repo contains a checkout of the the latest tagged release so that the
generated files match the released semantic conventions.

There are currently two categories of semantic conventions that must be generated, `resource` and `trace`.

```
cd internal/tools/semconv-gen
go run generator.go -i /path/to/specification/repo/semantic_conventions/resource
go run generator.go -i /path/to/specification/repo/semantic_conventions/trace
.tools/semconvgen -i /path/to/specification/repo/semantic_conventions/resource -t semconv/template.j2
.tools/semconvgen -i /path/to/specification/repo/semantic_conventions/trace -t semconv/template.j2
```

Using default values for all options other than `input` will result in using the `template.j2` template to
Expand Down
3 changes: 1 addition & 2 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/golangci/golangci-lint v1.41.1
github.com/itchyny/gojq v0.12.4
github.com/spf13/pflag v1.0.5
golang.org/x/mod v0.4.2
go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210730171444-520d53fe242d
golang.org/x/tools v0.1.5
)

Expand Down
4 changes: 4 additions & 0 deletions internal/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,10 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/build-tools v0.0.0-20210719163622-92017e64f35b h1:tFMjUqEDGM2F82663yYidqTluwEJmmihk/AXr19J7rI=
go.opentelemetry.io/build-tools v0.0.0-20210719163622-92017e64f35b/go.mod h1:zZRrJN8qdwDdPNkCEyww4SW54mM1Da0v9H3TyQet9T4=
go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210730171444-520d53fe242d h1:EjYSijh2wWPht3w0Zfa6V7280z5iDBr1228TysQgurM=
go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210730171444-520d53fe242d/go.mod h1:QJyAzHKDKGDl52AUIAZhWKx3nOPBZJ3dD44utso2FPE=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand Down
Loading

0 comments on commit 23cb939

Please sign in to comment.