diff options
author | rpereira2 <rpereira@gitlab.com> | 2018-12-12 17:54:33 +0100 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2019-01-02 19:41:52 +0100 |
commit | 5712ef9be7bc10669d73d24e80b8cc1199399f10 (patch) | |
tree | fcd0ea150270b709372d60ae21643f26d12d7f47 | |
parent | 61f13bf50781c39f9f6fc9920074ff724856d537 (diff) | |
download | gitlab-ce-5712ef9be7bc10669d73d24e80b8cc1199399f10.tar.gz |
Add a sentry service
-rw-r--r-- | app/services/error_tracking/sentry.rb | 24 |
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 |