Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpereira2 <rpereira@gitlab.com>2018-12-12 19:54:33 +0300
committerrpereira2 <rpereira@gitlab.com>2018-12-12 19:54:33 +0300
commit96b0174f6b19864885cbc7a6e6bd7b92994d1ac8 (patch)
tree0c8332d540526ea11c822c314b82b331ac62eb24
parent7c4940b70236347d06d7c4b559dcc50a8e68d8c0 (diff)
Add a sentry service
-rw-r--r--app/services/error_tracking/sentry.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/services/error_tracking/sentry.rb b/app/services/error_tracking/sentry.rb
new file mode 100644
index 00000000000..8865e94bd8b
--- /dev/null
+++ b/app/services/error_tracking/sentry.rb
@@ -0,0 +1,24 @@
+module ErrorTracking
+ class SentryService
+
+ attr_accessor :uri, :token
+
+ def initialize(host, port, organisation, project_name, token)
+ @uri = URI('')
+ @uri.scheme = 'http'
+ @uri.host = host
+ @uri.port = port
+ @uri.path = "/api/0/projects/#{organisation}/#{project_name}/"
+ @token = token
+ end
+
+ def get_issues
+ @uri.path += 'issues/'
+ # @uri.query = 'query=is:unresolved&limit=25&sort=date&statsPeriod=24h&shortIdLookup=1'
+
+ Gitlab::HTTP.get(@uri.to_s, query: @uri.query, headers: {
+ 'Authorization' => "Bearer #{@token}"
+ })
+ end
+ end
+end