From 8d3436070421c973058d12e703d21edbc44a46b0 Mon Sep 17 00:00:00 2001 From: moesif-ci-cd Date: Sun, 24 Mar 2024 22:16:14 +0000 Subject: [PATCH] publish: Merge pull request #51 from Moesif/merge-slate generated from commit 3d9143f26773e7de401044fdd62169493e93fd24 --- fonts/{slate-33847ce5.woff => slate.woff} | Bin fonts/{slate-ddd488db.woff2 => slate.woff2} | Bin index.html | 18941 ++++++++++-------- javascripts/all-6520e400.js | 167 - javascripts/all-936cbb0e.js | 120 + javascripts/all_nosearch-17a6dbc6.js | 67 - javascripts/all_nosearch-2989ee14.js | 31 + stylesheets/print-69319554.css | 1 + stylesheets/print-b1632cf2.css | 1 - stylesheets/screen-511528cf.css | 1 - stylesheets/screen-e3cc2f00.css | 1 + swagger-markup/overview | 33 +- 12 files changed, 10370 insertions(+), 8993 deletions(-) rename fonts/{slate-33847ce5.woff => slate.woff} (100%) mode change 100755 => 100644 rename fonts/{slate-ddd488db.woff2 => slate.woff2} (100%) mode change 100755 => 100644 delete mode 100644 javascripts/all-6520e400.js create mode 100644 javascripts/all-936cbb0e.js delete mode 100644 javascripts/all_nosearch-17a6dbc6.js create mode 100644 javascripts/all_nosearch-2989ee14.js create mode 100644 stylesheets/print-69319554.css delete mode 100644 stylesheets/print-b1632cf2.css delete mode 100644 stylesheets/screen-511528cf.css create mode 100644 stylesheets/screen-e3cc2f00.css diff --git a/fonts/slate-33847ce5.woff b/fonts/slate.woff old mode 100755 new mode 100644 similarity index 100% rename from fonts/slate-33847ce5.woff rename to fonts/slate.woff diff --git a/fonts/slate-ddd488db.woff2 b/fonts/slate.woff2 old mode 100755 new mode 100644 similarity index 100% rename from fonts/slate-ddd488db.woff2 rename to fonts/slate.woff2 diff --git a/index.html b/index.html index afbccd9..0deb931 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,4 @@ + @@ -6,21 +7,20 @@ Moesif API Documentation - - - - + + + + @@ -222,6 +312,10 @@ } + + @@ -248,11 +342,11 @@ NAV - Navbar + -
- Logo +
+
JSON Shell @@ -269,8 +363,1802 @@
    -
    -
    +

    Sorting items by low cardinality key

    -

    For lower cardinality keys (likes response.status), many events may match the same status code. In order to have a stable sort, you must use a high cardinality key as well such that it’s a sort on a compound key. Below is an example using both the response.status as well as the _id field (which is guaranteed to be unique)

    +

    For lower cardinality keys (likes response.status), many events may match the same status code. In order to have a stable sort, you must use a high cardinality key as well such that it's a sort on a compound key. Below is an example using both the response.status as well as the _id field (which is guaranteed to be unique)

    POST https://api.moesif.com/search/~/search/events?from=-7d&to=now

    Sorting items by low cardinality key
    -
    {
    -    "size": 50,
    -    "search_after": [
    +
    {
    +    "size": 50,
    +    "search_after": [
             "12345",
             "AYpjf3Gow2BIxAOLPgx4"
         ],
    -    "sort": [
    +    "sort": [
             {
    -            "user_id.raw": {
    -                "order": "desc",
    -                "unmapped_type": "string"
    +            "user_id.raw": {
    +                "order": "desc",
    +                "unmapped_type": "string"
                 }
             },
             {
    -            "_id": "desc"
    +            "_id": "desc"
             }
         ]
     }
    -
    -

    Sorting Metric Terms

    - +

    Sorting Metric Terms

    -

    To rapidly generate your query, t’s strongly recommended using the query builder within the Moesif UI. This can be found by clicking orange “Embed” button and selecting “Search API”.

    +

    To rapidly generate your query, t's strongly recommended using the query builder within the Moesif UI. This can be found by clicking orange "Embed" button and selecting "Search API".

    Metrics APIs (such as to get a time series or segmentation report) do not support pagination as the response is already aggregated and contains the required dataset. -However, Moesif does support sorting by “top X” and “Bottom X” for when a “group by” is present. This is important to define whether you want the top terms or bottom terms and what is the metric to order the group by terms.

    +However, Moesif does support sorting by "top X" and "Bottom X" for when a "group by" is present. This is important to define whether you want the top terms or bottom terms and what is the metric to order the group by terms.

    Sorting group by terms

    -

    In the below example, we have a segmentation report that gets the total event count for the top 10 companies. The query has a “group by” on company_id.raw. The group by will return the top 10 terms sorted by the company’s event count (weight) in descending order (desc).

    +

    In the below example, we have a segmentation report that gets the total event count for the top 10 companies. The query has a "group by" on company_id.raw. The group by will return the top 10 terms sorted by the company's event count (weight) in descending order (desc).

    POST https://api.moesif.com/search/~/search/events?from=-7d&to=now

    Sorting group by term
    -
    {
    -    "aggs": {
    -        "seg": {
    -            "filter": {
    -                "match_all": {}
    +
    {
    +    "aggs": {
    +        "seg": {
    +            "filter": {
    +                "match_all": {}
                 },
    -            "aggs": {
    -                "company_id.raw": {
    -                    "terms": {
    -                        "field": "company_id.raw",
    -                        "size": "20",
    -                        "min_doc_count": 1,
    -                        "order": {
    -                            "weight|sum": "desc"
    +            "aggs": {
    +                "company_id.raw": {
    +                    "terms": {
    +                        "field": "company_id.raw",
    +                        "size": "20",
    +                        "min_doc_count": 1,
    +                        "order": {
    +                            "weight|sum": "desc"
                             },
    -                        "missing": "(none)"
    +                        "missing": "(none)"
                         },
    -                    "aggs": {
    -                        "weight|sum": {
    -                            "sum": {
    -                                "field": "weight",
    -                                "missing": 1
    +                    "aggs": {
    +                        "weight|sum": {
    +                            "sum": {
    +                                "field": "weight",
    +                                "missing": 1
                                 }
                             }
                         }
                     },
    -                "weight|sum": {
    -                    "sum": {
    -                        "field": "weight",
    -                        "missing": 1
    +                "weight|sum": {
    +                    "sum": {
    +                        "field": "weight",
    +                        "missing": 1
                         }
                     }
                 }
             }
         },
    -    "size": 0
    +    "size": 0
     }
    -
    +

    Sorting by a different metric

    The metric returned and the sort order can be different. In the below example, the metric returned is 90th percentile latency, but we still want to sort by the top 10 APIs @@ -601,38 +2468,38 @@

    Sorting Metric Terms

    POST https://api.moesif.com/search/~/search/events?from=-7d&to=now

    Sorting by a different metric
    -
    {
    -    "aggs": {
    -        "seg": {
    -            "filter": {
    -                "match_all": {}
    +
    {
    +    "aggs": {
    +        "seg": {
    +            "filter": {
    +                "match_all": {}
                 },
    -            "aggs": {
    -                "request.route.raw": {
    -                    "terms": {
    -                        "field": "request.route.raw",
    -                        "size": "10",
    -                        "min_doc_count": 1,
    -                        "order": {
    -                            "duration_ms|percentiles(90).90": "desc"
    +            "aggs": {
    +                "request.route.raw": {
    +                    "terms": {
    +                        "field": "request.route.raw",
    +                        "size": "10",
    +                        "min_doc_count": 1,
    +                        "order": {
    +                            "duration_ms|percentiles(90).90": "desc"
                             },
    -                        "missing": "(none)"
    +                        "missing": "(none)"
                         },
    -                    "aggs": {
    -                        "duration_ms|percentiles(90)": {
    -                            "percentiles": {
    -                                "field": "duration_ms",
    -                                "percents": [
    +                    "aggs": {
    +                        "duration_ms|percentiles(90)": {
    +                            "percentiles": {
    +                                "field": "duration_ms",
    +                                "percents": [
                                         90
                                     ]
                                 }
                             }
                         }
                     },
    -                "duration_ms|percentiles(90)": {
    -                    "percentiles": {
    -                        "field": "duration_ms",
    -                        "percents": [
    +                "duration_ms|percentiles(90)": {
    +                    "percentiles": {
    +                        "field": "duration_ms",
    +                        "percents": [
                                 90
                             ]
                         }
    @@ -640,48 +2507,36 @@ 

    Sorting Metric Terms

    } } }, - "size": 0 + "size": 0 } -
    -

    Idempotency

    - +

    Idempotency

    Moesif Collector API support idempotent requests. This ensures Moesif does not create duplicate events even if the same event was sent twice to the Moesif Collector API. -For users and companies APIs, this is automatic. For events and actions APIs, ensure you set the transaction_id for each event to a random UUID. -This should be a 36 character UUID such as 123e4567-e89b-12d3-a456-426614174000. Moesif uses the transaction_id for ensuring duplicate events are not created. -Setting the transaction_id is strongly recommended if you can replay processing from a pipeline like logstash.

    - -

    Deduplication for Batches

    - -

    Because each event has it’s own transaction_id, Moesif will still deduplicate even if the batches are different. -For example, let’s say you send the following batches:

    +For users and companies APIs, this is automatic. For events and actions APIs, ensure you set the transaction_id for each event to a random UUID. +This should be a 36 character UUID such as 123e4567-e89b-12d3-a456-426614174000. Moesif uses the transaction_id for ensuring duplicate events are not created. +Setting the transaction_id is strongly recommended if you can replay processing from a pipeline like logstash.

    +

    Deduplication for Batches

    +

    Because each event has it's own transaction_id, Moesif will still deduplicate even if the batches are different. +For example, let's say you send the following batches:

      -
    1. Send a batch of two events containing transaction_id’s A, B
    2. +
    3. Send a batch of two events containing transaction_id's A, B
    4. Send a batch of one event containing transaction_id C
    5. -
    6. Send a batch of three events containing transaction_id’s A, C, D
    7. +
    8. Send a batch of three events containing transaction_id's A, C, D

    At the end, Moesif will only contain 4 events (A, B, C, D)

    - -

    Request Format

    - -

    For POST, PUT, and PATCH requests, the request body should be JSON. The Content-Type header -should be set to application/json

    - -

    Response Format

    - +

    Request Format

    +

    For POST, PUT, and PATCH requests, the request body should be JSON. The Content-Type header +should be set to application/json

    +

    Response Format

    The response body format is always JSON. Successful operations are seen via 2xx status code. Successful creation of new objects will be seen via 201. 4xx status implies client error.

    The REST API JSON payload uses underscore format (i.e some_key). Many of the API libs may use camelCase, PascalCase, or other as their model entities. Please select the respective language tab.

    - -

    CORS

    - -

    CORS is enabled on this API. Access-Control-Allow-Origin is set to *

    - -

    Errors

    - +

    CORS

    +

    CORS is enabled on this API. Access-Control-Allow-Origin is set to *

    +

    Errors

    @@ -690,58 +2545,54 @@

    Errors

    - + - + - + - + - + - + - + - + - + - + - +
    Error Code
    400Bad Request – Your request has an incorrect parameterBad Request -- Your request has an incorrect parameter
    401Unauthorized – Your X-Moesif-Application-Id or Authorization header is incorrect or missing required scopesUnauthorized -- Your X-Moesif-Application-Id or Authorization header is incorrect or missing required scopes
    402Payment Required – Your subscription is not active or has been cancelledPayment Required -- Your subscription is not active or has been cancelled
    404Not Found – The specified endpoint could not be foundNot Found -- The specified endpoint could not be found
    405Method Not Allowed – You tried to access a resource with an invalid HTTP methodMethod Not Allowed -- You tried to access a resource with an invalid HTTP method
    406Not Acceptable – You requested a format that is not JSON format, Moesif’s API supports JSONNot Acceptable -- You requested a format that is not JSON format, Moesif's API supports JSON
    410Gone – The resource requested has been removed from our serversGone -- The resource requested has been removed from our servers
    429Too Many Requests – You are hitting a rate limit such as too many queries at same time.Too Many Requests -- You are hitting a rate limit such as too many queries at same time.
    500Internal Server Error – We had a problem with our server. Please contact usInternal Server Error -- We had a problem with our server. Please contact us
    502Bad Gateway – A transient error when no server is available to handle your request, retry again or contact us if problem persists.Bad Gateway -- A transient error when no server is available to handle your request, retry again or contact us if problem persists.
    503Service Unavailable – A transient error when no server is available to handle your request, retry again or contact us if problem persists.Service Unavailable -- A transient error when no server is available to handle your request, retry again or contact us if problem persists.
    - -

    Limits and Restrictions

    - +

    Limits and Restrictions

    Moesif has certain limits to ensure performance and stability for all Moesif customers. The Management APIs are rate limited to protect service degradation. Moesif also has limits on event size to ensure performance of your account.

    Moesif does not rate limit data ingestion via the collector APIs. However, you can still be throttled due to security reasons to product Moesif infrastructure. This may happen when unusual behavior is detected such as exceeding your quota by a wide margin

    - -

    Maximum Event Size

    - +

    Maximum Event Size

    Collected events have size limits to ensure performance and stability of the Moesif platform for customers.

    @@ -767,39 +2618,31 @@

    Maximum Event Size

    The maximum size of an event (one API call or user action) is 1MB, which is a hard limit due to how the Moesif platform was architected for scale. Majority of APIs we see have an average event size of 1Kb to 5Kb so it would be unusual to reach this limit. With that said, there are a couple of things you can try:

      -
    1. Don’t log non API traffic using skip functionality (i.e. HTML, pictures, etc). Moesif is not designed for monitoring access to large files nor provides much usefulness.
    2. -
    3. Remove large keys from payload using mask data. This can be helpful if you have a JSON key that’s large but not valuable.
    4. +
    5. Don't log non API traffic using skip functionality (i.e. HTML, pictures, etc). Moesif is not designed for monitoring access to large files nor provides much usefulness.
    6. +
    7. Remove large keys from payload using mask data. This can be helpful if you have a JSON key that's large but not valuable.
    -

    If you’re sending a batch of events to the batch API, the maximum batch size is 50MB regardless if compression is used. For batches of events greater than 50MB, you should break up the batch into smaller batches.

    +

    If you're sending a batch of events to the batch API, the maximum batch size is 50MB regardless if compression is used. For batches of events greater than 50MB, you should break up the batch into smaller batches.

    -

    Moesif will still try to log events over 1MB by truncating the request or response body to 450Kb and base64 encoded it. The logged body won’t be valid JSON but at least the event is logged for later inspection. A warning is also displayed in the Moesif app so you can identify when this is occurring. The partial body will not be analyzed by Moesif’s body analytics feature so filters may not match on body fields, etc.

    - -

    Management API Rate Limits

    - -

    To ensure performance of search queries, the Management API has a rate limit of 500 queries/minute, but can burst higher based on your history and pattern. The Management API will return 429 Too Many Requests once you hit this limit. This operates on a fixed calendar minute period. Moesif reserves the right to modify these limits to protect the reliability of the Moesif Platform.

    +

    Moesif will still try to log events over 1MB by truncating the request or response body to 450Kb and base64 encoded it. The logged body won't be valid JSON but at least the event is logged for later inspection. A warning is also displayed in the Moesif app so you can identify when this is occurring. The partial body will not be analyzed by Moesif's body analytics feature so filters may not match on body fields, etc.

    +

    Management API Rate Limits

    +

    To ensure performance of search queries, the Management API has a rate limit of 500 queries/minute, but can burst higher based on your history and pattern. The Management API will return 429 Too Many Requests once you hit this limit. This operates on a fixed calendar minute period. Moesif reserves the right to modify these limits to protect the reliability of the Moesif Platform.

    The search APIs are intended for interactive workflows such as logging into Moesif UI or to integrate Moesif into your applications. If you need to transfer large amounts of data to cloud object storage (like Azure Storage) or to your data warehouse, you should use the bulk export APIs and not the search API.

    Moesif does not rate limit data ingestion via the collector APIs. However, you can still be throttled due to security reasons to product Moesif infrastructure. This may happen when unusual behavior is detected such as exceeding your quota by a wide margin

    - -

    Late Events

    - +

    Late Events

    Moesif server integrations stream events to the collector API in real-time. If you build a custom integration, you should also send events in real-time.

    However, we understand you may have special circumstances that cause events to be sent later than expected. By default, Moesif can process events that are up to 30 days in the past. By default, events older than 30 days are rejected by the collector API. If you need an exception to backfill more historical data, please contact us so we can enable your account for backfill.

    -

    While Moesif will process the events, events that are more than 5 minutes old are considered “late events”. Certain workflows with strict deadlines like alerting and billing may be impacted. If you’re using a native Moesif server integrations, this shouldn’t be an issue as they stream events to Moesif in real-time within milliseconds. If you have an ingestion delay in the minutes it likely implies something wrong with your server integration. Server clock can be another issue if incorrectly set. We do track ingestion delays internally, so we’ll reach out if we see such issues happening on your account.

    - -

    API Libs

    - +

    While Moesif will process the events, events that are more than 5 minutes old are considered "late events". Certain workflows with strict deadlines like alerting and billing may be impacted. If you're using a native Moesif server integrations, this shouldn't be an issue as they stream events to Moesif in real-time within milliseconds. If you have an ingestion delay in the minutes it likely implies something wrong with your server integration. Server clock can be another issue if incorrectly set. We do track ingestion delays internally, so we'll reach out if we see such issues happening on your account.

    +

    API Libs

    THese are low-level libraries to access the Moesif Collector API directly. For logging API calls at scale, most -customers should integrate with one of Moesif’s API monitoring agents which instrument your API automatically and handle batching. Likewise, Moesif has client integrations for tracking users and their actions in your UI.

    - -

    How to Install

    -
    Pick a language at the bottom left
    -
    +customers should integrate with one of Moesif's API monitoring agents which instrument your API automatically and handle batching. Likewise, Moesif has client integrations for tracking users and their actions in your UI.

    +

    How to Install

    Pick a language at the bottom left
    +
    @@ -808,89 +2651,89 @@

    How to Install

    Source Code:

    https://github.com/moesif/moesifapi-java
    -
    // Add the dependency
    +
    // Add the dependency
     
     <dependency>
         <groupId>com.moesif.api</groupId>
         <artifactId>moesifapi</artifactId>
         <version>1.6.9</version>
     </dependency>
    -
    +
    Source Code:

    https://github.com/moesif/moesifapi-nodejs


    Package:

    https://www.npmjs.com/package/moesifapi
    -
    // To Install Moesif Lib, run in your terminal
    +
    // To Install Moesif Lib, run in your terminal
     
     npm install --save moesifapi
    -
    +
    Source Code:

    https://github.com/moesif/moesifapi-python


    Package:

    https://pypi.python.org/pypi/moesifapi
    -
    # To Install Moesif Lib, run in your terminal
    -
    +
    # To Install Moesif Lib, run in your terminal
    +
     pip install moesifapi
    -
    +
    Source Code:

    https://github.com/moesif/moesifapi-ruby


    Package:

    https://rubygems.org/gems/moesif_api
    -
    # To Install Moesif Lib, run in your terminal
    +
    # To Install Moesif Lib, run in your terminal
     
     gem install moesif_api
    -
    +
    Source Code:

    https://github.com/moesif/moesifapi-csharp


    Package:

    https://www.nuget.org/packages/Moesif.Api/
    -
    // Install the Nuget Package via Package Manager Console:
    +
    // Install the Nuget Package via Package Manager Console:
     
     Install-Package Moesif.Api
    -
    +
    Source Code:

    https://github.com/Moesif/moesifapi-go
    -
    
    -go get github.com/moesif/moesifapi-go;
    -
    +
    
    +go get github.com/moesif/moesifapi-go;
    +
    Source Code:

    https://github.com/Moesif/moesifapi-php
    -
    // Install via Composer
    +
    // Install via Composer
     
    -composer require moesif/moesifapi-php
    -
    +composer require moesif/moesifapi-php +
    Install via NPM:
    -
    var moesif = require('moesif-browser-js');
    +
    var moesif = require('moesif-browser-js');
     
     moesif.init({
    -  applicationId: 'YOUR_COLLECTOR_APPLICATION_ID'
    +  applicationId: 'YOUR_COLLECTOR_APPLICATION_ID'
       // add other option here.
     });
    -
    +
    Install via CDN
    -
    <script src="//unpkg.com/moesif-browser-js@^1/moesif.min.js"></script>
    -<script type="text/javascript">
    +
    <script src="//unpkg.com/moesif-browser-js@^1/moesif.min.js"></script>
    +<script type="text/javascript">
     moesif.init({
    -  applicationId: 'YOUR_COLLECTOR_APPLICATION_ID'
    +  applicationId: 'YOUR_COLLECTOR_APPLICATION_ID'
     });
     </script>
    -
    +

    Select your language on the right:

    - - + +
    api.moesif.net/v1localhost:9500/collector/v1api.moesif.net/v1localhost:9500/collector/v1
    -

    If you’re using the Moesif secure proxy for client-side encryption, the base URL is http://localhost:9500/collector/v1 assuming it’s running on port 9500. See accessing Collector API

    +

    If you're using the Moesif secure proxy for client-side encryption, the base URL is http://localhost:9500/collector/v1 assuming it's running on port 9500. See accessing Collector API

    Terms of service

    -

    Moesif’s official SDKs and plugins only use HTTPS, but the API does support HTTP for very specific applications like legacy embedded devices (uncommon). -It’s strongly recommended to ensure all communication is HTTPS.

    - -

    Authentication

    - -

    Authentication is handled by adding the HTTP header X-Moesif-Application-Id to all requests. +

    Moesif's official SDKs and plugins only use HTTPS, but the API does support HTTP for very specific applications like legacy embedded devices (uncommon). +It's strongly recommended to ensure all communication is HTTPS.

    +

    Authentication

    +

    Authentication is handled by adding the HTTP header X-Moesif-Application-Id to all requests. Moesif recommends using the same Application Id for all integrations within the same application environment (i.e. product, staging, etc) so your analytics data is unified.

    -

    X-Moesif-Application-Id: YOUR_COLLECTOR_APPLICATION_ID

    +

    X-Moesif-Application-Id: YOUR_COLLECTOR_APPLICATION_ID

    - -

    API Calls

    - -

    Log an API Call

    - -

    POST https://api.moesif.net/v1/events

    +

    API Calls

    Log an API Call

    +

    POST https://api.moesif.net/v1/events

    Log a single API call to Moesif. The request payload is a single API event model containing the API request, the API response, and any custom event metadata.