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

Document how to test that you're instrumenting traces correctly #1630

Open
1 of 8 tasks
cartermp opened this issue Aug 18, 2022 · 10 comments
Open
1 of 8 tasks

Document how to test that you're instrumenting traces correctly #1630

cartermp opened this issue Aug 18, 2022 · 10 comments
Labels
docs e3-weeks Effort: < 4 weeks help wanted Extra attention is needed

Comments

@cartermp
Copy link
Contributor

cartermp commented Aug 18, 2022

Something I've seen come up a few times is: "How do I unit test that I'm adding the right attributes to a span?"

You can't test this with the tracing API because it doesn't give you access to this data. But you can depend on the "SDK trace API" in a language to get access to a read/write span.

This should probably be documented with an example in all the languages with stable tracing:

  • JS
  • Java
  • Go
  • .NET
  • Python
  • Elixir
  • Ruby
  • C++
@cartermp cartermp added docs e3-weeks Effort: < 4 weeks labels Aug 18, 2022
@svrnm svrnm added the help wanted Extra attention is needed label Aug 18, 2022
@cartermp
Copy link
Contributor Author

Some specific things that would be covered:

  • How to establish a test harness with an in-memory exporter
  • Which packages to pull in to do this testing
  • Example of a simple bit of code that does a thing with otel tracing
  • Example of a test that tests that function that does the tracing

@wildefires
Copy link

@cartermp and I have been discussing this on the pollinators slack - I'm happy to write up some docs for Go if someone would be kind enough to point me to where they should live :)

@svrnm
Copy link
Member

svrnm commented Aug 18, 2022

Put it in a subpage of https://opentelemetry.io/docs/instrumentation/go/, we can then still decide to move it somewhere else.

@akasprzok
Copy link
Contributor

I wrote a rough draft of I think what this issue is asking for in https://temporaryhack.com/blog/opentelemetry-testing, for elixir.

Happy to take some feedback on it, polish it, and submit it -- if it's what y'all are looking for.

@svrnm
Copy link
Member

svrnm commented Aug 29, 2022

I wrote a rough draft of I think what this issue is asking for in https://temporaryhack.com/blog/opentelemetry-testing, for elixir.

Happy to take some feedback on it, polish it, and submit it -- if it's what y'all are looking for.

Can you put it as a (draft) PR here? makes the review easier for us.

@akasprzok
Copy link
Contributor

I wrote a rough draft of I think what this issue is asking for in https://temporaryhack.com/blog/opentelemetry-testing, for elixir.
Happy to take some feedback on it, polish it, and submit it -- if it's what y'all are looking for.

Can you put it as a (draft) PR here? makes the review easier for us.

Done, submitted rough draft here

@cartermp
Copy link
Contributor Author

Thanks @akasprzok - your doc is live!

@svrnm
Copy link
Member

svrnm commented Sep 14, 2022

@cartermp: can we copy some of the content from elixir/erlang over to the other languages or is it too specific?

@cartermp
Copy link
Contributor Author

The content can probably be copied over easily and tweaked as needed, but the code samples will be different since setting up a test harness can vary so wildly from language to language.

@akasprzok
Copy link
Contributor

Thank you all for making my first contribution such a fantastic experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs e3-weeks Effort: < 4 weeks help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants