Add OpenTelemetry.Hosting#275
Conversation
| services.AddLoggingTracer(); | ||
| services.AddOpenTelemetry(() => | ||
| { | ||
| var tracerFactory = new LoggingTracerFactory(); |
There was a problem hiding this comment.
Usually you would use the builder overload. Because this sample completely re-implements the factory, it and the collectors have to be created manually.
|
Looks awesome! |
|
Let's keep it open till Monday so everyone has a chance to look |
|
@JamesNK if you don't mind, could you please resolve some merge conflicts? We also moved usings outside of namespace and new files might need to be changed too. |
bruno-garcia
left a comment
There was a problem hiding this comment.
LGTM. One nit is that unfortunately the overloads with Func<IServiceProvider, TraceFactoryBase> are not covered by tests
|
I'm at NDC Sydney this week. I should find some time to look at it, I just don't know when. |
|
@JamesNK no problem, take your time |
|
@JamesNK do you mind if I'd merge for you? |
|
Be my guest. I was planning to add xml docs to the new APIs, but that can be in a later PR. |
|
Merge pls 🙏 |
Replaces #253. Now uses the new factory API.
OpenTelemetry.Hosting now does a lot less. Its purpose is registering
TracerFactoryBaseinstance with DI, and starting it with the host.TelemetryFactoryHostedServicecreates the factory when the host is started. If the factory and its collectors can be created immediately inConfigureServicethenTelemetryFactoryHostedServicecould be removed.