Skip to content

Commit 830fae8

Browse files
authored
Add semconv/v1.21.0 (#4362)
* Update tooling to point to new repository * Update changelog * Remove leftovers * generate semconv/v1.21.0
1 parent d5d6318 commit 830fae8

11 files changed

Lines changed: 6956 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1717
- OTLP Metrics Exporter now supports the `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` environment variable. (#4287)
1818
- Add `WithoutCounterSuffixes` option in `go.opentelemetry.io/otel/exporters/prometheus` to disable addition of `_total` suffixes. (#4306)
1919
- Add info and debug logging to the metric SDK. (#4315)
20+
- The `go.opentelemetry.io/otel/semconv/v1.21.0` package.
21+
The package contains semantic conventions from the `v1.21.0` version of the OpenTelemetry Semantic Conventions. (#4362)
2022

2123
### Changed
2224

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ check-clean-work-tree:
256256
SEMCONVPKG ?= "semconv/"
257257
.PHONY: semconv-generate
258258
semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT)
259-
[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry specification tag"; exit 1 )
260-
[ "$(OTEL_SPEC_REPO)" ] || ( echo "OTEL_SPEC_REPO unset: missing path to opentelemetry specification repo"; exit 1 )
261-
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
262-
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
263-
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
264-
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
259+
[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 )
260+
[ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 )
261+
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
262+
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
263+
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
264+
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
265265
$(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
266266

267267
.PHONY: prerelease

RELEASING.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,25 @@
22

33
## Semantic Convention Generation
44

5-
New versions of the [OpenTelemetry Specification] mean new versions of the `semconv` package need to be generated.
5+
New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated.
66
The `semconv-generate` make target is used for this.
77

8-
1. Checkout a local copy of the [OpenTelemetry Specification] to the desired release tag.
8+
1. Checkout a local copy of the [OpenTelemetry Semantic Conventions] to the desired release tag.
99
2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest`
1010
3. Run the `make semconv-generate ...` target from this repository.
1111

1212
For example,
1313

1414
```sh
15-
export TAG="v1.13.0" # Change to the release version you are generating.
16-
export OTEL_SPEC_REPO="/absolute/path/to/opentelemetry-specification"
15+
export TAG="v1.21.0" # Change to the release version you are generating.
16+
export OTEL_SEMCONV_REPO="/absolute/path/to/opentelemetry/semantic-conventions"
1717
docker pull otel/semconvgen:latest
18-
make semconv-generate # Uses the exported TAG and OTEL_SPEC_REPO.
18+
make semconv-generate # Uses the exported TAG and OTEL_SEMCONV_REPO.
1919
```
2020

2121
This should create a new sub-package of [`semconv`](./semconv).
2222
Ensure things look correct before submitting a pull request to include the addition.
2323

24-
**Note**, the generation code was changed to generate versions >= 1.13.
25-
To generate versions prior to this, checkout the old release of this repository (i.e. [2fe8861](https://github.com/open-telemetry/opentelemetry-go/commit/2fe8861a24e20088c065b116089862caf9e3cd8b)).
26-
2724
## Pre-Release
2825

2926
First, decide which module sets will be released and update their versions
@@ -123,7 +120,7 @@ Once verified be sure to [make a release for the `contrib` repository](https://g
123120
Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/instrumentation/go].
124121
Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate.
125122
126-
[OpenTelemetry Specification]: https://github.com/open-telemetry/opentelemetry-specification
123+
[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions
127124
[Go instrumentation documentation]: https://opentelemetry.io/docs/instrumentation/go/
128125
[content/en/docs/instrumentation/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/go
129126

internal/tools/semconvkit/main.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ package main
2121
import (
2222
"embed"
2323
"flag"
24-
"fmt"
2524
"log"
2625
"os"
2726
"path/filepath"
@@ -33,7 +32,7 @@ var (
3332
out = flag.String("output", "./", "output directory")
3433
tag = flag.String("tag", "", "OpenTelemetry tagged version")
3534

36-
//go:embed templates/*.tmpl templates/netconv/*.tmpl templates/httpconv/*.tmpl
35+
//go:embed templates/*.tmpl
3736
rootFS embed.FS
3837
)
3938

@@ -82,22 +81,4 @@ func main() {
8281
if err := render("templates/*.tmpl", *out, sc); err != nil {
8382
log.Fatal(err)
8483
}
85-
86-
dest := fmt.Sprintf("%s/netconv", *out)
87-
// Ensure the dest dir exists (MkdirAll does nothing if dest is a directory
88-
// and already exists).
89-
if err := os.MkdirAll(dest, os.ModePerm); err != nil {
90-
log.Fatal(err)
91-
}
92-
if err := render("templates/netconv/*.tmpl", dest, sc); err != nil {
93-
log.Fatal(err)
94-
}
95-
96-
dest = fmt.Sprintf("%s/httpconv", *out)
97-
if err := os.MkdirAll(dest, os.ModePerm); err != nil {
98-
log.Fatal(err)
99-
}
100-
if err := render("templates/httpconv/*.tmpl", dest, sc); err != nil {
101-
log.Fatal(err)
102-
}
10384
}

0 commit comments

Comments
 (0)