diff --git a/Makefile b/Makefile index 4657d10b914..a1061e5b6d7 100644 --- a/Makefile +++ b/Makefile @@ -298,8 +298,8 @@ gensemconv: @[ "${SPECPATH}" ] || ( echo ">> env var SPECPATH is not set"; exit 1 ) @[ "${SPECTAG}" ] || ( echo ">> env var SPECTAG is not set"; exit 1 ) @echo "Generating semantic convention constants from specification version ${SPECTAG} at ${SPECPATH}" - semconvgen -o model/semconv/${SPECTAG} -t model/internal/semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/resource -p conventionType=resource - semconvgen -o model/semconv/${SPECTAG} -t model/internal/semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/trace -p conventionType=trace + semconvgen -o model/semconv/${SPECTAG} -t model/internal/semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/resource -p conventionType=resource -f generated_resource.go + semconvgen -o model/semconv/${SPECTAG} -t model/internal/semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/trace -p conventionType=trace -f generated_trace.go # Checks that the HEAD of the contrib repo checked out in CONTRIB_PATH compiles # against the current version of this repo. diff --git a/model/semconv/README.md b/model/semconv/README.md index 32b35207e03..94993da31d9 100644 --- a/model/semconv/README.md +++ b/model/semconv/README.md @@ -16,6 +16,7 @@ semconvgen -o model/semconv/v1.5.0 -t model/internal/semconv/template.j2 -s v1.5 semconvgen -o model/semconv/v1.5.0 -t model/internal/semconv/template.j2 -s v1.5.0 -i ~/dev/opentelemetry-specification/semantic_conventions/trace -p conventionType=trace ``` -When generating the constants for a new version ot the specification it is important to note that only `trace.go` and -`resource.go` are generated automatically. The `schema.go` and `nonstandard.go` files should be copied from a prior -version's package and updated as appropriate. Most important will be to update the `SchemaURL` constant in `schema.go`. +When generating the constants for a new version ot the specification it is important to note that only +`generated_trace.go` and `generated_resource.go` are generated automatically. The `schema.go` and `nonstandard.go` +files should be copied from a prior version's package and updated as appropriate. Most important will be to update +the `SchemaURL` constant in `schema.go`. diff --git a/model/semconv/semconv_test.go b/model/semconv/semconv_test.go index 2c07fb43eb0..fa55ce1e10d 100644 --- a/model/semconv/semconv_test.go +++ b/model/semconv/semconv_test.go @@ -24,7 +24,7 @@ import ( func TestAllSemConvFilesAreCrated(t *testing.T) { // Files that have to be present in each semconv package - var expectedFiles = []string{"nonstandard.go", "resource.go", "schema.go", "trace.go"} + var expectedFiles = []string{"generated_resource.go", "generated_trace.go", "nonstandard.go", "schema.go"} files, err := os.ReadDir(".") assert.NoError(t, err) diff --git a/model/semconv/v1.5.0/resource.go b/model/semconv/v1.5.0/generated_resource.go similarity index 100% rename from model/semconv/v1.5.0/resource.go rename to model/semconv/v1.5.0/generated_resource.go diff --git a/model/semconv/v1.5.0/trace.go b/model/semconv/v1.5.0/generated_trace.go similarity index 100% rename from model/semconv/v1.5.0/trace.go rename to model/semconv/v1.5.0/generated_trace.go diff --git a/model/semconv/v1.6.1/resource.go b/model/semconv/v1.6.1/generated_resource.go similarity index 100% rename from model/semconv/v1.6.1/resource.go rename to model/semconv/v1.6.1/generated_resource.go diff --git a/model/semconv/v1.6.1/trace.go b/model/semconv/v1.6.1/generated_trace.go similarity index 100% rename from model/semconv/v1.6.1/trace.go rename to model/semconv/v1.6.1/generated_trace.go diff --git a/model/semconv/v1.7.0/resource.go b/model/semconv/v1.7.0/generated_resource.go similarity index 100% rename from model/semconv/v1.7.0/resource.go rename to model/semconv/v1.7.0/generated_resource.go diff --git a/model/semconv/v1.7.0/trace.go b/model/semconv/v1.7.0/generated_trace.go similarity index 100% rename from model/semconv/v1.7.0/trace.go rename to model/semconv/v1.7.0/generated_trace.go diff --git a/model/semconv/v1.8.0/resource.go b/model/semconv/v1.8.0/generated_resource.go similarity index 100% rename from model/semconv/v1.8.0/resource.go rename to model/semconv/v1.8.0/generated_resource.go diff --git a/model/semconv/v1.8.0/trace.go b/model/semconv/v1.8.0/generated_trace.go similarity index 100% rename from model/semconv/v1.8.0/trace.go rename to model/semconv/v1.8.0/generated_trace.go diff --git a/model/semconv/v1.9.0/resource.go b/model/semconv/v1.9.0/generated_resource.go similarity index 100% rename from model/semconv/v1.9.0/resource.go rename to model/semconv/v1.9.0/generated_resource.go diff --git a/model/semconv/v1.9.0/trace.go b/model/semconv/v1.9.0/generated_trace.go similarity index 100% rename from model/semconv/v1.9.0/trace.go rename to model/semconv/v1.9.0/generated_trace.go