All Projects → jaronoff97 → SwiftDog

jaronoff97 / SwiftDog

Licence: Apache-2.0 license
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!

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to SwiftDog

datadog-sidekiq
A Rust app to track Sidekiq enqueued & processed jobs in Datadog
Stars: ✭ 14 (-46.15%)
Mutual labels:  datadog, datadog-api
datadog-api-client-python
Python client for the Datadog API
Stars: ✭ 44 (+69.23%)
Mutual labels:  datadog, datadog-api
Dd Trace Py
Datadog Python APM Client
Stars: ✭ 220 (+746.15%)
Mutual labels:  datadog
terraform-aws-datadog-integration
Terraform module to configure Datadog AWS integration
Stars: ✭ 26 (+0%)
Mutual labels:  datadog
dd-trace-php
[DEPRECATED] Use https://github.com/dataDog/dd-trace-php instead
Stars: ✭ 18 (-30.77%)
Mutual labels:  datadog
Dd Trace Java
Datadog APM client for Java
Stars: ✭ 228 (+776.92%)
Mutual labels:  datadog
statsd.cr
A statsd client library for Crystal.
Stars: ✭ 32 (+23.08%)
Mutual labels:  datadog
Terraform Provider Datadog
Terraform Datadog provider
Stars: ✭ 213 (+719.23%)
Mutual labels:  datadog
terraform-aws-datadog-forwarders
Terraform module which creates resources on AWS to forward logs/metrics to Datadog 🇺🇦
Stars: ✭ 30 (+15.38%)
Mutual labels:  datadog
datadog-tracer-js
[DEPRECATED] OpenTracing tracer implementation for Datadog in JavaScript.
Stars: ✭ 39 (+50%)
Mutual labels:  datadog
vault-consul-monitoring
Sample project to explore monitoring Vault and Consul with telegraf/influxdb/grafana
Stars: ✭ 52 (+100%)
Mutual labels:  datadog
datalogger
DataLogger foi projetado para ser uma biblioteca simples de log com suporte a vários providers.
Stars: ✭ 46 (+76.92%)
Mutual labels:  datadog
Datadog Go
go dogstatsd client library for datadog
Stars: ✭ 238 (+815.38%)
Mutual labels:  datadog
dd-go-opentracing
[WIP] OpenTracing Tracer implementation for Datadog in Go
Stars: ✭ 22 (-15.38%)
Mutual labels:  datadog
Ansible Datadog
Ansible role for Datadog Agent
Stars: ✭ 223 (+757.69%)
Mutual labels:  datadog
yake
A Rake-like DSL for writing AWS Lambda handlers
Stars: ✭ 146 (+461.54%)
Mutual labels:  datadog
Dd Trace Js
JavaScript APM Tracer
Stars: ✭ 212 (+715.38%)
Mutual labels:  datadog
Pagerbeauty
📟✨ PagerDuty on-call widget for monitoring dashboard. Datadog and Grafana compatible
Stars: ✭ 250 (+861.54%)
Mutual labels:  datadog
natchez-extras
Integrations between Natchez, Doobie, HTTP4s, Log4cats and Datadog. Formerly called effect-utils.
Stars: ✭ 24 (-7.69%)
Mutual labels:  datadog
datadog-trace-agent
Datadog Trace Agent archive (pre-6.10.0)
Stars: ✭ 70 (+169.23%)
Mutual labels:  datadog

SwiftDog

CI Status Version License Platform

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!

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

In order to run this library you need to create a file called datadog_config.plist with two keys: api_key and app_key

Installation

Swift Package Manager

SwiftDog is availabe through Swift Package Manager. To install it, simply add https://github.com/jaronoff97/SwiftDog.git as a Package Dependency in Xcode by navigating to File -> Swift Packages -> Add Package Dependency....

Carthage

SwiftDog is available through CocoaPods. To install it, simply add the following line to your Podfile:

target 'MyApp' do
  pod 'SwiftDog', '~> 0.0.2'
end

Usage

The API currently supports sending metrics and events, with more features coming soon.

Currently, retrieving data is not implemented, nor is it in the plan for the future.

Initialization

There are a few ways to initialize the api.

BE SURE YOU HAVE ADDED datadog_config.plist, SEE REQUIREMENTS

Datadog.initialize_api()
Datadog.initialize_api(default_tags: true)
Datadog.initialize_api(agent: true)
Datadog.initialize_api(agent: true, default_tags: true)

Sending Metrics

Datadog.metric.send(metric: "ios.device.gauge", points: 1)
Datadog.metric.send(metric: "ios.test.event.sent", points: 1, type: .count(1))
Datadog.metric.send(metric: "ios.device.count", points: 1, host: nil, tags: ["device:test_device"], type: .count(1))

You can also create objects to send directly!

let gauge_metric = MetricData(host: nil, tags: ["test:1"], metric_name:"test.metric1", type: MetricData.MetricType.gauge, points: [DataPoint(timestamp: TimeInterval(1525377826.2537289), value: 1)])
let 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)])
let 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)])
Datadog.metric.send(series: [gauge_metric, rate_metric, count_metric])

Sending Events

Datadog.event.send(title: "This is a test event", text: "We can now send events from an iOS device!")
Datadog.event.send(title: "This is a test event", text: "We can now send events from an iOS device!", tags: ["method:hello"])
Datadog.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())
Datadog.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)
Datadog.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)
Datadog.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")
Datadog.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")

Like metrics, you can create an event and send it too.

let 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)
Datadog.event.send(series: [e])

Author

Jacob Aronoff, [email protected]

License

SwiftDog is available under the APACHE license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].