Skip to content

Commit ce6afc7

Browse files
committed
Clarifying hosted services inside .NET Core
1 parent 272135f commit ce6afc7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

articles/azure-monitor/app/worker-service.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,18 @@ If you want to disable telemetry conditionally and dynamically, you may resolve
529529

530530
## Frequently asked questions
531531

532+
### Which package should I use?
533+
534+
| .Net Core app scenario | Package |
535+
|---------|---------|
536+
| Without HostedServices | AspNetCore |
537+
| With HostedServices | AspNetCore (not WorkerService) |
538+
| With HostedServices, monitoring only HostedServices | WorkerService (rare scenario) |
539+
540+
### Can HostedServices inside a .NET Core app using the AspNetCore package have TelemetryClient injected to it?
541+
542+
* Yes. The config will be shared with the rest of the web application.
543+
532544
### How can I track telemetry that's not automatically collected?
533545

534546
Get an instance of `TelemetryClient` by using constructor injection, and call the required `TrackXXX()` method on it. We don't recommend creating new `TelemetryClient` instances. A singleton instance of `TelemetryClient` is already registered in the `DependencyInjection` container, which shares `TelemetryConfiguration` with rest of the telemetry. Creating a new `TelemetryClient` instance is recommended only if it needs a configuration that's separate from the rest of the telemetry.
@@ -584,6 +596,6 @@ For the latest updates and bug fixes, [consult the release notes](./release-note
584596
## Next steps
585597

586598
* [Use the API](./api-custom-events-metrics.md) to send your own events and metrics for a detailed view of your app's performance and usage.
587-
* [Track additional dependencies not automatically tracked](./auto-collect-dependencies.md).
599+
* [Track more dependencies not automatically tracked](./auto-collect-dependencies.md).
588600
* [Enrich or Filter auto collected telemetry](./api-filtering-sampling.md).
589601
* [Dependency Injection in ASP.NET Core](/aspnet/core/fundamentals/dependency-injection).

0 commit comments

Comments
 (0)