Add public API to retrieve trace parent header.#956
Conversation
|
💚 CLA has been signed |
|
Couldn't find which place I should add the unit test, does someone has any suggestion? I think there isn't a test case for public API. |
|
Hey @diegosperes. This looks like a nice addition to the public API! You're right, the testing for public APIs isn't very extensive, but there are a few here that might serve as inspiration: apm-agent-python/tests/instrumentation/transactions_store_tests.py Lines 363 to 442 in 65e8b7c It would also be great if you could add an entry in the traceparent docs here: https://github.com/elastic/apm-agent-python/blob/master/docs/api.asciidoc#traceparent. |
|
@beniwohli thanks for guide me, I added a few missing test to the public API also a new entry for this function in the traceparent docs. |
💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
* Add public API to retrieve trace parent header. * Exposing get_trace_parent_header function * Add missing tests for public api. * Add get_trace_parent_header in the traceparent docs.
What does this pull request do?
Add a new public API to easily return the trace parent header of the current transaction, currently it's necessary to dig into the project and understand how it works.
Code necessary to get the current trace parent header without the new function.
Related issues
#954