Skip to content

[shippingservice] fix context propagation#1433

Merged
austinlparker merged 18 commits intoopen-telemetry:mainfrom
julianocosta89:shippingservice-fix-context-prop
Apr 2, 2024
Merged

[shippingservice] fix context propagation#1433
austinlparker merged 18 commits intoopen-telemetry:mainfrom
julianocosta89:shippingservice-fix-context-prop

Conversation

@julianocosta89
Copy link
Copy Markdown
Member

@julianocosta89 julianocosta89 commented Mar 5, 2024

Changes

Fix #1318.

image

As I was touching this service I've refactored the code to make it more readable.

Merge Requirements

For new features contributions please make sure you have completed the following
essential items:

  • CHANGELOG.md updated to document new feature additions
  • Appropriate documentation updates in the docs
  • Appropriate Helm chart updates in the helm-charts

Maintainers will not merge until the above have been completed. If you're unsure
which docs need to be changed ping the
@open-telemetry/demo-approvers.

@julianocosta89 julianocosta89 requested a review from a team March 5, 2024 16:59
@julianocosta89 julianocosta89 added helm-update-required Requires an update to the Helm chart when released docs-update-required Requires documentation update labels Mar 5, 2024
@julianocosta89
Copy link
Copy Markdown
Member Author

@TommyCpp would you be able to take a look at this one?

@julianocosta89
Copy link
Copy Markdown
Member Author

We need to implement some quote mock in order to run the tests, and as I'm not a Rust expert I've opted to remove the non-working tests as they were not working since we added quoteservice which is a lot!
quoteservice was added before we release v1 and it seems nobody was running the tests anyways.

@cijothomas
Copy link
Copy Markdown
Member

Will have to decide if we should rewrite this service using OTel Tracing API. It looks like its currently using an external instrumentation library which converts spans emitted using tokio/tracing crate into OTel spans. It is undecided how such usage is going to be supported going forward.

This might also explain why logs are not correlated to spans, as Spans are not produced using OTel Tracing APIs.

@TommyCpp
Copy link
Copy Markdown
Contributor

TommyCpp commented Mar 8, 2024

Sorry missed this earlier

It looks like its currently using an external instrumentation library which converts spans emitted using tokio/tracing crate into OTel spans

It's a third party instrument on http clients IIRC. Probably better if we rewrite to handle the propagation ourselfs

@austinlparker
Copy link
Copy Markdown
Member

What's the status here, should this be merged?

Copy link
Copy Markdown
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should using tracing and not log crate, if we plan to add logging in this PR.
https://github.com/open-telemetry/opentelemetry-demo/pull/1433/files#r1516487971

or scope down to just fixing context propagation issue alone.

@cijothomas
Copy link
Copy Markdown
Member

What's the status here, should this be merged?

No. I left a blocking comment just now.

Outside of that I'd love to get some opinions from demo maintainers about the Rust app - it is NOT using OTel Tracing API, but uses tokio-tracing along with a "bridge" (maintained outside OTel repos) to map them to OTel Tracing. OTel Rust SIG is undecided on how to navigate this problem : open-telemetry/opentelemetry-rust#1571

Options:

  1. Modify shipping service to only OTel Tracing API. If OTel Rust SIG ultimately decides to sacrifice OTel Tracing API, then this requires rework.
  2. Keep the existing - but we need to add owners of the respective packages as code reviewers here. (I don't know if they have interest/time). Again, rework is require if OTel Rust SIG decides to go forward with OTel Tracing API and ignore tokio-tracing.
  3. Something else? Please share.

Either requires rework (after all, no signal is stable in OTel Rust). I'd suggest to do 1.

@open-telemetry/rust-approvers Please share your thoughts too.

@julianocosta89 julianocosta89 marked this pull request as draft March 14, 2024 21:14
@julianocosta89
Copy link
Copy Markdown
Member Author

I'll take a look at it again soon.

@austinlparker
Copy link
Copy Markdown
Member

I see. I'd probably opt for option 1 then.

@julianocosta89
Copy link
Copy Markdown
Member Author

Either requires rework (after all, no signal is stable in OTel Rust). I'd suggest to do 1.

Do we have any instrumentation library in OTel Rust ATM?
If not, I'd keep the tokio-tracing in order to demonstrate how it instruments automatically Rust code.

@cijothomas
Copy link
Copy Markdown
Member

Either requires rework (after all, no signal is stable in OTel Rust). I'd suggest to do 1.

Do we have any instrumentation library in OTel Rust ATM? If not, I'd keep the tokio-tracing in order to demonstrate how it instruments automatically Rust code.

Nothing maintained by opentelemetry.
Using tokio-tracing also requires another library (tracing-opentelemetry), not maintained by opentelemetry.

@julianocosta89 julianocosta89 marked this pull request as ready for review March 14, 2024 23:47
@julianocosta89
Copy link
Copy Markdown
Member Author

I'd say we can do that in a follow-up PR.
I've added the opentelemetry-appender-tracing and got some logs with Span and Trace ID
image

This should be good to go, and we can continue the discussion in an issue. WDYT?

@julianocosta89
Copy link
Copy Markdown
Member Author

Just my 2 cents here:

I'm in favour of getting rid of tokio-tracing.
It is really cumbersome using it and making sure all the dependencies are aligned, as they almost never are on the latest OTel rust release.

@julianocosta89
Copy link
Copy Markdown
Member Author

@cijothomas I'd appreciate if you could double check the code whenever you have some minutes.

Copy link
Copy Markdown

@hdost hdost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my perspective. I'll try running it later today.

@julianocosta89
Copy link
Copy Markdown
Member Author

@open-telemetry/rust-approvers would anyone be able to give us a green light on this one?

@austinlparker austinlparker merged commit 8ba9a1d into open-telemetry:main Apr 2, 2024
@julianocosta89 julianocosta89 deleted the shippingservice-fix-context-prop branch April 10, 2024 12:56
neamulkabiremon pushed a commit to neamulkabiremon/ultimate-devops-project-demo that referenced this pull request Apr 16, 2025
* Update dependencies and fix context propagation

* Fix TODO comments and set default quote service address

* Add OTLP logs exporter and move configuration to telemetry folder

* Add metrics conf

* Update OTEL_EXPORTER_OTLP_TRACES_ENDPOINT to OTEL_EXPORTER_OTLP_ENDPOINT

* changelog

* Use opentelemetry-appender-tracing

* Remove OTLP logs
mohamed3637 added a commit to mohamed3637/opentelemetry-demo that referenced this pull request Oct 7, 2025
* Update dependencies and fix context propagation

* Fix TODO comments and set default quote service address

* Add OTLP logs exporter and move configuration to telemetry folder

* Add metrics conf

* Update OTEL_EXPORTER_OTLP_TRACES_ENDPOINT to OTEL_EXPORTER_OTLP_ENDPOINT

* changelog

* Use opentelemetry-appender-tracing

* Remove OTLP logs
cloud-hb pushed a commit to cloud-hb/opentelemetry-demo that referenced this pull request Nov 17, 2025
* Update dependencies and fix context propagation

* Fix TODO comments and set default quote service address

* Add OTLP logs exporter and move configuration to telemetry folder

* Add metrics conf

* Update OTEL_EXPORTER_OTLP_TRACES_ENDPOINT to OTEL_EXPORTER_OTLP_ENDPOINT

* changelog

* Use opentelemetry-appender-tracing

* Remove OTLP logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-update-required Requires documentation update helm-update-required Requires an update to the Helm chart when released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ShippingService] Parent span not set properly

6 participants