Class: DatadogAPIClient::V2::ProductAnalyticsAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::ProductAnalyticsAPI
- Defined in:
- lib/datadog_api_client/v2/api/product_analytics_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ ProductAnalyticsAPI
constructor
A new instance of ProductAnalyticsAPI.
-
#submit_product_analytics_event(body, opts = {}) ⇒ Object
Send server-side events.
-
#submit_product_analytics_event_with_http_info(body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Send server-side events.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ ProductAnalyticsAPI
Returns a new instance of ProductAnalyticsAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 22 def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
20 21 22 |
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#submit_product_analytics_event(body, opts = {}) ⇒ Object
Send server-side events.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 29 def submit_product_analytics_event(body, opts = {}) data, _status_code, _headers = submit_product_analytics_event_with_http_info(body, opts) data end |
#submit_product_analytics_event_with_http_info(body, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Send server-side events.
Send server-side events to Product Analytics. Server-side events are retained for 15 months.
Server-Side events in Product Analytics are helpful for tracking events that occur on the server,
as opposed to client-side events, which are captured by Real User Monitoring (RUM) SDKs.
This allows for a more comprehensive view of the user journey by including actions that happen on the server.
Typical examples could be checkout.completed or payment.processed.
Ingested server-side events are integrated into Product Analytics to allow users to select and filter these events in the event picker, similar to how views or actions are handled.
Requirements:
- At least one of
usr,account, orsessionmust be provided with a valid ID. - The
application.idmust reference a Product Analytics-enabled application.
Custom Attributes:
Any additional fields in the payload are flattened and searchable as facets.
For example, a payload with {"customer": {"tier": "premium"}} is searchable with
the syntax @customer.tier:premium in Datadog.
The status codes answered by the HTTP API are:
- 202: Accepted: The request has been accepted for processing
- 400: Bad request (likely an issue in the payload formatting)
- 401: Unauthorized (likely a missing API Key)
- 403: Permission issue (likely using an invalid API Key)
- 408: Request Timeout, request should be retried after some time
- 413: Payload too large (batch is above 5MB uncompressed)
- 429: Too Many Requests, request should be retried after some time
- 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time
- 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 69 def submit_product_analytics_event_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.submit_product_analytics_event ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.submit_product_analytics_event" end # resource path local_var_path = '/api/v2/prodlytics' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth] = opts.merge( :operation => :submit_product_analytics_event, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductAnalyticsAPI#submit_product_analytics_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |