Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add semantic conventions for specification v1.16.0 #6713

Merged
merged 3 commits into from
Jan 6, 2023

Conversation

frzifus
Copy link
Member

@frzifus frzifus commented Dec 8, 2022

Description:
Add semantic conventions for specification v1.16.0.

Link to tracking Issue:
Belongs to #6696 (comment)
Closes #6714

Additional:

Convention type trace trace leads to the following output:

panic: unable to render template: exit status 1
Traceback (most recent call last):
  File "/usr/local/bin/gen-semconv", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/main.py", line 67, in main
    semconv = parse_semconv(args, parser)
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/main.py", line 38, in parse_semconv
    semconv.finish()
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/model/semantic_convention.py", line 317, in finish
    fixpoint_ref = self.resolve_ref(semconv)
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/model/semantic_convention.py", line 458, in resolve_ref
    raise ValidationError.from_yaml_pos(
opentelemetry.semconv.model.exceptions.ValidationError: Semantic Convention trace-exception reference `exception.type` but it cannot be found! - @2:5

According to the sem-conv changelog, there should have been no breaking change. The last one was in version v0.12.0 and was resolved here.

Can someone help/show me what to look for?


update

Thanks for the hint from @Aneurysm9. He noticed that exception was moved from tracing[1][2]. Now I could now generate trace and resources as follows:

$ docker run --rm -v ${PWD}/tmp:/data:z otel/semconvgen:0.14.0 --yaml-root /data/input/semantic_conventions --only resource code --template /data/template.j2 --output /data/output/generated_resource.go --parameters conventionType=resource
$ docker run --rm -v ${PWD}/tmp:/data:z otel/semconvgen:0.14.0 --yaml-root /data/input/semantic_conventions --only span code --template /data/template.j2 --output /data/output/generated_trace.go --parameters conventionType=trace

@frzifus frzifus force-pushed the semconv_v1.16.0 branch 2 times, most recently from 00c41f3 to a06ece5 Compare December 12, 2022 20:26
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Base: 89.64% // Head: 91.05% // Increases project coverage by +1.41% 🎉

Coverage data is based on head (7ad7296) compared to base (8222571).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6713      +/-   ##
==========================================
+ Coverage   89.64%   91.05%   +1.41%     
==========================================
  Files         246      237       -9     
  Lines       14302    14306       +4     
==========================================
+ Hits        12821    13027     +206     
+ Misses       1231     1027     -204     
- Partials      250      252       +2     
Impacted Files Coverage Δ
receiver/otlpreceiver/factory.go 73.21% <0.00%> (-14.29%) ⬇️
service/host.go 88.23% <0.00%> (-11.77%) ⬇️
service/extensions/extensions.go 78.88% <0.00%> (-4.27%) ⬇️
component/component.go 38.29% <0.00%> (-4.26%) ⬇️
service/service.go 67.22% <0.00%> (-1.74%) ⬇️
service/pipelines.go 94.23% <0.00%> (-0.94%) ⬇️
service/telemetry.go 88.46% <0.00%> (-0.43%) ⬇️
exporter/loggingexporter/factory.go 88.73% <0.00%> (-0.16%) ⬇️
exporter/otlphttpexporter/factory.go 86.81% <0.00%> (-0.15%) ⬇️
exporter/otlpexporter/factory.go 90.76% <0.00%> (-0.14%) ⬇️
... and 78 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@frzifus frzifus marked this pull request as ready for review December 12, 2022 20:43
@frzifus frzifus requested review from a team and Aneurysm9 December 12, 2022 20:43
@frzifus
Copy link
Member Author

frzifus commented Dec 20, 2022

any updates here @open-telemetry/collector-approvers ? 😃

@frzifus
Copy link
Member Author

frzifus commented Dec 23, 2022

Is something else needed? :)

Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you had to change the invocation used to generate these constants, but have not updated the gensemconv make target. That needs to be done as well. If changes are required in the generator then they should be made first and the dependency updated.

$ make gensemconv SPECPATH=../opentelemetry-specification SPECTAG=v1.16.0
Generating semantic convention constants from specification version v1.16.0 at ../opentelemetry-specification
semconvgen -o semconv/v1.16.0 -t semconv/template.j2 -s v1.16.0 -i ../opentelemetry-specification/semantic_conventions/resource -p conventionType=resource -f generated_resource.go
semconvgen -o semconv/v1.16.0 -t semconv/template.j2 -s v1.16.0 -i ../opentelemetry-specification/semantic_conventions/trace -p conventionType=trace -f generated_trace.go
panic: unable to render template: exit status 1
Traceback (most recent call last):
  File "/usr/local/bin/gen-semconv", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/main.py", line 67, in main
    semconv = parse_semconv(args, parser)
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/main.py", line 38, in parse_semconv
    semconv.finish()
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/model/semantic_convention.py", line 317, in finish
    fixpoint_ref = self.resolve_ref(semconv)
  File "/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/model/semantic_convention.py", line 458, in resolve_ref
    raise ValidationError.from_yaml_pos(
opentelemetry.semconv.model.exceptions.ValidationError: Semantic Convention trace-exception reference `exception.type` but it cannot be found! - @2:5


goroutine 1 [running]:
main.main()
        /Users/mirabant/go/pkg/mod/go.opentelemetry.io/build-tools/semconvgen@v0.3.0/generator.go:61 +0x44e
make: *** [gensemconv] Error 2

Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@frzifus
Copy link
Member Author

frzifus commented Jan 5, 2023

Thanks for the feedback @Aneurysm9. I have adjusted the Makefile rule. But to use the rule, this semconvgen patch is needed.

Makefile Show resolved Hide resolved
@Aneurysm9
Copy link
Member

Once the generator change is landed this will need to update internal/tools/go.mod to ensure the use of the newer generator. Otherwise, LGTM.

@frzifus
Copy link
Member Author

frzifus commented Jan 6, 2023

@Aneurysm9 I updated the internal semconvgen to the latest version.

@frzifus frzifus requested a review from Aneurysm9 January 6, 2023 20:14
@Aneurysm9
Copy link
Member

@Aneurysm9 I updated the internal semconvgen to the latest version.

I just made a v0.4.0 release. Can you update to that quickly?

Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@frzifus
Copy link
Member Author

frzifus commented Jan 6, 2023

done 👍

@dmitryax dmitryax merged commit 40721e5 into open-telemetry:main Jan 6, 2023
@frzifus frzifus deleted the semconv_v1.16.0 branch January 6, 2023 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add semantic conventions for specification v1.16.0
4 participants