open-telemetry / weaver

OTel Weaver lets you easily develop, validate, document, and deploy semantic conventions
Apache License 2.0
55 stars 19 forks source link

Improve documentation for semconv and template authors #385

Open lquerel opened 1 month ago

lquerel commented 1 month ago

Describe in detail each Jinja2 filter, function, and test (both those defined in Minijinja and in Weaver).

We could also create an mdBook that we will progressively update to include not only Jinja2-related documentation but also configuration files, JQ filters, Rego-based policies, and more.

Victorsesan commented 1 month ago

Can you assign this to me? I would like to give it a try

lquerel commented 1 month ago

@Victorsesan done. Thank you!

Victorsesan commented 1 month ago

@lquerel Is there an alternative documentation tool we can use other than mdBook? I'm currently having some trouble setting up the latest version of rust on my console. Also is there any good reference you can direct me to on how you want the documentations to look like . thanks

lquerel commented 1 month ago

@Victorsesan If mdBook doesn’t work for you, we can continue with simple markdown pages like we’ve done so far. That’s perfectly fine. Regarding the documentation and its format, I think the most urgent thing at the moment is to better document the custom filters, functions, and tests supported by the template engine (MiniJinja). The current documentation provides a list but doesn’t show the supported arguments or provide usage examples.

For each filter/function/test, we could have:

The source code present in this directory will answer most of the above points.

Regarding the examples, the best is probably to look at the existing templates implemented by the various client SDK (see the list here) and to some extent the unit tests in the directory previously mentioned before.