Skip to content

Commit

Permalink
add semantic conventions for specification v1.17.0 (#7171)
Browse files Browse the repository at this point in the history
Signed-off-by: Benedikt Bongartz <[email protected]>
  • Loading branch information
frzifus committed Feb 15, 2023
1 parent 1a2d0cc commit b04c8d9
Show file tree
Hide file tree
Showing 7 changed files with 3,375 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .chloggen/semconv_v1.17.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: semconv

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Generated Semantic conventions 1.17 that now contains the `event` type.

# One or more tracking issues or pull requests related to the change
issues: [7170]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ gensemconv:
@[ "${SPECTAG}" ] || ( echo ">> env var SPECTAG is not set"; exit 1 )
@echo "Generating semantic convention constants from specification version ${SPECTAG} at ${SPECPATH}"
semconvgen -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/. --only=resource -p conventionType=resource -f generated_resource.go
semconvgen -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/. --only=event -p conventionType=event -f generated_event.go
semconvgen -o semconv/${SPECTAG} -t semconv/template.j2 -s ${SPECTAG} -i ${SPECPATH}/semantic_conventions/. --only=span -p conventionType=trace -f generated_trace.go

# Checks that the HEAD of the contrib repo checked out in CONTRIB_PATH compiles
Expand Down
10 changes: 8 additions & 2 deletions semconv/semconv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ import (

func TestAllSemConvFilesAreCrated(t *testing.T) {
// Files that have to be present in each semconv package
var expectedFiles = []string{"generated_resource.go", "generated_trace.go", "nonstandard.go", "schema.go"}
var expectedFiles = []string{"generated_resource.go", "generated_trace.go", "schema.go", "nonstandard.go"}

files, err := os.ReadDir(".")
assert.NoError(t, err)
for _, f := range files {
if !f.IsDir() {
continue
}
for _, ef := range expectedFiles {

end := len(expectedFiles)
if f.Name() == "v1.17.0" { // no nonstandard.go file requiered.
end--
}

for _, ef := range expectedFiles[0:end] {
assert.FileExists(t, filepath.Join(".", f.Name(), ef))
}
}
Expand Down
129 changes: 129 additions & 0 deletions semconv/v1.17.0/generated_event.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b04c8d9

Please sign in to comment.