azure.anomalydetector
Module azure.anomalydetector
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_azure.anomalydetector_1.5.1.png)
ballerinax/azure.anomalydetector Ballerina library
Overview
This is a generated connector for Azure Anomaly Detector API v1 OpenAPI specification.
Anomaly Detector ingests time-series data of all types and selects the best anomaly detection algorithm for your data to ensure high accuracy. Detect spikes, dips, deviations from cyclic patterns, and trend changes through both univariate and multivariate APIs. Customize the service to detect any level of anomaly. Deploy the anomaly detection service where you need it—in the cloud or at the intelligent edge.
This module supports Azure Anomaly Detector API v1.
Clients![](/images/permalink.svg)
azure.anomalydetector: Client![](/images/permalink.svg)
This is a generated connector for Azure Anomaly Detector API v1 OpenAPI specification. "The Anomaly Detection service detects anomalies automatically in time\ \ series data. It supports several functionalities, \r\none is for detecting the\ \ whole series with model trained by the time series, another is detecting the\ \ last point \r\nwith model trained by points before. With this service, business\ \ customers can discover incidents and establish \r\na logic flow for root cause\ \ analysis. We also provide change point detection, which is another common scenario\ \ on \r\ntime series analysis and service monitoring. Change point detection targets\ \ to discover tend changes in the time series.\r\nTo ensure online service quality\ \ is one of the main reasons we developed this service. Our team is dedicated\ \ to \r\ncontinuing to improve the anomaly detection service to provide precise\ \ results."
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create a Azure Anomaly Detector account and obtain API key following this guide.
init (ApiKeysConfig apiKeyConfig, string serviceUrl, ConnectionConfig config)
- apiKeyConfig ApiKeysConfig - API keys for authorization
- serviceUrl string - URL of the target service
- config ConnectionConfig {} - The configurations to be used when initializing the
connector
postTimeseriesLastDetect![](/images/permalink.svg)
function postTimeseriesLastDetect(Request payload) returns LastResponse|error
Detect anomaly status of the latest point in time series.
Parameters
- payload Request - Time series points and period if needed. Advanced model parameters can also be set in the request.
Return Type
- LastResponse|error - Successful operation.
postTimeseriesEntireDetect![](/images/permalink.svg)
function postTimeseriesEntireDetect(Request payload) returns EntireDetectResponse|error
Find anomalies for the entire series in batch.
Parameters
- payload Request - Time series points and period if needed. Advanced model parameters can also be set in the request.
Return Type
- EntireDetectResponse|error - Successful operation.
postTimeseriesChangepointDetect![](/images/permalink.svg)
function postTimeseriesChangepointDetect(ChangePointDetectRequest payload) returns ChangePointDetectResponse|error
Find trend change point for the entire series in batch.
Parameters
- payload ChangePointDetectRequest - Time series points, granularity should be set in the request. Advanced model parameters can also be set in the request.
Return Type
- ChangePointDetectResponse|error - Successful operation.
Records![](/images/permalink.svg)
azure.anomalydetector: ApiKeysConfig![](/images/permalink.svg)
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- ocpApimSubscriptionKey string - Represents API Key
Ocp-Apim-Subscription-Key
- subscriptionKey string - Represents API Key
subscription-key
azure.anomalydetector: ChangePointDetectRequest![](/images/permalink.svg)
Fields
- series Point[] - Time series data points. Points should be sorted by timestamp in ascending order to match the change point detection result.
- granularity string - Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid.
- customInterval int? - Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}.
- period int? - Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically.
- stableTrendWindow int? - Optional argument, advanced model parameter, a default stableTrendWindow will be used in detection.
- threshold float? - Optional argument, advanced model parameter, between 0.0-1.0, the lower the value is, the larger the trend error will be which means less change point will be accepted.
azure.anomalydetector: ChangePointDetectResponse![](/images/permalink.svg)
Fields
- period int - Frequency extracted from the series, zero means no recurrent pattern has been found.
- isChangePoint boolean[] - isChangePoint contains change point properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series.
- confidenceScores float[] - the change point confidence of each point
azure.anomalydetector: ClientHttp1Settings![](/images/permalink.svg)
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
azure.anomalydetector: ConnectionConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
azure.anomalydetector: EntireDetectResponse![](/images/permalink.svg)
Fields
- period int - Frequency extracted from the series, zero means no recurrent pattern has been found.
- expectedValues float[] - ExpectedValues contain expected value for each input point. The index of the array is consistent with the input series.
- upperMargins float[] - UpperMargins contain upper margin of each input point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. Anomalies in response can be filtered by upperBoundary and lowerBoundary. By adjusting marginScale value, less significant anomalies can be filtered in client side. The index of the array is consistent with the input series.
- lowerMargins float[] - LowerMargins contain lower margin of each input point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin. Points between the boundary can be marked as normal ones in client side. The index of the array is consistent with the input series.
- isAnomaly boolean[] - IsAnomaly contains anomaly properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series.
- isNegativeAnomaly boolean[] - IsNegativeAnomaly contains anomaly status in negative direction for each input point. True means a negative anomaly has been detected. A negative anomaly means the point is detected as an anomaly and its real value is smaller than the expected one. The index of the array is consistent with the input series.
- isPositiveAnomaly boolean[] - IsPositiveAnomaly contain anomaly status in positive direction for each input point. True means a positive anomaly has been detected. A positive anomaly means the point is detected as an anomaly and its real value is larger than the expected one. The index of the array is consistent with the input series.
azure.anomalydetector: LastDetectResponse![](/images/permalink.svg)
Fields
- period int? - Frequency extracted from the series, zero means no recurrent pattern has been found.
- suggestedWindow int? - Suggested input series points needed for detecting the latest point.
- expectedValue float? - Expected value of the latest point.
- upperMargin float? - Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. If the value of latest point is between upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting marginScale value, anomaly status of latest point can be changed.
- lowerMargin float? - Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.
- isAnomaly boolean? - Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction.
- isNegativeAnomaly boolean? - Anomaly status in negative direction of the latest point. True means the latest point is an anomaly and its real value is smaller than the expected one.
- isPositiveAnomaly boolean? - Anomaly status in positive direction of the latest point. True means the latest point is an anomaly and its real value is larger than the expected one.
azure.anomalydetector: LastResponse![](/images/permalink.svg)
Fields
- period int? - Frequency extracted from the series, zero means no recurrent pattern has been found.
- suggestedWindow int? - Suggested input series points needed for detecting the latest point.
- expectedValue float? - Expected value of the latest point.
- upperMargin float? - Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. If the value of latest point is between upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting marginScale value, anomaly status of latest point can be changed.
- lowerMargin float? - Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.
- isAnomaly boolean? - Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction.
- isNegativeAnomaly boolean? - Anomaly status in negative direction of the latest point. True means the latest point is an anomaly and its real value is smaller than the expected one.
- isPositiveAnomaly boolean? - Anomaly status in positive direction of the latest point. True means the latest point is an anomaly and its real value is larger than the expected one.
azure.anomalydetector: Point![](/images/permalink.svg)
Fields
- timestamp string - Timestamp of a data point (ISO8601 format).
- value float - The measurement of that point, should be float.
azure.anomalydetector: ProxyConfig![](/images/permalink.svg)
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
azure.anomalydetector: Request![](/images/permalink.svg)
Fields
- series Point[] - Time series data points. Points should be sorted by timestamp in ascending order to match the anomaly detection result. If the data is not sorted correctly or there is duplicated timestamp, the API will not work. In such case, an error message will be returned.
- granularity string - Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid.
- customInterval int? - Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}.
- period int? - Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically.
- maxAnomalyRatio float? - Optional argument, advanced model parameter, max anomaly ratio in a time series.
- sensitivity int? - Optional argument, advanced model parameter, between 0-99, the lower the value is, the larger the margin value will be which means less anomalies will be accepted
Import
import ballerinax/azure.anomalydetector;
Metadata
Released date: over 1 year ago
Version: 1.5.1
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
IT Operations/Cloud Services
Cost/Paid
Vendor/Microsoft
Contributors
Dependencies