Skip to content

OpenTelemetry and Hosted Services #208

@grzegorzorwat

Description

@grzegorzorwat

When I was using the ECommerce sample as a training ground for adding OpenTelemetry to microservices, I found that some of the activities created in Hosted Services weren't exported. As it turned out, those activities were created before OpenTelemetry registered its exporters. I described it in more detail on StackOverflow.

In the case of the ECommerce sample, it is the easiest to notice this problem when the microservice, that is Kafka consumer, is turned off when a new message is produced. Then when it starts, it consumes the message and tries to create an activity for it, but it can't as OpenTelemetry didn't register its exporters yet.

I can create PR, but first, I would like to hear from you if you want it and which solution I described best fits your code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions