Skip to content

ActivitySource vs DiagnosticSource #4421

Answered by utpilla
aunikitin asked this question in Q&A
Discussion options

You must be logged in to vote

I asked guys from npgsql about this and they said that it's better to implement it by myself using their ActivitySource (NpgsqlActivitySource).

If they have told you to use their ActivitySource, there are two obvious approaches to achieving what you want:

  1. You could either create an ActivityListener and configure it accordingly to listen to the activities created by their ActivitySource. With this approach, you would have to be careful with the order of registration of ActivityListeners (as OpenTelemetry Tracing SDK also creates its own ActivityListener) and ensure that you don't mess up with the sampling of activitites.

  2. You could use a custom processor that would emit the required m…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@aunikitin
Comment options

@aunikitin
Comment options

Answer selected by aunikitin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants