{"id":26678193,"url":"https://github.com/telexintegrations/telexapm-for-dotnet","last_synced_at":"2025-03-26T05:15:11.119Z","repository":{"id":279082417,"uuid":"935067744","full_name":"telexintegrations/telexAPM-for-dotnet","owner":"telexintegrations","description":"🌟 Telex APM – Global Error Tracking \u0026 Performance Monitoring for .NET. Lightweight APM SDK for .NET applications (ASP.NET Core \u0026 standalone C#). Tracks errors \u0026 performance automatically. 🚀","archived":false,"fork":false,"pushed_at":"2025-02-23T16:24:21.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T17:30:28.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/telexintegrations.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}},"created_at":"2025-02-18T21:12:33.000Z","updated_at":"2025-02-23T16:24:25.000Z","dependencies_parsed_at":"2025-02-23T17:30:49.472Z","dependency_job_id":"f09d9a76-67d3-4a9a-9d06-8c4217de3449","html_url":"https://github.com/telexintegrations/telexAPM-for-dotnet","commit_stats":null,"previous_names":["telexintegrations/telexapm-for-dotnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FtelexAPM-for-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FtelexAPM-for-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FtelexAPM-for-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FtelexAPM-for-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telexintegrations","download_url":"https://codeload.github.com/telexintegrations/telexAPM-for-dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245591533,"owners_count":20640692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-03-26T05:15:09.781Z","updated_at":"2025-03-26T05:15:11.066Z","avatar_url":"https://github.com/telexintegrations.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TelexAPM SDK for c#(dotnet)\n\n## Overview\n\n🌟 Telex APM – Global Error Tracking \u0026 Performance Monitoring for .NET. Lightweight APM SDK for .NET applications (ASP.NET Core \u0026 standalone C#). Tracks errors \u0026 performance automatically. 🚀\n\n## Features\n\n- 📚 Global Error Tracker/Reporting to Telex Channel\n- ✅ Performance Tracker/Reporting to Telex Channel\n- 🧪 Unit test coverage\n- 📝 SDK documentation\n- 🌎 ASP.NET Core Extensions and Middleware (Supports Dependency Injection)\n\n## Project Structure\n\n```\ntelexapm-for-dotnet/\n├── TelexAPM/\n│   ├── Extensions/                           #ASP.NET Core Extensions\n│   │   ├── AddTelex.cs                       #Service Registration for containers - DI injections\n│   │   ├── AspNetCoreExtensions.cs           #Configure to UseTelex middleware\n│   │   └──TelexMiddleware.cs\n│   │\n│   ├── Models/                               #Models for Data to be sent\n│   │   ├── ErrorReport.cs\n│   │   ├── PerformanceReport.cs\n│   │   ├── SuccessReport.cs\n│   │   └── WebhookPayload.cs\n│   │\n│   ├── Services/                             #MTelex APM Core Services\n│   │   ├── BaseTracker.cs                    #Internal - Clients should  not access this directly\n│   │   ├── ErrorTracker.cs                   #Internal - Clients should  not access this directly\n│   │   ├── PerformanceTracker.cs             #Internal - Clients should  not access this directly\n│   │   └── TelexClient.cs                    #Public API - Accessible to Clients\n|   |\n|   ├── TelexAPM.ConsoleTest/                 #Models for Data to be sent\n│   │   ├── appsettings.json\n│   │   ├── Program.cs\n│   │   └── TelexApm.ConsoleTest.csproj\n│   ├── TelexAPM.csproj\n│\n├── TelexAPM.Tests/\n│   ├── TelexMiddlewareTest.cs               # API endpoint tests\n│   └── TelexAPM.Test.csproj\n├── telexAPM-for-dotnet.sln                  # telexAPM-for-dotnet.sln\n└── README.md\n```\n\n## Technologies Used\n\n- C#\n- ASP.NET Core\n- XUnit\n\n## Installation\n\n### Step 1: Add TelexAPM Reference to Your Project\n\nSince Telex is currently in build mode - this SDK is not yet published to NuGet, you'll need to reference it directly from GitHub in your project file.\n\n```bash\ngit clone https://github.com/telexintegrations/telexAPM-for-dotnet.git\ncd telexAPM-for-dotnet\n```\n\n### Step 2: Reference TelexAPM in Your Project\n\n-Add a reference to TelexAPM in your project file:\nProject Reference (preferred during development)\nIn your .csproj file, add:\n\n```xml\n\u003cItemGroup\u003e\n  \u003cProjectReference Include=\"path/to/cloned/TelexAPM/src/TelexAPM.csproj\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\n    You can check the csproj file in the TelexAPM.ConsoleTest Directory\n\n### Step 3: Configure TelexAPM\n\nConfiguration in appsettings.json\nAdd the following section to your appsettings.json file:\n\n```json\n{\n  \"Telex\": {\n    \"BaseUrl\": \"ping.telex.im/v1/webhooks\", #this must be telex base-url for channels\n    \"ChannelHookId\": \"YOUR_CHANNEL_HOOK_ID\"\n  }\n}\n```\n\n- Usage\n  - Console Applications\n\n```cs\nusing TelexAPM.Services;\nusing Microsoft.Extensions.Configuration;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        // Config builder - setting appsettings as config file\n        var Config = new ConfigurationBuilder()\n            .SetBasePath(Directory.GetCurrentDirectory())\n            .AddJsonFile(\"appsettings.json\", optional: true, reloadOnChange: true)\n            .Build();\n\n        TelexConfiguration telexConfig = GetTelexConfig(Config);\n        await Test(telexConfig);\n    }\n\n    public static async Task Test(TelexConfiguration telexConfig)\n    {\n        TelexClient telex = new(telexConfig);\n        var x = new Exception(\"Console Test Telex Error\");\n        await telex.TrackErrorAsync(x);\n        Console.WriteLine(\"test done\");\n    }\n\n    public static TelexConfiguration GetTelexConfig(IConfigurationRoot config)\n    {\n        TelexConfiguration telexConfig = new()\n        {\n            BaseUrl = config[\"Telex:BaseUrl\"],\n            ChannelHookId = config[\"Telex:ChannelHookId\"],\n        };\n        return telexConfig;\n    }\n}\n```\n\n- Usage\n  - ASP.NET cORE applications:\n    Step 1: Register TelexAPM Services\n    In your Program.cs or Startup.cs, add TelexAPM services:\n\n```cs\n    using TelexApm.Extensions;\n\n// ...\nservices.AddTelex(Configuration); // Dependency Container\n```\n\n    Step 2: Use TelexAPM Middleware\n    Add the TelexAPM middleware to your application pipeline:\n\n```cs\nusing TelexAPM.Extensions;\n\n// ...\n\napp.UseTelex();\n```\n\n## API Reference\n\n### TelexClient\n\nThe main client for interacting with TelexAPM.\n\n```cs\n    // Create a new TelexClient\nTelexClient telex = new(telexConfig);\n\n// Track an error\nawait telex.TrackErrorAsync(exception);\n\n// Track performance\nawait telex.TrackPerformanceAsync(\"Operation Name\", timeSpan);\n```\n\n### TelexConfiguration\n\n| Property        | Description                              |\n| --------------- | ---------------------------------------- |\n| `BaseUrl`       | The base URL of the Telex service        |\n| `ChannelHookId` | The channel hook ID for your application |\n\n\n## Test Integration (HNG Mentors)\n\nTo test the integration, follow these steps:\n\n### 1. Navigate to the Console Test Folder  \nOpen a terminal and change the directory to the `TelexAPM.ConsoleTest` folder:\n\n```sh\ncd TelexAPM/TelexAPM.ConsoleTest\n```\n\n### 2. Create the `appsettings.json` File  \n\nInside the `TelexAPM.ConsoleTest` folder, create a file named `appsettings.json` and add the following content:\n\n\nRun the following command in your terminal to create and edit the file:\n```sh\nnano appsettings.json\n```\nThen, paste the following JSON configuration:\n```json\n{\n  \"Telex\": {\n    \"BaseUrl\": \"ping.telex.im/v1/webhooks\", #this must be telex base-url for channels\n    \"ChannelHookId\": \"YOUR_CHANNEL_HOOK_ID\"\n  }\n}\n```\nReplace \"YOUR_CHANNEL_HOOK_ID\" with the actual channel hook ID.\n\n### 3. Run the Application  \n\nOnce the `appsettings.json` file is in place, execute the following command to run the console test:\n\n```sh\ndotnet run\n```\n\n\n## Telex Integration/Channel Configuration\n\nTelexAPM includes extensions for easy integration with ASP.NET Core applications and Standalone applications\n\nThe APM automatically tracks request performance and catches unhandled exceptions and report/sends to your Telex Channel\n\n\n## 📸 Screenshots\n\n### Test Code\n![Test Code](https://dotnet-apm.onrender.com/IMG_2897.jpeg)\n\n### Message Screenshot In Telex\n![Telex Screenshot](https://dotnet-apm.onrender.com/IMG_2895.jpeg)\n\n\n## 🚀 Telex Dotnet APM Integration Guide\n\nFollow these steps to configure your Telex channel to use the Dotnet APM:\nThis assumes you have an organisation and channel created!\n\n---\n\n### 🛠️ Step 1: Install the Dotnet APM Application\n\n- Go to your **Telex dashboard**.\n- Install the **Dotnet APM** application:\n  - The application url: https://dotnet-apm.onrender.com\n  - The application integration json url: https://dotnet-apm.onrender.com/integration.json\n  - The application target url: https://dotnet-apm.onrender.com/target_url (This url will be called by telex)\n\n---\n\n### ⚙️ Step 2: Update the Webhook URL\n\n- After installation, update the `webhookUrl` in the application settings to your **output webhook** (where you want Telex to send your messages).\n\n---\n\n### 🔧 Step 3: Activate/Configure Your Channel\n\n- Activate and configure your channel to use the **Dotnet APM**.\n\n---\n\n### 🎉 Step 4: You're Done!\n\n- **Voila!** 🚀 Your Telex APM setup is now complete.\n\n## Additional Resources\n\n- 📚 [TelexAPM Documentation](https://docs.telex.im/docs)\n- 📖 [.NET Configuration Documentation](https://dotnet.microsoft.com/en-us/apps/aspnet)\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit changes (`git commit -m 'Add AmazingFeature'`)\n4. Push to branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\nFor support, please open an issue in the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Ftelexapm-for-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelexintegrations%2Ftelexapm-for-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Ftelexapm-for-dotnet/lists"}