open-telemetry / opentelemetry-erlang

OpenTelemetry Erlang SDK
https://opentelemetry.io
Apache License 2.0
324 stars 100 forks source link

Suggestions for docs to work on #557

Open tsloughter opened 1 year ago

tsloughter commented 1 year ago

I'm opening this issue both to list some of my thoughts on needed docs and to solicit suggestions on what docs people would like to see. These apply both to the website's Erlang docs, https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/erlang, and hex.pm docs, mainly focusing on the API https://hexdocs.pm/opentelemetry_api/readme.html and SDK https://hexdocs.pm/opentelemetry/readme.html

I'll keep adding as I find more.

albertored commented 1 year ago

I think a big step forward would be to define a list of modules/functions that we want to be exposed to users, add a description to all of them and hide from hex.pm all other internal functions since at the moment all modules/functions are exposed and mostly of them are without any description.

tsloughter commented 1 year ago

Agreed.

whatyouhide commented 5 months ago

I’m picking this back up as I think right now it's the biggest issue with opentelemetry-erlang docs: it's really hard to figure out what's the API that end users are supposed to use.

So, for Erlang in opentelemetry_api, I think what we want to be public is:

What about the otel_propagator* ones? Or otel_tracer_noop/otel_tracer_provider? I don't want to go too deep into this... small steps 🙃

tsloughter commented 5 months ago

I think all propagator ones need to be shown. It is a little awkward since only otel_propagator_text_map is to be called but the others give you the name of the module to use when configuring which propagator to use.

The tracer provider should be public too. We just need better docs around what it is and how to (rarely) use it bc it is used indirectly in our case. Technically you get a Tracer from calling TracerProvider and then use that Tracer to start a span, but we macro around that for the common case of wanting a Tracer from the global Provider named for the current Application.

otel_tracer_noop shouldn't be called by the user but may be used in configuration, so that is a tossup.

whatyouhide commented 5 months ago

@tsloughter good call. We can easily show all the propagator modules and otel_tracer_noop, just hide all the functions in them, so that it's clear that users are not meant to call them?

tsloughter commented 5 months ago

Sounds good.