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

(feat) Migrate all markdown generation to use JINJA snippets #1000

Merged
merged 52 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4c5619a
Update makefile so weaver generates ALL snippets using templates.
jsuereth May 2, 2024
92761a4
Update snippet templates to be more accurate.
jsuereth May 2, 2024
ca094cc
Run table generation.
jsuereth May 2, 2024
1990a9f
Update to use new sorting for attributes.
jsuereth May 3, 2024
8b9263b
Cleanup some whitespace issues.
jsuereth May 3, 2024
e4d209c
Appropriately render instrument types.
jsuereth May 3, 2024
350fb4a
Fix attribute registry links.
jsuereth May 3, 2024
cc54cb7
Add tag filtering to template.
jsuereth May 3, 2024
7df545f
Also filter enums by tag.
jsuereth May 3, 2024
f0931af
Fix enum table values.
jsuereth May 3, 2024
e1eb1c4
Share enum table macro between registry and snippets.
jsuereth May 3, 2024
72548c0
Remove odd passing of dependency.
jsuereth May 3, 2024
3119f1d
Fix requirement level.
jsuereth May 3, 2024
092be4e
Update requirement to optionally do notes.
jsuereth May 3, 2024
68fd3f5
Update snippet start/end.
jsuereth May 3, 2024
8412a09
Fix example ordering logic.
jsuereth May 4, 2024
d80446c
remove some unneeded whitespace.
jsuereth May 4, 2024
bdecec7
Remove another whitespace issue.
jsuereth May 4, 2024
2fd885c
Remove newline on enum table template.
jsuereth May 4, 2024
c6a4d27
Fix enum table to use id instead of value when no description.
jsuereth May 4, 2024
b5d99ec
more attempted whitespace fixes and cleanups.
jsuereth May 4, 2024
b86530d
Fix more whitespace issues around enum tables.
jsuereth May 4, 2024
6f244c2
Disbale markdown linter on autogen code.
jsuereth May 4, 2024
e934db7
update table check to use jinja templates.
jsuereth May 4, 2024
c2bb2f6
Actually disable markdown lint on snippets.
jsuereth May 4, 2024
e0d5dc3
Fix markdownlint enable/disable.
jsuereth May 4, 2024
b0cbc77
Add changelog.
jsuereth May 4, 2024
613292e
Merge remote-tracking branch 'origin/main' into wip-weaver-snippet-ge…
jsuereth May 4, 2024
8b5c7ad
Fix merge issues.
jsuereth May 4, 2024
009106d
Fix enum filtering and not rendering empty tables.
jsuereth May 6, 2024
0631394
Add sampling relevant attributes.
jsuereth May 6, 2024
5c1b4e2
Move sampling relevant sections to the right location.
jsuereth May 6, 2024
a831fd5
Clean up enum table rendering.
jsuereth May 6, 2024
e8e789f
Merge remote-tracking branch 'origin/main' into wip-weaver-snippet-ge…
jsuereth May 6, 2024
f2e7a39
Fixes from merge of main.
jsuereth May 6, 2024
0aed8ba
Merge remote-tracking branch 'origin/main' into wip-weaver-snippet-ge…
jsuereth May 7, 2024
086a4ad
Fix markdown from latest merge.
jsuereth May 7, 2024
d9ea0a2
Clean up templates to use more macros in consistent locatoins.
jsuereth May 7, 2024
391c736
Sort sampling relevant attributes for consistent rendering.
jsuereth May 7, 2024
c98339e
Merge main.
jsuereth May 7, 2024
03d5b6f
Merge main.
jsuereth May 7, 2024
b2801c9
Fix sorting for sampling attributes to be stable.
jsuereth May 7, 2024
4d6994d
Merge remote-tracking branch 'origin/main' into wip-weaver-snippet-ge…
jsuereth May 7, 2024
bead7e1
merge main.
jsuereth May 9, 2024
b201acd
Pull in fix for markdown snippet id parsing.
jsuereth May 9, 2024
cb699b9
Merge main.
jsuereth May 9, 2024
f2daaee
Merge main.
jsuereth May 13, 2024
ba22e4b
Add end of lines to macros files.
jsuereth May 13, 2024
a41e88f
Render event names again.
jsuereth May 13, 2024
c2076be
Fix event name logic.
jsuereth May 14, 2024
3ded9df
Update docs to link to weaver for markdown gen
jsuereth May 15, 2024
1e94921
Fix link
jsuereth May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chloggen/1000.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
change_type: enhancement

component: all

note: Markdown snippets are now generated by jinja templates in the `templates` directory.

issues: [1000]
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ yamllint:
# Generate markdown tables from YAML definitions
.PHONY: table-generation
table-generation:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec --pull=always \
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec -v $(PWD)/templates:/weaver/templates --pull=always \
otel/weaver:${WEAVER_VERSION} registry update-markdown \
--registry=/source \
--attribute-registry-base-url=/docs/attributes-registry \
--templates=/weaver/templates \
--target=markdown \
/spec

# Generate attribute registry markdown.
Expand All @@ -115,10 +117,12 @@ attribute-registry-generation:
# Check if current markdown tables differ from the ones that would be generated from YAML definitions (weaver).
.PHONY: table-check
table-check:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec --pull=always \
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec -v $(PWD)/templates:/weaver/templates --pull=always \
otel/weaver:${WEAVER_VERSION} registry update-markdown \
--registry=/source \
--attribute-registry-base-url=/docs/attributes-registry \
--templates=/weaver/templates \
--target=markdown \
--dry-run \
/spec

Expand Down
18 changes: 9 additions & 9 deletions docs/attributes-registry/aspnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

ASP.NET Core attributes

| Attribute | Type | Description | Examples | Stability |
| ----------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------- |
| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled`; `skipped` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.rate_limiting.result` | string | Rate-limiting result, shows whether the lease was acquired or contains a rejection reason | `acquired`; `endpoint_limiter`; `global_limiter` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.request.is_unhandled` | boolean | Flag indicating if request was handled by the application pipeline. | `true` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.routing.is_fallback` | boolean | A value that indicates whether the matched route is a fallback route. | `true` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.routing.match_status` | string | Match result - success or failure | `success`; `failure` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| Attribute | Type | Description | Examples | Stability |
| ----------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ---------------------------------------------------------- |
| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
trisch-me marked this conversation as resolved.
Show resolved Hide resolved
| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.rate_limiting.result` | string | Rate-limiting result, shows whether the lease was acquired or contains a rejection reason | `acquired`; `request_canceled` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
trisch-me marked this conversation as resolved.
Show resolved Hide resolved
| `aspnetcore.request.is_unhandled` | boolean | Flag indicating if request was handled by the application pipeline. | `true` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.routing.is_fallback` | boolean | A value that indicates whether the matched route is a fallback route. | `true` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `aspnetcore.routing.match_status` | string | Match result - success or failure | `success`; `failure` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

`aspnetcore.diagnostics.exception.result` 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.

Expand Down
4 changes: 2 additions & 2 deletions docs/attributes-registry/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ This document defines attributes for AWS Elastic Container Service (ECS).

| Value | Description | Stability |
| --------- | ----------- | ---------------------------------------------------------------- |
| `ec2` | none | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fargate` | none | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `ec2` | ec2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `fargate` | fargate | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## Aws Eks Attributes

Expand Down
2 changes: 1 addition & 1 deletion docs/attributes-registry/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A container instance.
| `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `otelcontribcol, --config, config.yaml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.cpu.state` | string | The CPU state for this data point. | `user`; `system`; `kernel` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.cpu.state` | string | The CPU state for this data point. | `user`; `kernel` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
Loading
Loading