Skip to content

Commit 651d779

Browse files
authored
Generate Attribute Registry using Weaver (#917)
1 parent 48f50d7 commit 651d779

File tree

140 files changed

+3339
-2551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+3339
-2551
lines changed

.chloggen/917.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
change_type: enhancement
2+
component: all
3+
4+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
5+
note: Migrate Attribute Registry to be completely autogenerated.
6+
7+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
8+
# The values here must be integers.
9+
issues: [197]
10+
11+
# (Optional) One or more lines of additional information to render under the primary note.
12+
# These lines will be padded with 2 spaces and then inserted directly into the document.
13+
# Use pipe (|) for multiline entries.
14+
subtext: |
15+
Migrate to using weaver for markdown generation (snippet + registry).
16+
The entirety of the registry now is generated using weaver with templates
17+
under the `templates/` directory. Snippets still require a hardcoded
18+
command.

.github/CODEOWNERS

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@
4242
/model/registry/url.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
4343
/model/registry/user-agent.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
4444
/docs/http/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
45-
/docs/attribute-registry/http.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
46-
/docs/attribute-registry/server.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
47-
/docs/attribute-registry/client.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
48-
/docs/attribute-registry/network.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
49-
/docs/attribute-registry/error.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
50-
/docs/attribute-registry/url.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
51-
/docs/attribute-registry/user-agent.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-http-approvers
5245

5346
# System semantic conventions approvers
5447
/docs/system/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-system-approvers
@@ -62,14 +55,11 @@
6255

6356
# K8s semantic conventions approvers
6457
/docs/resource/k8s.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
65-
/docs/attributes-registry/k8s.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
6658
/model/resource/k8s.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
6759
/model/registry/k8s.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
6860

6961
# Container semantic conventions approvers
7062
/docs/resource/container.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-container-approvers
71-
/docs/attributes-registry/container.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-container-approvers
72-
/docs/attributes-registry/oci.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-container-approvers
7363
/model/resource/container.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-container-approvers
7464
/model/registry/container.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-container-approvers
7565
/model/registry/oci.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-container-approvers
@@ -79,14 +69,11 @@
7969
/model/registry/aspnetcore.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-dotnet-approver @open-telemetry/semconv-http-approvers
8070
/model/registry/signalr.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-dotnet-approver @open-telemetry/semconv-http-approvers
8171
/docs/dotnet/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-dotnet-approver @open-telemetry/semconv-http-approvers
82-
/docs/attributes-registry/aspnetcore.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-dotnet-approver @open-telemetry/semconv-http-approvers
83-
/docs/attributes-registry/signalr.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-dotnet-approver @open-telemetry/semconv-http-approvers
8472

8573
# Gen-AI semantic conventions approvers
8674
/model/registry/gen-ai.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
8775
/model/metrics/gen-ai.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
8876
/model/trace/gen-ai.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
8977
/docs/gen-ai/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
90-
/docs/attributes-registry/llm.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
9178

9279
# TODO - Add semconv area experts

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ ol-prefix:
1212
style: ordered
1313
no-inline-html: false
1414
fenced-code-language: false
15+
no-space-in-code: false

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
/docs/**
66
!/docs/cloud*
77
!/docs/cloud*/**
8+
!/docs/attributes-registry*
9+
!/docs/attributes-registry*/**
810
/model
911
/schemas
12+
CHANGELOG.md

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ You can also take examples from past changes inside the `schemas` folder.
103103
### 2. Update the markdown files
104104

105105
After updating the YAML file(s), you need to update
106-
the respective markdown files. For this, run the following command:
106+
the respective markdown files. For this, run the following commands:
107107

108108
```bash
109-
make table-generation
109+
make table-generation attribute-registry-generation
110110
```
111111

112112
#### Hugo frontmatter

Makefile

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CHLOGGEN_CONFIG := .chloggen/config.yaml
1414
# see https://github.com/open-telemetry/build-tools/releases for semconvgen updates
1515
# Keep links in model/README.md and .vscode/settings.json in sync!
1616
SEMCONVGEN_VERSION=0.24.0
17+
WEAVER_VERSION=latest
1718

1819
# TODO: add `yamllint` step to `all` after making sure it works on Mac.
1920
.PHONY: all
@@ -95,13 +96,31 @@ yamllint:
9596
.PHONY: table-generation
9697
table-generation:
9798
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec \
98-
otel/semconvgen:$(SEMCONVGEN_VERSION) -f /source markdown -md /spec
99+
otel/weaver:${WEAVER_VERSION} registry update-markdown \
100+
--registry=/source \
101+
--attribute-registry-base-url="/docs/attributes-registry" \
102+
/spec
103+
104+
# Generate attribute registry markdown.
105+
.PHONY: attribute-registry-generation
106+
attribute-registry-generation:
107+
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec -v $(PWD)/templates:/weaver/templates \
108+
otel/weaver:${WEAVER_VERSION} registry generate \
109+
--registry=/source \
110+
--templates=/weaver/templates \
111+
markdown \
112+
/spec/attributes-registry/
113+
npm run fix:format
99114

100-
# Check if current markdown tables differ from the ones that would be generated from YAML definitions
115+
# Check if current markdown tables differ from the ones that would be generated from YAML definitions (weaver).
101116
.PHONY: table-check
102117
table-check:
103118
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec \
104-
otel/semconvgen:$(SEMCONVGEN_VERSION) -f /source markdown -md /spec --md-check
119+
otel/weaver:${WEAVER_VERSION} registry update-markdown \
120+
--registry=/source \
121+
--attribute-registry-base-url="/docs/attributes-registry" \
122+
--dry-run \
123+
/spec
105124

106125
LATEST_RELEASED_SEMCONV_VERSION := $(shell git describe --tags --abbrev=0 | sed 's/v//g')
107126
.PHONY: compatibility-check
@@ -122,14 +141,15 @@ fix-format:
122141
npm run fix:format
123142

124143
# Run all checks in order of speed / likely failure.
144+
# As a last thing, run attribute registry generation and git-diff for differences.
125145
.PHONY: check
126-
check: misspell markdownlint check-format markdown-toc compatibility-check markdown-link-check
146+
check: misspell markdownlint check-format markdown-toc compatibility-check markdown-link-check attribute-registry-generation
127147
git diff --exit-code ':*.md' || (echo 'Generated markdown Table of Contents is out of date, please run "make markdown-toc" and commit the changes in this PR.' && exit 1)
128148
@echo "All checks complete"
129149

130150
# Attempt to fix issues / regenerate tables.
131151
.PHONY: fix
132-
fix: table-generation misspell-correction fix-format markdown-toc
152+
fix: table-generation attribute-registry-generation misspell-correction fix-format markdown-toc
133153
@echo "All autofixes complete"
134154

135155
.PHONY: install-tools

docs/attributes-registry/README.md

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ linkTitle: Registry
33
weight: -2
44
--->
55

6-
# Attributes Registry
6+
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
7+
<!-- see templates/registry/markdown/readme.md.j2 -->
8+
9+
# Attribute Registry
710

811
The attributes registry is the place where attributes are defined. An attribute definition covers the following properties of an attribute:
912

@@ -28,52 +31,58 @@ All registered attributes are listed by namespace in this registry.
2831
2932
Currently, the following namespaces exist:
3033

31-
* [Android](android.md)
32-
* [AWS](aws.md)
33-
* [Browser](browser.md)
34-
* [Client](client.md)
35-
* [Cloud](cloud.md)
36-
* [CloudEvents](cloudevents.md)
37-
* [Code](code.md)
38-
* [Container](container.md)
39-
* [DB](db.md) (database)
40-
* [Deployment](deployment.md)
41-
* [Destination](destination.md)
42-
* [Device](device.md)
43-
* [Disk](disk.md)
44-
* [End user](enduser.md)
45-
* [Error](error.md)
46-
* [Event](event.md)
47-
* [Exception](exception.md)
48-
* [FaaS](faas.md)
49-
* [Feature Flag](feature-flag.md)
50-
* [File](file.md)
51-
* [Google Cloud Platform (GCP)](gcp.md)
52-
* [GraphQl](graphql.md)
53-
* [Heroku](heroku.md)
54-
* [Host](host.md)
55-
* [HTTP](http.md)
56-
* [iOS](ios.md)
57-
* [JVM](jvm.md)
58-
* [K8s](k8s.md)
59-
* [Log](log.md)
60-
* [Network](network.md)
61-
* [OCI](oci.md)
62-
* [OpenTelemetry](otel.md)
63-
* [OpenTracing](opentracing.md)
64-
* [OS](os.md)
65-
* [Peer](peer.md)
66-
* [Process](process.md)
67-
* [RPC](rpc.md)
68-
* [Server](server.md)
69-
* [Service](service.md)
70-
* [Session](session.md)
71-
* [Source](source.md)
72-
* [Telemetry](telemetry.md)
73-
* [Thread](thread.md)
74-
* [TLS](tls.md)
75-
* [URL](url.md)
76-
* [User agent](user-agent.md)
77-
* [Webengine](webengine.md)
34+
- [Android](android.md)
35+
- [Aspnetcore](aspnetcore.md)
36+
- [AWS](aws.md)
37+
- [Browser](browser.md)
38+
- [Client](client.md)
39+
- [Cloud](cloud.md)
40+
- [CloudEvents](cloudevents.md)
41+
- [Code](code.md)
42+
- [Container](container.md)
43+
- [Db](db.md)
44+
- [Deployment](deployment.md)
45+
- [Destination](destination.md)
46+
- [Device](device.md)
47+
- [Disk](disk.md)
48+
- [Dns](dns.md)
49+
- [Enduser](enduser.md)
50+
- [Error](error.md)
51+
- [Event](event.md)
52+
- [Exception](exception.md)
53+
- [Faas](faas.md)
54+
- [Feature Flag](feature-flag.md)
55+
- [File](file.md)
56+
- [GCP](gcp.md)
57+
- [Gen AI](gen-ai.md)
58+
- [GraphQL](graphql.md)
59+
- [Heroku](heroku.md)
60+
- [Host](host.md)
61+
- [HTTP](http.md)
62+
- [iOS](ios.md)
63+
- [JVM](jvm.md)
64+
- [K8s](k8s.md)
65+
- [Log](log.md)
66+
- [Messaging](messaging.md)
67+
- [Network](network.md)
68+
- [OCI](oci.md)
69+
- [OpenTracing](opentracing.md)
70+
- [OS](os.md)
71+
- [OTel](otel.md)
72+
- [Peer](peer.md)
73+
- [Process](process.md)
74+
- [RPC](rpc.md)
75+
- [Server](server.md)
76+
- [Service](service.md)
77+
- [Session](session.md)
78+
- [SignalR](signalr.md)
79+
- [Source](source.md)
80+
- [System](system.md)
81+
- [Telemetry](telemetry.md)
82+
- [Thread](thread.md)
83+
- [TLS](tls.md)
84+
- [URL](url.md)
85+
- [User Agent](user-agent.md)
86+
- [Webengine](webengine.md)
7887

7988
[developers recommendations]: ../general/attribute-naming.md#recommendations-for-application-developers

docs/attributes-registry/android.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
# Android
1+
<!--- Hugo front matter used to generate the website version of this page:
2+
--->
23

3-
<!-- toc -->
4+
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
5+
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->
46

5-
- [Android Attributes](#android-attributes)
6-
- [Deprecated Android Attributes](#deprecated-android-attributes)
7+
# Android
78

8-
<!-- tocstop -->
9+
- [Android](#android-attributes)
10+
- [Android Deprecated](#android-deprecated-attributes)
911

1012
## Android Attributes
1113

12-
<!-- semconv registry.android(omit_requirement_level) -->
13-
| Attribute | Type | Description | Examples | Stability |
14-
|---|---|---|---|---|
14+
The Android platform on which the Android application is running.
15+
16+
| Attribute | Type | Description | Examples | Stability |
17+
| ---------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------- |
1518
| `android.os.api_level` | string | Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). | `33`; `32` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
16-
<!-- endsemconv -->
1719

18-
## Deprecated Android Attributes
20+
## Android Deprecated Attributes
21+
22+
This document defines attributes that represents an occurrence of a lifecycle transition on the Android platform.
1923

20-
<!-- semconv registry.android.deprecated(omit_requirement_level) -->
21-
| Attribute | Type | Description | Examples | Stability |
22-
|---|---|---|---|---|
23-
| `android.state` | string | Deprecated use the `device.app.lifecycle` event definition including `android.state` as a payload field instead. [1] | `created` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
24+
| Attribute | Type | Description | Examples | Stability |
25+
| --------------- | ------ | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | ---------------------------------------------------------------- |
26+
| `android.state` | string | Deprecated use the `device.app.lifecycle` event definition including `android.state` as a payload field instead. [1] | `created`; `background`; `foreground` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2427

2528
**[1]:** The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived.
2629

2730
`android.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
2831

29-
| Value | Description | Stability |
30-
|---|---|---|
31-
| `created` | Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
32-
| `background` | Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
32+
| Value | Description | Stability |
33+
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
34+
| `created` | Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
35+
| `background` | Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
3336
| `foreground` | Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
34-
<!-- endsemconv -->

0 commit comments

Comments
 (0)