Skip to content

Commit

Permalink
Merge pull request #409 from nachoBonafonte/update-spec-to-v1.20.0
Browse files Browse the repository at this point in the history
Update Spec to v1.20.0.
It uses generate.sh and SemanticAttributes.swift.j2 from PR #408 by Sherlouk
  • Loading branch information
Ignacio Bonafonte authored May 5, 2023
2 parents a85c8c9 + efec7bf commit e585c48
Show file tree
Hide file tree
Showing 6 changed files with 1,584 additions and 416 deletions.
32 changes: 20 additions & 12 deletions Scripts/semantic-convention/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"

# freeze the spec version to make SemanticAttributes generation reproducible
SPEC_VERSION=v1.7.0
# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible

# repository: https://github.com/open-telemetry/opentelemetry-specification
SEMCONV_VERSION=1.20.0
SPEC_VERSION=v$SEMCONV_VERSION

# repository: https://github.com/open-telemetry/build-tools
GENERATOR_VERSION=0.18.0

cd ${SCRIPT_DIR}

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

docker run --rm \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/trace:/source \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
-v ${SCRIPT_DIR}/templates:/templates \
-v ${ROOT_DIR}/Sources/OpenTelemetryApi/Trace/:/output \
otel/semconvgen:0.8.0 \
--yaml-root /source \
code \
otel/semconvgen:$GENERATOR_VERSION \
--only span,event,attribute_group,scope \
-f /source code \
--template /templates/SemanticAttributes.swift.j2 \
--output /output/SemanticAttributes.swift \
-Denum=SemanticAttributes \
-Dsemconv=trace \
-Denum=SemanticAttributes

docker run --rm \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/resource:/source \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
-v ${SCRIPT_DIR}/templates:/templates \
-v ${ROOT_DIR}/Sources/OpenTelemetrySdk/Resources/:/output \
otel/semconvgen:0.8.0 \
--yaml-root /source \
code \
otel/semconvgen:$GENERATOR_VERSION \
--only resource \
-f /source code \
--template /templates/SemanticAttributes.swift.j2 \
--output /output/ResourceAttributes.swift \
-Denum=ResourceAttributes \
-Dsemconv=resource \
-Denum=ResourceAttributes

cd "$ROOT_DIR"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public enum {{enum}}: String {
{%- endif %}
{%- if attribute.note %}

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

Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenTelemetryApi/OpenTelemetry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
/// The telemetry objects are lazy-loaded singletons resolved via ServiceLoader mechanism.
public struct OpenTelemetry {

public static var version = "v1.7.0"
public static var version = "v1.20.0"

public static var instance = OpenTelemetry()

Expand Down
Loading

0 comments on commit e585c48

Please # to comment.