Skip to content

Commit e585c48

Browse files
author
Ignacio Bonafonte
authored
Merge pull request #409 from nachoBonafonte/update-spec-to-v1.20.0
Update Spec to v1.20.0. It uses generate.sh and SemanticAttributes.swift.j2 from PR #408 by Sherlouk
2 parents a85c8c9 + efec7bf commit e585c48

File tree

6 files changed

+1584
-416
lines changed

6 files changed

+1584
-416
lines changed

Scripts/semantic-convention/generate.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44
ROOT_DIR="${SCRIPT_DIR}/../../"
55

6-
# freeze the spec version to make SemanticAttributes generation reproducible
7-
SPEC_VERSION=v1.7.0
6+
# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
7+
8+
# repository: https://github.com/open-telemetry/opentelemetry-specification
9+
SEMCONV_VERSION=1.20.0
10+
SPEC_VERSION=v$SEMCONV_VERSION
11+
12+
# repository: https://github.com/open-telemetry/build-tools
13+
GENERATOR_VERSION=0.18.0
814

915
cd ${SCRIPT_DIR}
1016

@@ -19,26 +25,28 @@ git reset --hard FETCH_HEAD
1925
cd ${SCRIPT_DIR}
2026

2127
docker run --rm \
22-
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/trace:/source \
28+
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
2329
-v ${SCRIPT_DIR}/templates:/templates \
2430
-v ${ROOT_DIR}/Sources/OpenTelemetryApi/Trace/:/output \
25-
otel/semconvgen:0.8.0 \
26-
--yaml-root /source \
27-
code \
31+
otel/semconvgen:$GENERATOR_VERSION \
32+
--only span,event,attribute_group,scope \
33+
-f /source code \
2834
--template /templates/SemanticAttributes.swift.j2 \
2935
--output /output/SemanticAttributes.swift \
30-
-Denum=SemanticAttributes \
36+
-Dsemconv=trace \
37+
-Denum=SemanticAttributes
3138

3239
docker run --rm \
33-
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/resource:/source \
40+
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
3441
-v ${SCRIPT_DIR}/templates:/templates \
3542
-v ${ROOT_DIR}/Sources/OpenTelemetrySdk/Resources/:/output \
36-
otel/semconvgen:0.8.0 \
37-
--yaml-root /source \
38-
code \
43+
otel/semconvgen:$GENERATOR_VERSION \
44+
--only resource \
45+
-f /source code \
3946
--template /templates/SemanticAttributes.swift.j2 \
4047
--output /output/ResourceAttributes.swift \
41-
-Denum=ResourceAttributes \
48+
-Dsemconv=resource \
49+
-Denum=ResourceAttributes
4250

4351
cd "$ROOT_DIR"
4452

Scripts/semantic-convention/templates/SemanticAttributes.swift.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public enum {{enum}}: String {
4646
{%- endif %}
4747
{%- if attribute.note %}
4848

49-
- Note: {{attribute.note | to_doc_brief | indent(6, True, indentfirst=False)}}.
49+
- Note: {{attribute.note | to_doc_brief | indent(6, False)}}.
5050
{%- endif %}
5151
{%- if attribute.deprecated %}
5252

Sources/OpenTelemetryApi/OpenTelemetry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
/// The telemetry objects are lazy-loaded singletons resolved via ServiceLoader mechanism.
1111
public struct OpenTelemetry {
1212

13-
public static var version = "v1.7.0"
13+
public static var version = "v1.20.0"
1414

1515
public static var instance = OpenTelemetry()
1616

0 commit comments

Comments
 (0)