api_analytics 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0cf3498f46f29e07b93bc01d2182cd8daa147614c349559d9ed9dbc84515db4
4
- data.tar.gz: 1dff19db20f4b033b48dcc867f27b127618185e10a59239f2d3fc894576a4aea
3
+ metadata.gz: a1996495deb639bff1cc01ca3be055e4ceec8d8e41e3b647555384ef64dfddc7
4
+ data.tar.gz: ebc8466eb19a599e2de5c1cf5f4d8957f38daf5322ab654b8eba2cc1977a8bf7
5
5
  SHA512:
6
- metadata.gz: 42b54e3a6ecdeecc5315b8b67b91e26e3d65b55069c1db84d2987e50b72cb2cd58cb028201953ee39613ccfdd9dbc71899c7885daaaebf7cc84350b6517e091c
7
- data.tar.gz: d65e324ac5036b3434bd1b71fd7390458e6aa92388e8ce10b0a30a6eb89d422001d07f405fbf0f9296691c1149015f2f7ed15970fbdaeae2ff7be71769532bdc
6
+ metadata.gz: a6d73643ce69c4616dc0cbb1905c12d839960d19c496ca046c24afbdd4a36b52d7180d26b8a5f14c59f904bd966cfb4029e3ce14a06a26c21c6e5b56819c0372
7
+ data.tar.gz: 9a958b58d0f639774446e3c19df1b29d072dc42e0f0d3d8a30301d03251ec2c2ae2d49e2fc0cb76ccd5193ca563c48b3eed8e6fd1693503f02eae1eecbbc9583
data/README.md CHANGED
@@ -31,7 +31,7 @@ module RailsMiddleware
31
31
  config.load_defaults 6.1
32
32
  config.api_only = true
33
33
 
34
- config.middleware.use ::Analytics::Rails, <api_key> # Add middleware
34
+ config.middleware.use ::Analytics::Rails, <api_key> # Add middleware
35
35
  end
36
36
  end
37
37
  ```
@@ -42,7 +42,7 @@ end
42
42
  require 'sinatra'
43
43
  require 'api_analytics'
44
44
 
45
- use Analytics::Sinatra, <api_key>
45
+ use Analytics::Sinatra, <api_key> # Add middleware
46
46
 
47
47
  before do
48
48
  content_type 'application/json'
@@ -55,4 +55,57 @@ end
55
55
 
56
56
  ### 3. View your analytics
57
57
 
58
- Your API will log requests on all valid routes. Head over to https://my-api-analytics.vercel.app/dashboard and paste in your API key to view your dashboard.
58
+ Your API will now log and store incoming request data on all valid routes. Your logged data can be viewed using two methods: through visualizations and stats on our dashboard, or accessed directly via our data API.
59
+
60
+ You can use the same API key across multiple APIs, but all your data will appear in the same dashboard. We recommend generating a new API key for each additional API you want analytics for.
61
+
62
+ #### Dashboard
63
+
64
+ Head to https://my-api-analytics.vercel.app/dashboard and paste in your API key to access your dashboard.
65
+
66
+ Demo: https://my-api-analytics.vercel.app/dashboard/demo
67
+
68
+ ![Dashboard](https://user-images.githubusercontent.com/41476809/208440202-966a6930-3d2e-40c5-afc7-2fd0107d6b4f.png)
69
+
70
+ #### Data API
71
+
72
+ Logged data for all requests can be accessed via our API. Simply send a GET request to `https://api-analytics-server.vercel.app/api/data` with your API key set as `API-Key` in headers.
73
+
74
+ ```py
75
+ import requests
76
+
77
+ headers = {
78
+ "API-Key": <api_key>
79
+ }
80
+
81
+ response = requests.get("https://api-analytics-server.vercel.app/api/data", headers=headers)
82
+ print(response.json())
83
+ ```
84
+
85
+ ## Monitoring (coming soon)
86
+
87
+ Opt-in active API monitoring is coming soon. Our servers will regularly ping your API endpoints to monitor uptime and response time. Optional email alerts to notify you when your endpoints are down can be subscribed to.
88
+
89
+ ![Monitoring](https://user-images.githubusercontent.com/41476809/208298759-f937b668-2d86-43a2-b615-6b7f0b2bc20c.png)
90
+
91
+ ## Data and Security
92
+
93
+ All data is stored securely in compliance with The EU General Data Protection Regulation (GDPR).
94
+
95
+ For any given request to your API, data recorded is limited to:
96
+ - Path requested by client
97
+ - Client IP address
98
+ - Client operating system
99
+ - Client browser
100
+ - Request method (GET, POST, PUT, etc.)
101
+ - Time of request
102
+ - Status code
103
+ - Response time
104
+ - API hostname
105
+ - API framework (FastAPI, Flask, Express etc.)
106
+
107
+ Data collected is only ever used to populate your analytics dashboard. Your data is anonymous, with the API key the only link between you and you API's analytics. Should you lose your API key, you will have no method to access your API analytics. Inactive API keys (> 1 year) and its associated API request data may be deleted.
108
+
109
+ ### Delete Data
110
+
111
+ At any time, you can delete all stored data associated with your API key by going to https://my-api-analytics.vercel.app/delete and entering your API key.
@@ -7,7 +7,6 @@ Gem::Specification.new do |spec|
7
7
  spec.version = Analytics::VERSION
8
8
  spec.authors = ["Tom Draper"]
9
9
  spec.email = ["tomjdraper1@gmail.com"]
10
-
11
10
  spec.summary = "Monitoring and analytics for API applications."
12
11
  spec.description = "Monitoring and analytics for API applications."
13
12
  spec.homepage = "https://github.com/tom-draper/api-analytics"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Analytics
4
- VERSION = "1.0.5"
4
+ VERSION = "1.0.6"
5
5
  end
data/lib/api_analytics.rb CHANGED
@@ -58,6 +58,3 @@ module Analytics
58
58
  end
59
59
  end
60
60
  end
61
-
62
-
63
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Draper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-02 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Monitoring and analytics for API applications.
14
14
  email: