-
Notifications
You must be signed in to change notification settings - Fork 773
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
Add Azure collector #161
Add Azure collector #161
Conversation
src/OpenTelemetry.Collector.Azure/OpenTelemetry.Collector.Azure.csproj
Outdated
Show resolved
Hide resolved
f49ebe8
to
936e674
Compare
src/OpenTelemetry.Collector.Dependencies/AzureSdkDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
{ { "HttpHandlerDiagnosticListener", (t, s) => new HttpHandlerDiagnosticListener(t, s) } }, | ||
{ | ||
{ "HttpHandlerDiagnosticListener", (t, s) => new HttpHandlerDiagnosticListener(t, s) }, | ||
{ "Azure.Clients", (t, s) => new AzureSdkDiagnosticListener("Azure.Clients", t, sampler) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s
is not necessarily the same as sampler
- sampler could be null and this crazy lambda underneath falls back to something. So please use s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s is lambda that takes HttpRequestMessage, what do I pass into it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no I mean this lambda:
x =>
{
ISampler s = null;
try
{
s = options.CustomSampler(x);
}
catch (Exception e)
{
s = null;
DependenciesCollectorEventSource.Log.ExceptionInCustomSampler(e);
}
return s ?? sampler;
});
I.e. "Azure.Clients", (t, s) => new AzureSdkDiagnosticListener("Azure.Clients", t, sampler)
-> "Azure.Clients", (t, s) => new AzureSdkDiagnosticListener("Azure.Clients", t, s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, type of s is Func<HttpRequestMessage, ISampler>
how do I use it in my listener to get a sampler? Always pass null in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I see. sorry. let me think for a moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about this? #170
|
||
var span = this.tracer.SpanBuilder(operationName) | ||
.SetCreateChild(false) | ||
.SetSpanKind(SpanKind.Client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, by the way, this is not always right
- http spans should have kind = client
- convenience layer spans should have kind = internal
This is important for Azure Monitor and maybe other backends for better user experience.
No description provided.