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

Fix Azure SDK activity sources and minor fixes #163

Merged
merged 5 commits into from
Oct 10, 2023

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Oct 9, 2023

Azure SDK uses <packageName>.<clientName> convention for activity sources and recommends enabling <packageName>.* sources by default (to avoid listing multiple possible clients that are not always used directly by developers).

See Azure/azure-sdk-for-net#31921 and Azure/azure-sdk-for-net#39166 for the context.

This change

  • updates ActivitySource names to follow convention
  • removes custom processing activity from samples
  • updates minor doc issues

Things work just fine:

image

@@ -6,10 +6,6 @@ namespace OrderProcessor;

public class OrderProcessingWorker : BackgroundService
{
public static readonly string ActivitySourceName = "Worker";

public static ActivitySource ActivitySource { get; } = new ActivitySource(ActivitySourceName);
Copy link
Member

Choose a reason for hiding this comment

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

Why are you removing the custom ActivitySource here? I don't think we would want user code to add random tags to Activities that are already established.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's duplication and perf hit. Also, I see no problem with random tags on ServiceBus activity - this is a common pattern people do.

Copy link
Member

@eerhardt eerhardt Oct 9, 2023

Choose a reason for hiding this comment

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

Because it's duplication

It's not duplication. If this were a real app, you would want to be able to isolate your business logic's trace information. If there were multiple queues, i.e. for other workflows, I would need to search all the queue processors when looking for my order processing traces.

Copy link
Contributor Author

@lmolkova lmolkova Oct 10, 2023

Choose a reason for hiding this comment

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

Because it's duplication

It's not duplication. If this were a real app, you would want to be able to isolate your business logic's trace information. If there were multiple queues, i.e. for other workflows, I would need to search all the queue processors when looking for my order processing traces.

I can still query for SB consumer spans coming from specific SB/entity. I don't think there is a universal answer here.
We hopefully wouldn't recommend adding activity per controller call only to report business-logic part.

image

with custom activity, we'd report extra span to backend which start time/duration/status/extra context are already reported by SB activity. Users pay for it (~$2 per GB). Is clean separation between business and tech telemetry worth it?

May be, but this is a sample code, those who need it can create extra activity. I'd say it's not justified by default.

Copy link
Member

Choose a reason for hiding this comment

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

Agree, an activity shouldn't be needed in this case if the sdk is already making one per message.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

Thanks for the fix here, @lmolkova.

@eerhardt eerhardt merged commit 2fb1356 into dotnet:main Oct 10, 2023
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants