{"id":51025207,"url":"https://github.com/frank802/ghcp-logs-analyzer","last_synced_at":"2026-06-21T19:00:52.931Z","repository":{"id":358906464,"uuid":"1144411581","full_name":"Frank802/ghcp-logs-analyzer","owner":"Frank802","description":"A .NET 10 console application that analyzes log files for errors and automatically creates GitHub issues using the GitHub Copilot SDK and GitHub MCP Server.","archived":false,"fork":false,"pushed_at":"2026-05-19T14:19:10.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T17:22:54.264Z","etag":null,"topics":["gbb-ip-atlas","github","github-copilot","github-copilot-sdk"],"latest_commit_sha":null,"homepage":"https://frank802.github.io/ghcp-logs-analyzer/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Frank802.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-28T17:01:31.000Z","updated_at":"2026-05-19T15:42:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Frank802/ghcp-logs-analyzer","commit_stats":null,"previous_names":["frank802/ghcp-logs-analyzer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Frank802/ghcp-logs-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frank802%2Fghcp-logs-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frank802%2Fghcp-logs-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frank802%2Fghcp-logs-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frank802%2Fghcp-logs-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frank802","download_url":"https://codeload.github.com/Frank802/ghcp-logs-analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frank802%2Fghcp-logs-analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34622271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gbb-ip-atlas","github","github-copilot","github-copilot-sdk"],"created_at":"2026-06-21T19:00:51.464Z","updated_at":"2026-06-21T19:00:52.892Z","avatar_url":"https://github.com/Frank802.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Copilot Logs Analyzer\n\n\u003e [!WARNING]\n\u003e This project is experimental and under active development. Features may change without notice and the generated workflows should be reviewed carefully before use in production.\n\nA .NET 10 console application that ingests logs, analyzes them with the GitHub Copilot SDK, and creates GitHub issues through the GitHub MCP Server.\n\n🌐 **[Visit the project website →](https://frank802.github.io/ghcp-logs-analyzer/)**\n\n## Features\n\n- Supports multiple log sources:\n  - `FileSystem`: scans `.log` and `.txt` files from a folder\n  - `EventHub`: continuously reads events from Azure Event Hubs\n- Uses AI-powered analysis to identify errors, exceptions, and critical issues\n- Automatically creates GitHub issues and attempts to avoid duplicates\n- Configurable through `appsettings*.json`, environment variables, and CLI args\n\n## Architecture\n\n```mermaid\nflowchart TD\n    subgraph cfg[\"Configuration\"]\n        C1[\"CLI Args\"]\n        C2[\"Env Vars\\n(GITHUB_TOKEN, GITHUB_TARGET_REPOSITORY)\"]\n        C3[\"appsettings.Local.json\\nappsettings.json\"]\n    end\n\n    subgraph sources[\"Log Sources\"]\n        S1[\"FileSystemLogSource\\n(.log / .txt files)\"]\n        S2[\"EventHubLogSource\\n(Azure Event Hubs — continuous)\"]\n    end\n\n    subgraph app[\"ghcp-logs-analyzer (Program.cs)\"]\n        P[\"ILogSource\\n(selected by LogAnalysis:Source)\"]\n        Q[\"SemaphoreSlim\\n(MaxConcurrency gate)\"]\n        R[\"LogEntryProcessor\\n× N parallel tasks\"]\n    end\n\n    subgraph copilot[\"GitHub Copilot SDK\"]\n        D[\"CopilotClient\"]\n        E[\"Session per LogEntry\\n(Model: claude-sonnet-4.5)\"]\n    end\n\n    subgraph mcp[\"GitHub MCP Server\\napi.githubcopilot.com/mcp/\"]\n        M1[\"search_issues\\n(deduplication check)\"]\n        M2[\"create_issue\"]\n    end\n\n    GH[(\"GitHub Repository\")]\n    CON[\"Console Output\"]\n\n    cfg --\u003e|configure| app\n    S1 --\u003e|LogEntry stream| P\n    S2 --\u003e|LogEntry stream| P\n    P --\u003e Q --\u003e R\n    R --\u003e D --\u003e E\n    E \u003c--\u003e|Bearer token / HTTP| mcp\n    M1 --\u003e GH\n    M2 --\u003e GH\n    E --\u003e|AssistantMessageEvent\\nToolExecutionStartEvent| CON\n```\n\n## Prerequisites\n\n- [.NET 10 SDK](https://dotnet.microsoft.com/download)\n- [GitHub Copilot CLI](https://docs.github.com/en/copilot/github-copilot-in-the-cli) installed and available in `PATH`\n- GitHub Copilot subscription\n- GitHub Personal Access Token (PAT) with `repo` scope\n- For Event Hub mode: an Azure Event Hubs namespace and hub, plus an identity with the **Azure Event Hubs Data Receiver** role (uses `DefaultAzureCredential` — Azure CLI, managed identity, VS login, etc.)\n\n## Installation\n\n```bash\ngit clone https://github.com/Frank802/ghcp-logs-analyzer.git\ncd ghcp-logs-analyzer/src\ndotnet restore\ndotnet build\n```\n\n## Configuration\n\nCreate `src/appsettings.Local.json` (git-ignored):\n\n```json\n{\n  \"GitHub\": {\n    \"Token\": \"ghp_your_personal_access_token\",\n    \"TargetRepository\": \"owner/repo\",\n    \"Model\": \"claude-sonnet-4.5\"\n  },\n  \"LogAnalysis\": {\n    \"Source\": \"FileSystem\",\n    \"MinLevel\": \"Error\",\n    \"MaxConcurrency\": 5\n  },\n  \"FileSystem\": {\n    \"LogsFolder\": \"../sample-logs\",\n    \"SupportedExtensions\": [\".log\", \".txt\"]\n  },\n  \"EventHub\": {\n    \"FullyQualifiedNamespace\": \"\u003cnamespace\u003e.servicebus.windows.net\",\n    \"EventHubName\": \"my-event-hub\",\n    \"ConsumerGroup\": \"$Default\",\n    \"StartFromEarliest\": false\n  }\n}\n```\n\n### Source Selection\n\n- Set `LogAnalysis:Source` to `FileSystem` for folder scanning\n- Set `LogAnalysis:Source` to `EventHub` for continuous Event Hub ingestion\n\n### Key Settings\n\n| Setting | Default | Description |\n|---|---|---|\n| `GitHub:Model` | `claude-sonnet-4.5` | AI model used for analysis |\n| `LogAnalysis:MinLevel` | `Error` | Minimum severity to report (`Trace`, `Debug`, `Information`, `Warning`, `Error`, `Critical`) |\n| `LogAnalysis:MaxConcurrency` | `5` | Maximum number of log entries processed in parallel |\n| `FileSystem:LogsFolder` | `./logs` | Folder to scan in `FileSystem` mode |\n| `FileSystem:SupportedExtensions` | `.log,.txt` | Comma-separated file extensions to scan |\n\n### Environment Variables\n\n```powershell\n$env:GITHUB_TOKEN = \"ghp_your_personal_access_token\"\n$env:GITHUB_TARGET_REPOSITORY = \"owner/repo\"\n```\n\n## Usage\n\n```bash\n# Run from src/\ncd src\n\n# Use config values\ndotnet run\n\n# Override target repo and logs folder (FileSystem mode)\ndotnet run -- \u003cowner/repo\u003e [logs-folder]\n\n# Example (FileSystem)\ndotnet run -- Frank802/my-app ../sample-logs\n```\n\nNotes:\n\n- In `FileSystem` mode, the optional second CLI argument is the folder path.\n- In `EventHub` mode, hub settings are read from `EventHub:*` configuration.\n- `EventHub` mode runs continuously until interrupted (Ctrl+C).\n\n## Configuration Priority\n\n1. Command-line arguments\n2. Environment variables (`GITHUB_TOKEN`, `GITHUB_TARGET_REPOSITORY`)\n3. `appsettings.Local.json`\n4. `appsettings.json`\n\n## Running with Docker\n\n### Build\n\n```bash\ncd src\ndocker build -t ghcp-logs-analyzer .\n```\n\n### Run (FileSystem source)\n\n```bash\ndocker run --rm \\\n  -v /path/to/your/logs:/logs \\\n  -v ~/.config/github-copilot:/root/.config/github-copilot:ro \\\n  -e GITHUB_TOKEN=ghp_your_personal_access_token \\\n  -e GITHUB_TARGET_REPOSITORY=owner/repo \\\n  ghcp-logs-analyzer owner/repo /logs\n```\n\n### Run (EventHub source)\n\n```bash\ndocker run --rm \\\n  -v ~/.config/github-copilot:/root/.config/github-copilot:ro \\\n  -e GITHUB_TOKEN=ghp_your_personal_access_token \\\n  -e GITHUB_TARGET_REPOSITORY=owner/repo \\\n  -e LogAnalysis__Source=EventHub \\\n  -e EventHub__FullyQualifiedNamespace=\"\u003cnamespace\u003e.servicebus.windows.net\" \\\n  -e EventHub__EventHubName=\"my-event-hub\" \\\n  ghcp-logs-analyzer\n```\n\n## How It Works\n\n1. Reads logs from the configured source (`FileSystem` or `EventHub`)\n2. Filters entries to the configured minimum severity level (`LogAnalysis:MinLevel`)\n3. Dispatches each log entry to a dedicated Copilot session, up to `MaxConcurrency` in parallel\n4. Each session analyzes the entry, checks for duplicate issues, then creates a GitHub issue via the GitHub MCP Server\n5. Streams assistant output and tool activity to the console\n\n## Project Structure\n\n```\nghcp-logs-analyzer/\n├── src/\n│   ├── Program.cs              # App entry point and source selection\n│   ├── ILogSource.cs           # Log source abstraction + LogEntry record\n│   ├── FileSystemLogSource.cs  # Local file-based log source\n│   ├── EventHubLogSource.cs    # Azure Event Hubs log source\n│   ├── LogEntryProcessor.cs    # Per-entry Copilot session + issue creation\n│   ├── appsettings.json        # Default configuration template\n│   ├── appsettings.Local.json  # Local secrets/config (git-ignored)\n│   ├── Dockerfile              # Docker image definition\n│   └── GhcpLogsAnalyzer.csproj # Project file\n├── sample-logs/                # Sample file logs for testing\n└── README.md\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrank802%2Fghcp-logs-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrank802%2Fghcp-logs-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrank802%2Fghcp-logs-analyzer/lists"}