11Writing a Client
22================
33
4+ .. note :: This document describes protocol version 4.
5+
46A client at its core is simply a set of utilities for capturing various
57logging parameters. Given these parameters, it then builds a JSON payload
68which it will send to a Sentry server using some sort of authentication
@@ -157,11 +159,11 @@ For example, with an included Exception event, a basic JSON body might resemble
157159 "tags": {
158160 "ios_version": "4.0"
159161 },
160- "sentry.interfaces.Exception ": {
162+ "exception ": [ {
161163 "type": "SyntaxError":
162164 "value": "Wattttt!",
163165 "module": "__builtins__"
164- }
166+ }]
165167 }
166168
167169The following attributes are required for all events:
@@ -351,19 +353,19 @@ An authentication header is expected to be sent along with the message body, whi
351353
352354.. data :: sentry_version
353355
354- The protocol version. This should be sent as the value '2.0 '.
356+ The protocol version. This should be sent as the value '4 '.
355357
356358.. data :: sentry_client
357359
358360 An arbitrary string which identifies your client, including its version.
359361
360- For example, the Python client might send this as 'raven-python/1.0'
362+ The typical pattern for this is '** client_name **/** client_version **'.
361363
362- This should be included in your User-Agent header rather than here if you're using the HTTP protocol .
364+ For example, the Python client might send this as 'raven-python/1.0' .
363365
364366.. data :: sentry_timestamp
365367
366- The unix timestamp representing the time at which this POST request was generated.
368+ The unix timestamp representing the time at which this event was generated.
367369
368370.. data :: sentry_key
369371
@@ -373,8 +375,9 @@ An authentication header is expected to be sent along with the message body, whi
373375
374376 The secret key which should be provided as part of the client configuration.
375377
376- .. note :: You should only pass the secret key if you're communicating via the server. Client-side behavior (such
377- as JavaScript) should use CORS.
378+ .. note :: You should only pass the secret key if you're communicating via
379+ secure communication to the server. Client-side behavior (such
380+ as JavaScript) should use CORS, and only pass the public key.
378381
379382crossdomain.xml
380383~~~~~~~~~~~~~~~
@@ -406,11 +409,11 @@ The request body should then somewhat resemble the following::
406409 "culprit": "my.module.function_name",
407410 "timestamp": "2011-05-02T17:41:36",
408411 "message": "SyntaxError: Wattttt!",
409- "sentry.interfaces.Exception ": {
412+ "exception ": [ {
410413 "type": "SyntaxError",
411414 "value": "Wattttt!",
412415 "module": "__builtins__"
413- }
416+ }]
414417 }
415418
416419Handling Failures
0 commit comments