{"id":20980698,"url":"https://github.com/statful/statful-dotnet-standard-client","last_synced_at":"2025-08-17T19:33:58.916Z","repository":{"id":72508691,"uuid":"160510187","full_name":"statful/statful-dotnet-standard-client","owner":"statful","description":"Statful client for .NET Core applications. This client is intended to gather metrics and send them to Statful.","archived":false,"fork":false,"pushed_at":"2019-02-01T10:45:33.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-13T10:17:29.544Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/statful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-12-05T11:46:30.000Z","updated_at":"2019-02-01T10:21:07.000Z","dependencies_parsed_at":"2023-11-10T11:38:33.881Z","dependency_job_id":null,"html_url":"https://github.com/statful/statful-dotnet-standard-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/statful/statful-dotnet-standard-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-dotnet-standard-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-dotnet-standard-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-dotnet-standard-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-dotnet-standard-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statful","download_url":"https://codeload.github.com/statful/statful-dotnet-standard-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-dotnet-standard-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502490,"owners_count":23618617,"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":"2024-11-19T05:29:40.410Z","updated_at":"2025-07-09T19:34:25.523Z","avatar_url":"https://github.com/statful.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# statful-dotnet-core-client\nStatful client for .NET Core applications. This client is intended to gather metrics and send them to Statful.\n\n## Table of Contents\n\n* [Supported Versions of .NET Core](#supported-versions-of-.net-core)\n* [Installation](#installation)\n* [Quick Start](#quick-start)\n* [Examples](#examples)\n* [Reference](#reference)\n* [Authors](#authors)\n* [License](#license)\n\n## Installation \n\nTo install the client simply run:\n\n    dotnet add package statful-client-dotnet-core --version 1.0.0-alpha\n\n## Supported Versions of .NET Core\n\n| Statful client Version | Tested .NET Core versions  |\n|:---|:---|\n| 1.x.x | `2.1.500`|\n\n## Quick start\n\nYou can configure the client programmatically or by using a configuration file.\n\n### Programmatically\nCreate an instance of `ClientConfiguration` to set all desired parameters like the following sample:\n```c#\nusing Statful.Client.Core.Configuration;\n        .\n        .\n        .\n\nIClientConfiguration configuration = new ClientConfiguration.Builder()\n                                                            .withHost(\"host\")\n                                                            .withPort(443)\n                                                            .withToken(\"token\")\n                                                                .\n                                                                .\n                                                                .\n                                                            Build();\n```\n## Configuration File\nThe configuration file is a json document named \"appsettings.json\" that follows the structure:\n\n```c#\n{\n    \"StatfulClient\":{\n        \"Settings\":{\n            \"host\": \"api.statful.com\",\n            \"port\": 443,\n            \"secure\": true,\n            \"timeout\": 1000,\n            \"token\": \"token\",\n            \"app\": \"foo\",\n            \"dryrun\": false,\n            \"tags\": [\"tag1\",\"value1\"],\n            \"sampleRate\": 100,\n            \"ns\": \"application\",\n            \"flushInterval\": 10000,\n            \"maxBufferSize\": 5000,\n            \"path\": \"tel/v2.0/metrics\",\n            \"transport\": \"http\"\n        }\n    }\n}\n```\n\nNote: this file must be in the project's root directory.\n\n## Examples\n\n### Initialize client\n\nInitialize the client by creating an instance of `IStatfulClient` through `StatfulClientFactory`:\n\n```c# \nusing Statful.Core.Client.Client;\n            . \n            .\n            .\n\nIStatfulClient client = StatfulClientFactory.CreateStatfulClient(); // Creates configured client from appsettings.json\n\nOR\n\nIStatfulClient client = StatfulClientFactory.CreateStatfulClient(configuration); // Creates configured client programmatically\n```\nFinally, you can send a metric just like this:\n\n```c#\nclient.Time(\"name\", 10, \"tag1=sample\", null);\n```\n\n### Defaults Configuration Per Method\n\n`IStatfulClient` has 4 methods to send metrics:\n\n    Inc -\u003e appends a prefix `counter` to the metric name and, if none are specified, sets `sum` and `count` aggregations as default;\n    \n    Time -\u003e appends a prefix `timer` to the metric name and, if none are specified, sets `avg`, `p90` and `count` aggregations as default;\n    \n    Gauge -\u003e appends a prefix `gauge` to the metric name and, if none are specified, sets `last` aggregation as default;\n    \n    Put -\u003e sends the metric as is;\n    \n## Reference\n\nReference if you want to take full advantage from Statful.    \n\n### Global Configuration\n\nThe custom options that can be set on config param are detailed below.\n\n| Option | Description | Type | Default | Required |\n|:---|:---|:---|:---|:---|\n| host | Defines the host name to where the metrics should be sent. |  `string` | `api.statful.com` | **NO** |\n| port | Defines the port. |  `string` | `443` | **NO** |\n| secure | Enable or disable HTTPS. | `boolean` | `true`| **NO** |\n| timeout | Defines the timeout for the transport layers in **miliseconds**. | `number` | 2000 | **NO** |\n| token | Defines the token to be used. | `string` | **undefined** | **YES** |\n| app | Defines the application global name. If specified sets a global tag `app=setValue`. | `string` | **undefined** | **NO** |\n| dryrun | Debug log metrics when flushing the buffer. | `boolean` | `false` | **NO**|\n| tags | Define global list of tags to set, these are merged with custom tags set on method calls with priority to custom tags. | `string` | **undefined** | **NO** |\n| sampleRate | Defines the rate sampling. Should be a number between **[1, 100]**. | `number` | `100` | **NO**|\n| ns | Defines the global namespace. | `string` | `application` | **NO** | \n| flushInterval | Defines an interval to periodically flush the buffer based on time. | `number` | `10000` | **NO**|\n| maxBufferSize | Defines how many metrics at max are kept in the buffer between forced flushes. | `number` | `5000` | **NO** |\n| path | Defines the api path to where the metrics should be sent. | `string` | `tel/v2.0/metrics` | **NO** |\n| transport | Defines the transport layer to be used to send metrics. **Valid Transports:** `udp`, `http` | `string` | `http` | **NO**\n| logger | Defines logger library. | `string` | `SilentLogger` | **NO** |\n\n## Authors\n\n[Mindera - Software Craft](https://github.com/Mindera)\n\n## License\n\nStatful .NET Core Client is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/statful/statful-dotnet-core-client/master/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-dotnet-standard-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatful%2Fstatful-dotnet-standard-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-dotnet-standard-client/lists"}