1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-25 22:41:46 +02:00

Add v1.13 semantic conventions (#3499)

* WIP

* Add NetConv unit tests

* Add ServerRequest unit tests

* Unit test ClientRequest

* Remove unneeded

* Unit test helper funcs

* Add unit tests for remaining funcs

* Update exported docs

* Fix lint

* Add changelog entry

* Add Client/Server func to semconv/internal/v2

* Generate Client/Server func for semconv ver

* Update RELEASING

Add note about compatibility.

Update example TAG.

* Fix errors

* Update changelog
This commit is contained in:
Tyler Yahn
2023-01-05 14:58:42 -08:00
committed by GitHub
parent e368276257
commit 112fbaaba4
18 changed files with 4832 additions and 100 deletions

View File

@@ -21,6 +21,7 @@ package main
import (
"embed"
"flag"
"fmt"
"log"
"os"
"path/filepath"
@@ -32,7 +33,7 @@ var (
out = flag.String("output", "./", "output directory")
tag = flag.String("tag", "", "OpenTelemetry tagged version")
//go:embed templates/*.tmpl
//go:embed templates/*.tmpl templates/netconv/*.tmpl templates/httpconv/*.tmpl
rootFS embed.FS
)
@@ -48,8 +49,8 @@ func (sc SemanticConventions) SemVer() string {
}
// render renders all templates to the dest directory using the data.
func render(dest string, data *SemanticConventions) error {
tmpls, err := template.ParseFS(rootFS, "templates/*.tmpl")
func render(src, dest string, data *SemanticConventions) error {
tmpls, err := template.ParseFS(rootFS, src)
if err != nil {
return err
}
@@ -78,7 +79,17 @@ func main() {
sc := &SemanticConventions{TagVer: *tag}
if err := render(*out, sc); err != nil {
if err := render("templates/*.tmpl", *out, sc); err != nil {
log.Fatal(err)
}
dest := fmt.Sprintf("%s/netconv", *out)
if err := render("templates/netconv/*.tmpl", dest, sc); err != nil {
log.Fatal(err)
}
dest = fmt.Sprintf("%s/httpconv", *out)
if err := render("templates/httpconv/*.tmpl", dest, sc); err != nil {
log.Fatal(err)
}
}