Add comprehensive telemetry to all content providers#525
Add comprehensive telemetry to all content providers#525
Conversation
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements comprehensive telemetry (logging and metrics) across all content providers to improve observability and debugging capabilities. The changes add structured logging for connection lifecycle events and message discovery, plus metrics tracking for message counts and provider health status.
Key changes:
- Enhanced ProviderInstrumentation with connection status tracking and gauges
- Added consistent telemetry to all 8 content providers (Bluesky, Twitter, Blazot, YouTube, YouTubeChat, AzureQueue, Mastodon, TwitchChat)
- Integrated new telemetry meter into OpenTelemetry configuration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/TagzApp.ServiceDefaults/Extensions.cs | Registers the new telemetry meter with OpenTelemetry |
| src/TagzApp.Common/Telemetry/ProviderInstrumentation.cs | Adds connection status tracking capabilities with counters and gauges |
| src/TagzApp.Providers.Youtube/YoutubeProvider.cs | Implements telemetry logging and metrics for YouTube provider |
| src/TagzApp.Providers.YouTubeChat/YouTubeChatProvider.cs | Implements telemetry logging and metrics for YouTube Chat provider |
| src/TagzApp.Providers.Twitter/TwitterProvider.cs | Implements telemetry logging and metrics for Twitter provider |
| src/TagzApp.Providers.TwitchChat/TwitchChatProvider.cs | Implements telemetry logging and metrics for Twitch Chat provider |
| src/TagzApp.Providers.Mastodon/MastodonProvider.cs | Implements telemetry logging and metrics for Mastodon provider |
| src/TagzApp.Providers.Bluesky/BlueskyProvider.cs | Implements telemetry logging and metrics for Bluesky provider |
| src/TagzApp.Providers.Blazot/BlazotProvider.cs | Implements telemetry logging and metrics for Blazot provider |
| src/TagzApp.Providers.AzureQueue/AzureQueueProvider.cs | Implements telemetry logging and metrics for Azure Queue provider |
|
@copilot Let's also enhance our copilot instructions files to indicate that new content providers should also provide telemetry using this technique so that we have standard metrics |
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Done! I've updated both documentation files to include comprehensive telemetry requirements:
All future providers will now have clear guidance on implementing the standard telemetry pattern. Commit: c37b34a (documentation updates in subsequent commit) |
Overview
This PR implements comprehensive logging and metrics reporting across all content providers (Bluesky, Twitter, Blazot, YouTube, YouTubeChat, AzureQueue, Mastodon, and TwitchChat) to improve observability and debugging capabilities.
Changes Made
Enhanced ProviderInstrumentation Class
Added new telemetry capabilities to
TagzApp.Common.Telemetry.ProviderInstrumentation:Provider Updates
Updated all 8 content providers to include:
Logging:
Metrics:
Example logging output:
OpenTelemetry Integration
tagzapp-provider-metricsmeter toTagzApp.ServiceDefaultsconfigurationDocumentation Updates
Added comprehensive telemetry requirements to guide future provider implementations:
.github/copilot-instructions.md: Added "Telemetry Requirements" section with:doc/Provider-Configuration-Pattern.md: Added detailed "Telemetry Requirements" section with:Benefits
Testing
Example Metrics
Operators can now query metrics like:
messages-received{provider="twitter", author="@user"}- Message counts per provider/authorconnection-status-changes{provider="bluesky", status="Healthy"}- Status transition eventsconnection-status{provider="mastodon"}- Current health statusFixes #522
Original prompt
Fixes #522
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.