Skip to content

Commit bd03660

Browse files
authored
Fix spec link update to update older versions too (#3526)
1 parent 3ad036b commit bd03660

File tree

10 files changed

+26
-34
lines changed

10 files changed

+26
-34
lines changed

.github/scripts/update-spec-repo-links.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#
55
# ./internal/tools/update-spec-repo-links.sh v1.41.0
66

7-
# this version should be kept up-to-date with the spec version that links use
8-
PREVIOUS_SPECIFICATION_VERSION=v1.55.0
9-
107
# Set this to the version number you want to KEEP in URLs in the repository.
118
LATEST_SPECIFICATION_VERSION=$1
129
# The specific pattern we look for when replacing URLs
@@ -15,14 +12,17 @@ SPECIFICATION_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specif
1512
SPECIFICATION_BADGE_PREFIX="https://img.shields.io/badge/OTel_specification_version-"
1613
SPECIFICATION_BADGE_RELEASE_TAG_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/releases/tag/"
1714

18-
1915
fix_file() {
20-
echo Fixing file $1
21-
sed -i \
22-
-e "s,${SPECIFICATION_URL_PREFIX}${PREVIOUS_SPECIFICATION_VERSION},${SPECIFICATION_URL_PREFIX}${LATEST_SPECIFICATION_VERSION},g" \
23-
-e "s,${SPECIFICATION_BADGE_PREFIX}${PREVIOUS_SPECIFICATION_VERSION},${SPECIFICATION_BADGE_PREFIX}${LATEST_SPECIFICATION_VERSION},g" \
24-
-e "s,${SPECIFICATION_BADGE_RELEASE_TAG_PREFIX}${PREVIOUS_SPECIFICATION_VERSION},${SPECIFICATION_BADGE_RELEASE_TAG_PREFIX}${LATEST_SPECIFICATION_VERSION},g" \
25-
"$1"
16+
echo Fixing file "$1"
17+
18+
# Replace any versioned spec URL/badge with the latest version.
19+
# Uses a negative lookahead to skip URLs pointing to semantic_conventions/
20+
# paths that were moved from the spec repo and no longer exist in newer versions.
21+
perl -pi -e "
22+
s,\Q${SPECIFICATION_URL_PREFIX}\Ev1\.\d+\.\d+(?=/specification/(?!.*/semantic_conventions/)),${SPECIFICATION_URL_PREFIX}${LATEST_SPECIFICATION_VERSION},g;
23+
s,\Q${SPECIFICATION_BADGE_PREFIX}\Ev1\.\d+\.\d+,${SPECIFICATION_BADGE_PREFIX}${LATEST_SPECIFICATION_VERSION},g;
24+
s,\Q${SPECIFICATION_BADGE_RELEASE_TAG_PREFIX}\Ev1\.\d+\.\d+,${SPECIFICATION_BADGE_RELEASE_TAG_PREFIX}${LATEST_SPECIFICATION_VERSION},g;
25+
" "$1"
2626
}
2727

2828
important_files=("docs" "model" "README.md")

.github/workflows/auto-update-spec-repo-links.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
runs-on: ubuntu-latest
1414
if: github.repository_owner == 'open-telemetry'
1515
outputs:
16-
current-version: ${{ steps.check-versions.outputs.current-version }}
1716
latest-version: ${{ steps.check-versions.outputs.latest-version }}
1817
already-opened: ${{ steps.check-versions.outputs.already-opened }}
1918
steps:
@@ -24,9 +23,6 @@ jobs:
2423
env:
2524
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2625
run: |
27-
current_version=$(grep "PREVIOUS_SPECIFICATION_VERSION=v.*" \
28-
.github/scripts/update-spec-repo-links.sh \
29-
| sed "s/PREVIOUS_SPECIFICATION_VERSION=//")
3026
latest_version=$(gh release view \
3127
--repo open-telemetry/opentelemetry-specification \
3228
--json tagName \
@@ -41,7 +37,6 @@ jobs:
4137
already_opened=true
4238
fi
4339
44-
echo "current-version=$current_version" >> $GITHUB_OUTPUT
4540
echo "latest-version=$latest_version" >> $GITHUB_OUTPUT
4641
echo "already-opened=$already_opened" >> $GITHUB_OUTPUT
4742
@@ -50,7 +45,6 @@ jobs:
5045
contents: write # required for pushing changes
5146
runs-on: ubuntu-latest
5247
if: |
53-
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&
5448
needs.check-versions.outputs.already-opened != 'true'
5549
needs:
5650
- check-versions
@@ -63,9 +57,7 @@ jobs:
6357
- name: Update version
6458
env:
6559
VERSION: ${{ needs.check-versions.outputs.latest-version }}
66-
run: |
67-
.github/scripts/update-spec-repo-links.sh $VERSION
68-
sed -i "s/^PREVIOUS_SPECIFICATION_VERSION=.*/PREVIOUS_SPECIFICATION_VERSION=$VERSION/" .github/scripts/update-spec-repo-links.sh
60+
run: .github/scripts/update-spec-repo-links.sh $VERSION
6961

7062
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
7163
id: otelbot-token

docs/cicd/cicd-spans.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This span describes a CICD pipeline run.
3535

3636
For all pipeline runs, a span with kind `SERVER` SHOULD be created corresponding to the execution of the pipeline run.
3737

38-
**Span name** MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.43.0/specification/trace/api.md#span).
38+
**Span name** MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/trace/api.md#span).
3939

4040
The span name SHOULD be `{action} {pipeline}` if there is a (low-cardinality) pipeline name available.
4141
If the pipeline name is not available or is likely to have high cardinality, then the span name SHOULD be `{action}`.

docs/gen-ai/gen-ai-spans.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This span represents a client call to Generative AI model or service that genera
5757

5858
**Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`.
5959
Semantic conventions for individual GenAI systems and frameworks MAY specify different span name format
60-
and MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.37.0/specification/trace/api.md#span).
60+
and MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/trace/api.md#span).
6161

6262
**Span kind** SHOULD be `CLIENT` and MAY be set to `INTERNAL` on spans representing
6363
call to models running in the same process. It's RECOMMENDED to use `CLIENT` kind

docs/gen-ai/mcp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ It SHOULD be set to `pipe` if the transport is stdio.
469469
This metric is [recommended][MetricRecommended].
470470

471471
This metric SHOULD be specified with
472-
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.50.0/specification/metrics/api.md#instrument-advisory-parameters)
472+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
473473
of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`.
474474

475475
<!-- semconv metric.mcp.client.operation.duration -->
@@ -606,7 +606,7 @@ It SHOULD be set to `pipe` if the transport is stdio.
606606
This metric is [recommended][MetricRecommended].
607607

608608
This metric SHOULD be specified with
609-
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.50.0/specification/metrics/api.md#instrument-advisory-parameters)
609+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
610610
of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`.
611611

612612
<!-- semconv metric.mcp.server.operation.duration -->
@@ -737,7 +737,7 @@ It SHOULD be set to `pipe` if the transport is stdio.
737737
This metric is [recommended][MetricRecommended].
738738

739739
This metric SHOULD be specified with
740-
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.50.0/specification/metrics/api.md#instrument-advisory-parameters)
740+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
741741
of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`.
742742

743743
<!-- semconv metric.mcp.client.session.duration -->
@@ -820,7 +820,7 @@ is HTTP. It SHOULD be set to `pipe` if the transport is stdio.
820820
This metric is [recommended][MetricRecommended].
821821

822822
This metric SHOULD be specified with
823-
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.50.0/specification/metrics/api.md#instrument-advisory-parameters)
823+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
824824
of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`.
825825

826826
<!-- semconv metric.mcp.server.session.duration -->

docs/how-to-write-conventions/resource-and-entities.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ minimal set of attributes that is sufficient for uniquely identifying that entit
177177
uniquely identified by (`process.pid`,`process.creation.time`)
178178
attributes. Adding for example `process.executable.name`
179179
attribute to the identity is unnecessary and violates the
180-
rule of having a [minimally sufficient ID](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.45.0/specification/entities/data-model.md#minimally-sufficient-identity).
180+
rule of having a [minimally sufficient ID](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/entities/data-model.md#minimally-sufficient-identity).
181181

182182
Identifying attributes generally form the lifespan of an entity. This is
183183
important, particularly, for metrics written against an entity. The lifespan
@@ -232,7 +232,7 @@ semantic convention namespacing rules.
232232
## Background: Resource and Entities
233233

234234
In OpenTelemetry, every signal is associated with a Resource.
235-
According to the [Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.45.0/specification/resource/README.md#overview)
235+
According to the [Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/resource/README.md#overview)
236236
this is:
237237

238238
> A Resource is a representation of the entity producing telemetry. Within
@@ -247,7 +247,7 @@ this is:
247247
> * It SHOULD allow users to determine where that entity resides within their
248248
> infrastructure.
249249

250-
All resources are composed of [Entities](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.45.0/specification/entities/README.md#overview).
250+
All resources are composed of [Entities](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/entities/README.md#overview).
251251
An entity is specified as:
252252

253253
> Entity represents an object of interest associated with
@@ -262,7 +262,7 @@ several key differences between the two:
262262
*descriptive* attributes.
263263
- Identifying attributes can be used to identify the entity
264264
within some system (See
265-
[minimally sufficient id](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.45.0/specification/entities/data-model.md#minimally-sufficient-identity)).
265+
[minimally sufficient id](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/entities/data-model.md#minimally-sufficient-identity)).
266266
For Example, the `k8s.pod.uid` would be considered an
267267
identifying attribute for a pod within kubernetes.
268268
- *Descriptive* attributes can be used to provide additional labels for

docs/rpc/rpc-metrics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ metrics can be filtered for finer grain analysis.
5555
This metric is [required][MetricRequired].
5656

5757
This metric SHOULD be specified with
58-
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.50.0/specification/metrics/api.md#instrument-advisory-parameters)
58+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
5959
of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`.
6060

6161
<!-- semconv metric.rpc.server.call.duration -->
@@ -154,7 +154,7 @@ Semantic conventions for individual RPC frameworks SHOULD document what `rpc.res
154154
This metric is [required][MetricRequired].
155155

156156
This metric SHOULD be specified with
157-
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.50.0/specification/metrics/api.md#instrument-advisory-parameters)
157+
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/metrics/api.md#instrument-advisory-parameters)
158158
of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`.
159159

160160
<!-- semconv metric.rpc.client.call.duration -->

docs/runtime/cpython-metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ This metric is [recommended][MetricRecommended].
128128
<!-- END AUTOGENERATED TEXT -->
129129
<!-- endsemconv -->
130130

131-
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.42.0/specification/document-status.md
131+
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/document-status.md
132132
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended

model/cicd/spans.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ groups:
66
note: |
77
For all pipeline runs, a span with kind `SERVER` SHOULD be created corresponding to the execution of the pipeline run.
88
9-
**Span name** MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.43.0/specification/trace/api.md#span).
9+
**Span name** MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/trace/api.md#span).
1010
1111
The span name SHOULD be `{action} {pipeline}` if there is a (low-cardinality) pipeline name available.
1212
If the pipeline name is not available or is likely to have high cardinality, then the span name SHOULD be `{action}`.

model/gen-ai/spans.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ groups:
111111
note: |
112112
**Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`.
113113
Semantic conventions for individual GenAI systems and frameworks MAY specify different span name format
114-
and MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.37.0/specification/trace/api.md#span).
114+
and MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.55.0/specification/trace/api.md#span).
115115
116116
**Span kind** SHOULD be `CLIENT` and MAY be set to `INTERNAL` on spans representing
117117
call to models running in the same process. It's RECOMMENDED to use `CLIENT` kind

0 commit comments

Comments
 (0)