Skip to content

Commit c9a05ca

Browse files
committed
release 0.5.0
1 parent 5136f27 commit c9a05ca

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

ChangeLog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
1+
# ChangeLog
2+
3+
## 0.5.0
4+
5+
* Check body size not to exceed data limit of 30MB in Azure Monitor Data Collection API - [issue #12](https://github.com/yokawasa/azure-log-analytics-data-collector/issues/12)
6+
17
## 0.4.0
8+
29
* restclient retries request on the following status code - [issue #10](https://github.com/yokawasa/azure-log-analytics-data-collector/issues/10)
310
* 429 - Too Many Requests
411
* 500 - Internal Server Error
512
* 503 - Service Unavailable
613

714
## 0.3.0
15+
816
* Enhance log type validation: check not only alpha but also numeric, underscore, and character length (may not exceed 100) - [issue #11](https://github.com/yokawasa/azure-log-analytics-data-collector/issues/11)
917

1018
## 0.2.0
19+
1120
* Support setting the x-ms-AzureResourceId Header - [issue #8](https://github.com/yokawasa/azure-log-analytics-data-collector/issues/8)
1221

1322
## 0.1.6
23+
1424
* fix CVE-2020-8130 - [issue #7](https://github.com/yokawasa/azure-log-analytics-data-collector/issues/7)
1525

1626
## 0.1.5
27+
1728
* Add endpoint parameter with the default value for Azure public - [PR#5](https://github.com/yokawasa/azure-log-analytics-data-collector/pull/5)
1829

1930
## 0.1.4
31+
2032
* Add `set_proxy` method to client - [issue#3](https://github.com/yokawasa/azure-log-analytics-data-collector/issues/3)
2133

2234
## 0.1.2
35+
2336
* fixedup bug - [issue #1](https://github.com/yokawasa/azure-log-analytics-data-collector/issues/1)
2437

2538
## 0.1.1

lib/azure/loganalytics/datacollectorapi/client.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class Client
1010

1111
DEFAUT_MAX_RETRIES = 3.freeze
1212
DEFAULT_RETRY_SLEEP_PERIOD = 5.freeze
13+
# API Data Limits
14+
# https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-collector-api#data-limits
15+
MAX_BODY_BYTE_SIZE = 31457280.freeze # 30 MB
1316

1417
def initialize (customer_id, shared_key, endpoint ='ods.opinsights.azure.com')
1518
require 'rest-client'
@@ -31,7 +34,11 @@ def post_data(log_type, json_records, record_timestamp ='', azure_resource_id ='
3134
raise ConfigError, 'no log_type' if log_type.empty?
3235
raise ConfigError, 'log_type must only contain alpha numeric and _, and not exceed 100 chars' if not is_valid_log_type(log_type)
3336
raise ConfigError, 'no json_records' if json_records.empty?
37+
3438
body = json_records.to_json
39+
body_size = body.bytesize
40+
raise "too large payload (#{body_size})! max post data size is #{MAX_BODY_BYTE_SIZE} bytes!" if body_size >= MAX_BODY_BYTE_SIZE
41+
3542
uri = sprintf("https://%s.%s/api/logs?api-version=%s",
3643
@customer_id, @endpoint, API_VERSION)
3744
date = rfc1123date()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Azure
22
module Loganalytics
33
module Datacollectorapi
4-
VERSION = "0.4.0"
4+
VERSION = "0.5.0"
55
end
66
end
77
end

0 commit comments

Comments
 (0)