{"id":17887773,"url":"https://github.com/jaronoff97/swiftdog","last_synced_at":"2025-03-22T19:33:22.629Z","repository":{"id":55574437,"uuid":"132162073","full_name":"jaronoff97/SwiftDog","owner":"jaronoff97","description":"This is an (un)official swift library of the datadog API! Many more features to come, but right now it supports sending metrics and events!","archived":false,"fork":false,"pushed_at":"2020-12-21T09:15:48.000Z","size":396,"stargazers_count":26,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-23T23:14:38.902Z","etag":null,"topics":["datadog","datadog-api","sending-metrics","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaronoff97.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}},"created_at":"2018-05-04T16:08:51.000Z","updated_at":"2024-04-23T23:14:38.903Z","dependencies_parsed_at":"2022-08-15T03:30:34.123Z","dependency_job_id":null,"html_url":"https://github.com/jaronoff97/SwiftDog","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaronoff97%2FSwiftDog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaronoff97%2FSwiftDog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaronoff97%2FSwiftDog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaronoff97%2FSwiftDog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaronoff97","download_url":"https://codeload.github.com/jaronoff97/SwiftDog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245013737,"owners_count":20547175,"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":["datadog","datadog-api","sending-metrics","swift"],"created_at":"2024-10-28T13:35:22.877Z","updated_at":"2025-03-22T19:33:22.242Z","avatar_url":"https://github.com/jaronoff97.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftDog\n\n\u003cimg src=\"https://github.com/jaronoff97/SwiftDog/blob/master/bits-swift-lightbg.svg\" width=\"250\"\u003e\n\n[![CI Status](https://travis-ci.org/jaronoff97/SwiftDog.svg?branch=master)](https://travis-ci.org/jaronoff97/SwiftDog)\n[![Version](https://img.shields.io/cocoapods/v/SwiftDog.svg?style=flat)](https://cocoapods.org/pods/SwiftDog)\n[![License](https://img.shields.io/cocoapods/l/SwiftDog.svg?style=flat)](https://cocoapods.org/pods/SwiftDog)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftDog.svg?style=flat)](https://cocoapods.org/pods/SwiftDog)\n\nThis is an (un)official swift library of the datadog API! Many more features to come, but right now it supports sending metrics and events!\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\nIn order to run this library you need to create a file called `datadog_config.plist` with two keys: `api_key` and `app_key`\n\n## Installation\n\n### Swift Package Manager\n\nSwiftDog is availabe through [Swift Package Manager](https://swift.org/package-manager/). To install\nit, simply add `https://github.com/jaronoff97/SwiftDog.git` as a Package Dependency in Xcode by navigating\nto `File -\u003e Swift Packages -\u003e Add Package Dependency...`.\n\n### Carthage\n\nSwiftDog is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\ntarget 'MyApp' do\n  pod 'SwiftDog', '~\u003e 0.0.2'\nend\n```\n\n## Usage\n\nThe API currently supports sending metrics and events, with more features coming soon. \n\n*Currently, retrieving data is not implemented, nor is it in the plan for the future.* \n\n### Initialization\n\nThere are a few ways to initialize the api.\n\n*BE SURE YOU HAVE ADDED `datadog_config.plist`, SEE REQUIREMENTS*\n```swift\nDatadog.initialize_api()\nDatadog.initialize_api(default_tags: true)\nDatadog.initialize_api(agent: true)\nDatadog.initialize_api(agent: true, default_tags: true)\n```\n\n### Sending Metrics\n```swift\nDatadog.metric.send(metric: \"ios.device.gauge\", points: 1)\nDatadog.metric.send(metric: \"ios.test.event.sent\", points: 1, type: .count(1))\nDatadog.metric.send(metric: \"ios.device.count\", points: 1, host: nil, tags: [\"device:test_device\"], type: .count(1))\n```\n\nYou can also create objects to send directly!\n```swift\nlet gauge_metric = MetricData(host: nil, tags: [\"test:1\"], metric_name:\"test.metric1\", type: MetricData.MetricType.gauge, points: [DataPoint(timestamp: TimeInterval(1525377826.2537289), value: 1)])\nlet rate_metric = MetricData(host: \"device:fun_ios\", tags: [\"test:2\"], metric_name:\"test.metric2\", type: MetricData.MetricType.rate(10), points: [DataPoint(timestamp: TimeInterval(1525377828.2537289), value: 2)])\nlet count_metric = MetricData(host: \"device:another_device\", tags: [\"test:3\"], metric_name:\"test.metric3\", type: MetricData.MetricType.count(100), points: [DataPoint(timestamp: TimeInterval(1525377820.2537289), value: 3)])\nDatadog.metric.send(series: [gauge_metric, rate_metric, count_metric])\n```\n\n### Sending Events\n```swift\nDatadog.event.send(title: \"This is a test event\", text: \"We can now send events from an iOS device!\")\nDatadog.event.send(title: \"This is a test event\", text: \"We can now send events from an iOS device!\", tags: [\"method:hello\"])\nDatadog.event.send(title: \"This is a test event\", text: \"We can now send events from an iOS device!\", tags: [\"method:hello\"], date_happened: Data.currentDate())\nDatadog.event.send(title: \"This is a test event\", text: \"We can now send events from an iOS device!\", tags: [\"method:hello\"], date_happened: Data.currentDate(), priority: .low)\nDatadog.event.send(title: \"This is a test event\", text: \"We can now send events from an iOS device!\", tags: [\"method:hello\"], date_happened: Data.currentDate(), priority: .normal, alert_type: .error)\nDatadog.event.send(title: \"This is a test event\", text: \"We can now send events from an iOS device!\", tags: [\"method:hello\"], date_happened: Data.currentDate(), priority: .normal, alert_type: .error, aggregation_key: \"host\")\nDatadog.event.send(title: \"This is a test event\", text: \"We can now send events from an iOS device!\", tags: [\"method:hello\"], date_happened: Data.currentDate(), priority: .normal, alert_type: .error, aggregation_key: \"host\", source_type_name: \"mobile\")\n```\n\nLike metrics, you can create an event and send it too.\n```swift\nlet e: EventData = EventData(host: \"ios\", tags:[], title: \"test title\", text: \"test text\", date_happened: 1525412871, priority: .normal, alert_type: .info, aggregation_key: nil, source_type_name: nil)\nDatadog.event.send(series: [e])\n```\n\n## Author\n\nJacob Aronoff, jacobaronoff45@gmail.com\n\n## License\n\nSwiftDog is available under the APACHE license. See the LICENSE file for more info.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaronoff97%2Fswiftdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaronoff97%2Fswiftdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaronoff97%2Fswiftdog/lists"}