{"id":18811745,"url":"https://github.com/logicmonitor/lm-data-sdk-dotnet","last_synced_at":"2025-07-14T15:06:52.771Z","repository":{"id":38360741,"uuid":"415804455","full_name":"logicmonitor/lm-data-sdk-dotnet","owner":"logicmonitor","description":"LogicMonitor data sdk for dotnet for Metric and Log ingestion to the platform using APIs","archived":false,"fork":false,"pushed_at":"2025-01-20T07:34:42.000Z","size":1263,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-22T03:38:21.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logicmonitor.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,"zenodo":null}},"created_at":"2021-10-11T06:30:04.000Z","updated_at":"2025-01-20T07:34:44.000Z","dependencies_parsed_at":"2025-01-20T08:35:00.520Z","dependency_job_id":null,"html_url":"https://github.com/logicmonitor/lm-data-sdk-dotnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/logicmonitor/lm-data-sdk-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-data-sdk-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-data-sdk-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-data-sdk-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-data-sdk-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logicmonitor","download_url":"https://codeload.github.com/logicmonitor/lm-data-sdk-dotnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicmonitor%2Flm-data-sdk-dotnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265311581,"owners_count":23745080,"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-07T23:27:31.674Z","updated_at":"2025-07-14T15:06:52.740Z","avatar_url":"https://github.com/logicmonitor.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LogicMonitor.DataSDK - the C# library for the LogicMonitor API-Ingest Rest API\n\n[![CodeQL](https://github.com/logicmonitor/lm-data-sdk-dotnet/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/logicmonitor/lm-data-sdk-dotnet/actions/workflows/codeql-analysis.yml) [![.NET](https://github.com/logicmonitor/lm-data-sdk-dotnet/actions/workflows/dotnet.yml/badge.svg)](https://github.com/logicmonitor/lm-data-sdk-dotnet/actions/workflows/dotnet.yml)\n\nLogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid \ninfrastructures, offering granular performance monitoring and actionable data and insights. API-Ingest provides the \nentry point in the form of public rest APIs for ingesting metrics into LogicMonitor. For using this application users \nhave to create either LMv1 authentication token or Bearer token from LogicMonitor platform (a.k.a santaba).\n\n- SDK version: 0.1.0-alpha\n\n:point_right: [API reference docs](https://logicmonitor.github.io/lm-data-sdk-dotnet/) \n\n:point_right: [NuGet package](https://www.nuget.org/packages/Logicmonitor.DataSDK) \n\n\u003ca name=\"frameworks-supported\"\u003e\u003c/a\u003e\n## Frameworks supported\n- .NET Core \u003e= 3.1\n\n\u003ca name=\"dependencies\"\u003e\u003c/a\u003e\n## Dependencies\n\n- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later\n- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later\n- [Microsoft.Extenstion.Logging](https://www.nuget.org/packages/Microsoft.Extensions.Logging/) - 5.0.0 or later\n- [Microsoft.Extenstion.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later\n\n\u003ca name = \"Metrics Ingestion Example\"\u003e\u003c/a\u003e\n## Metrics Ingestion Example.\n\nSDK must be configured with LogicMonitor.DataSDK Configuration class. \nWhile using LMv1 authentication set AccessID and AccessKey properties, In Case of BearerToken Authentication set Bearer Token property. Company's name or Account name \u003cb\u003emust\u003c/b\u003e be passed to Company property. All properties can be set using environment variable.\n\n System property   |      Environment variable      |  Description |\n|----------|-------------|:------|\n| `Configration.company` |  `ACCOUNT_NAME` |  Account name (Company Name) is your organization name |\n| `Configration.AccessID` |  `API_ACCESS_ID` |  Access id while using LMv1 authentication. (Not needed while using Bearer API )  |\n| `Configration.AccessKey` |  `API_ACCESS_KEY` |    Access key while using LMv1 authentication. (Not needed while using Bearer API ) |\n| `Configration.BearerToken` |  `API_BEARER_TOKEN` |    BearerToken while using Bearer authentication. (Not needed while using LMv1 API) |\n\nFor metrics ingestion user must create a object of Resource, DataSource, DataSourceInstance and DataPoint using LogicMonitor.DataSDK.Model namespace,\nalso dictonary should be created in  which 'Key' hold the Time(in epoch) for which data is being emitted and 'Value' will the the value of datapoint.\n\n```csharp\n//Pass autheticate variable as Environment variable.\nApiClient apiClient = new ApiClient();\n\nMetrics metrics = new Metrics(batch: false, interval: 0, responseInterface, apiClient);\n\nResource resource = new Resource(name: resourceName, ids: resourceIds, create: true);\nDataSource dataSource = new DataSource(Name: dataSourceName, Group: dataSourceGroup);\nDataSourceInstance dataSourceInstance = new DataSourceInstance(name: InstanceName);\nDataPoint dataPoint = new DataPoint(name: CpuUsage);\nDictionary\u003cstring, string\u003e CpuUsageValue = new Dictionary\u003cstring, string\u003e();\n    \n    \nCpuUsageValue.Add(epochTime, metricData);\nmetrics.SendMetrics(resource: resource, dataSource: dataSource, dataSourceInstance: dataSourceInstance, dataPoint: dataPoint, values: CpuUsageValue);\n```\nTo Pass autheticate variable as Environment variable use the following command.:\nWhile Using LMv1 Authentication:\n```csharp\nexport ACCOUNT_NAME=\u003cYourAccountName\u003e API_ACCESS_ID=\u003cYourAccessID\u003e API_ACCESS_KEY=\u003c'YourAccessKey'\u003e\n```\n\nWhile Using Bearer Authentication:\n```csharp\nexport ACCOUNT_NAME=\u003cYourAccountName\u003e API_BEARER_TOKEN=\u003cYourBearerToken\u003e\n```\nRead below for understanding more about Models in SDK.\n\n\u003ca name=\"Model\"\u003e\u003c/a\u003e\n## Model\n\n- Resource\n\n```csharp\nResource resource = new Resource(Ids,Name,Description,Properties,Create);\n```\n\n\u003cb\u003eIds(Dictonary\u003cstring,string\u003e):\u003c/b\u003e An Dictionary of existing resource properties that will be used to identify the resource. See Managing Resources \nthat Ingest Push Metrics for information on the types of properties that can be used. If no resource is matched and the \ncreate parameter is set to TRUE, a new resource is created with these specified resource IDs set on it. If the \nsystem.displayname and/or system.hostname property is included as resource IDs, they will be used as host name and \ndisplay name respectively in the resulting resource.\n\n\u003cb\u003eName(string):\u003c/b\u003e Resource unique name. Only considered when creating a new resource.\n\n\u003cb\u003eProperties(Dictonary\u003cstring,string\u003e):\u003c/b\u003e New properties for resource. Updates to existing resource properties are not considered. Depending on the property name,\nwe will convert these properties into system, auto, or custom properties.\n\n\u003cb\u003eDescription(string):\u003c/b\u003e  Resource description. Only considered when creating a new resource.\n\n\u003cb\u003eCreate(bool):\u003c/b\u003e Do you want to create the resource.\n\n- DataSource\n\n```csharp\nDataSource dataSource = new DataSource(DataSourceName,DataSourceGroup,DisplayName,Id );\n```\n\n\u003cb\u003eName(string):\u003c/b\u003e  DataSource unique name. Used to match an existing DataSource. If no existing DataSource matches the name provided\nhere, a new DataSource is created with this name.\n\n\u003cb\u003eDisplayName(string):\u003c/b\u003e DataSource display name. Only considered when creating a new DataSource.\n\n\u003cb\u003eGroup(string):\u003c/b\u003e DataSource group name. Only considered when DataSource does not already belong to a group. Used to organize the\nDataSource within a DataSource group. If no existing DataSource group matches, a new group is created with this name \nand the DataSource is organized under the new group.\n\n\u003cb\u003eId(int):\u003c/b\u003e DataSource unique ID. Used only to match an existing DataSource. If no existing DataSource matches the provided ID, \nan error results.\n\n\n- DatasourceInstance\n\n```csharp\nDataSourceInstance dataSourceInstance = new DataSourceInstance(Name,DisplayName,Description,Properties);\n```\n\u003cb\u003eName(string):\u003c/b\u003e Instance name. If no existing instance matches, a new instance is created with this name.\n\n\u003cb\u003eDisplayName(string):\u003c/b\u003e Instance display name. Only considered when creating a new instance.\n\n\u003cb\u003eProperties(Dictionary\u003cstring,string\u003e):\u003c/b\u003e New properties for instance. Updates to existing instance properties are not considered. Depending on the \nproperty name, we will convert these properties into system, auto, or custom properties.\n\n\u003cb\u003eDescription(string):\u003c/b\u003e  Resource description. Only considered when creating a new resource.\n\n- DataPoint\n\n```csharp\nDataPoint dataPoint = new DataPoint(Name,Description,AggregationType,Description);\n```\n\u003cb\u003eName(string):\u003c/b\u003e Datapoint name. If no existing datapoint matches for specified DataSource, a new datapoint is created with this \nname.\n\n\u003cb\u003eAggreationType(string):\u003c/b\u003eThe aggregation method, if any, that should be used if data is pushed in sub-minute intervals. Allowed options are \n“sum”, “average” and “none”(default) where “none” would take last value for that minute. \nOnly considered when creating a new datapoint. See the About the Push Metrics REST API section of this guide for more \ninformation on datapoint value aggregation intervals.\n\n\u003cb\u003eDescription(string):\u003c/b\u003e Datapoint description. Only considered when creating a new datapoint.\n\n\u003cb\u003eType(string):\u003c/b\u003e Metric type as a number in string format. Allowed options are “guage” (default) and “counter”. Only considered \nwhen creating a new datapoint.\n\n- Value\n```csharp\nDictionary\u003cstring,string\u003e value = new Dictionary\u003cstring,string\u003e();\n```\nValue is a dictionary which stores the time of data emittion(in epoch) as Key of dictionary and Metric Data as Value of dictionary.\n\n\u003ca name=\"documentation-for-api-endpoints\"\u003e\u003c/a\u003e\n## Documentation for API Endpoints\n\nAll URIs are relative to *https://AccountName.logicmonitor.com/rest*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicmonitor%2Flm-data-sdk-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogicmonitor%2Flm-data-sdk-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicmonitor%2Flm-data-sdk-dotnet/lists"}