dt-extensions-sdk 1.2.10__py3-none-any.whl → 1.2.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dt-extensions-sdk
3
- Version: 1.2.10
3
+ Version: 1.2.13
4
4
  Project-URL: Documentation, https://github.com/dynatrace-extensions/dt-extensions-python-sdk#readme
5
5
  Project-URL: Issues, https://github.com/dynatrace-extensions/dt-extensions-python-sdk/issues
6
6
  Project-URL: Source, https://github.com/dynatrace-extensions/dt-extensions-python-sdk
@@ -1,7 +1,7 @@
1
- dynatrace_extension/__about__.py,sha256=UCzj5J-y_MhH9st24FTKIZWRmWkExlr8erwQX8bUE_o,110
1
+ dynatrace_extension/__about__.py,sha256=bCpEm1YjYWPV0AQD731avO3Y3pKtXW57qfobWsPyITw,111
2
2
  dynatrace_extension/__init__.py,sha256=BvQuknmA7ti3WJi3zEXZfY7aAxJrie37VNitWICsUvI,752
3
3
  dynatrace_extension/cli/__init__.py,sha256=HCboY_eJPoqjFmoPDsBL8Jk6aNvank8K7JpkVrgwzUM,123
4
- dynatrace_extension/cli/main.py,sha256=ZOqxZsaMJRZsqR3Og2a9h2PDlkyJE8tAny-p7Mb7dmA,17254
4
+ dynatrace_extension/cli/main.py,sha256=qv6BRgoyvhThhRh64OzL6OYHSLoxiJgWlZIxUDxKX4E,17995
5
5
  dynatrace_extension/cli/schema.py,sha256=d8wKUodRiaU3hfSZDWVNpD15lBfhmif2oQ-k07IxcaA,3230
6
6
  dynatrace_extension/cli/create/__init__.py,sha256=NfyOJCVlxs8dYtfDAMHS1Q5SJTuZcFzOg5rtaI-ZPRE,72
7
7
  dynatrace_extension/cli/create/create.py,sha256=apXden2M93MDDDm7aa-Os-AEtUtyKbk_PsS56j32NK4,2708
@@ -15,20 +15,20 @@ dynatrace_extension/cli/create/extension_template/extension_name/__init__.py.tem
15
15
  dynatrace_extension/cli/create/extension_template/extension_name/__main__.py.template,sha256=NYuZ6BWZ6HOs4TCuboh6S0nuYp3F8MXW2lmjSpdREEA,1205
16
16
  dynatrace_extension/sdk/__init__.py,sha256=RsqQ1heGyCmSK3fhuEKAcxQIRCg4gEK0-eSkIehL5Nc,86
17
17
  dynatrace_extension/sdk/activation.py,sha256=goTbT1tD2kn8xfyXFdTy_cTZNcFPJpgbvQM8HOzKECA,1480
18
- dynatrace_extension/sdk/callback.py,sha256=FJSkaBF895NZquUtpSj1I2vel2Rx-y-2da8mKX_pk4I,6307
19
- dynatrace_extension/sdk/communication.py,sha256=gD4GOHOzWdRL_KrUWtC2s8-Jp8Csn5gjZl4mHO5Lk_4,17739
18
+ dynatrace_extension/sdk/callback.py,sha256=PNRvOVzNpKvpsa0wCf7HRDkfo3wMsF2otVWI9a1AAkU,6307
19
+ dynatrace_extension/sdk/communication.py,sha256=lPUKxAq3mO8cO1ye79p9nuxYL-_cG6G4cJRzBZxD64w,17792
20
20
  dynatrace_extension/sdk/event.py,sha256=J261imbFKpxfuAQ6Nfu3RRcsIQKKivy6fme1nww2g-8,388
21
- dynatrace_extension/sdk/extension.py,sha256=q5sZ4Uo6xVROtjzgRWPsZcCqNlL5KpXEiK4lMCIF5Dg,42758
21
+ dynatrace_extension/sdk/extension.py,sha256=rmYF9vzA75JKvLPCr_r48EPhNz_AzWMuvlX2gmlxsIY,42808
22
22
  dynatrace_extension/sdk/helper.py,sha256=ZNrO9ao2hE3KQ934vAYD74k0fCr6QTG-_bAvbk9-hi8,6562
23
23
  dynatrace_extension/sdk/metric.py,sha256=7VClzJCFJNDCxA-d69uTu1pdPtDZBTwq7fbafs_L6nQ,3690
24
24
  dynatrace_extension/sdk/runtime.py,sha256=jyYsM1x-gMnW68eWq8IoZZZBarHgIcr_nVeGDDgpRDk,2802
25
- dynatrace_extension/sdk/snapshot.py,sha256=UZgSHEIo4t5AJGU2xSTenJkAfKAxue0MORhQL8pC5pc,6815
25
+ dynatrace_extension/sdk/snapshot.py,sha256=0Zx4lmhanoLvfvMTnkxWfcIsx2VUDm99FAqV0XZHoLA,7100
26
26
  dynatrace_extension/sdk/vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  dynatrace_extension/sdk/vendor/mureq/LICENSE,sha256=8AVcgZgiT_mvK1fOofXtRRr2f1dRXS_K21NuxQgP4VM,671
28
28
  dynatrace_extension/sdk/vendor/mureq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  dynatrace_extension/sdk/vendor/mureq/mureq.py,sha256=znF4mvzk5L03CLNozRz8UpK-fMijmSkObDFwlbhwLUg,14656
30
- dt_extensions_sdk-1.2.10.dist-info/METADATA,sha256=dRd36rG1hIYmH4O7Wm5-oIlaXnzZGd-aJxFVFUTF-wo,2686
31
- dt_extensions_sdk-1.2.10.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
32
- dt_extensions_sdk-1.2.10.dist-info/entry_points.txt,sha256=pweyOCgENGHjOlT6_kXYaBPOrE3p18K0UettqnNlnoE,55
33
- dt_extensions_sdk-1.2.10.dist-info/licenses/LICENSE.txt,sha256=3Zihv0lOVYHNfDkJC-tUAU6euP9r2NexsDW4w-zqgVk,1078
34
- dt_extensions_sdk-1.2.10.dist-info/RECORD,,
30
+ dt_extensions_sdk-1.2.13.dist-info/METADATA,sha256=rp2tcD0jb7wAguIj20f1hUh_wx2SzSIgb6_Vy6skViQ,2686
31
+ dt_extensions_sdk-1.2.13.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
32
+ dt_extensions_sdk-1.2.13.dist-info/entry_points.txt,sha256=pweyOCgENGHjOlT6_kXYaBPOrE3p18K0UettqnNlnoE,55
33
+ dt_extensions_sdk-1.2.13.dist-info/licenses/LICENSE.txt,sha256=3Zihv0lOVYHNfDkJC-tUAU6euP9r2NexsDW4w-zqgVk,1078
34
+ dt_extensions_sdk-1.2.13.dist-info/RECORD,,
@@ -2,4 +2,5 @@
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
4
 
5
- __version__ = "1.2.10"
5
+
6
+ __version__ = "1.2.13"
@@ -91,6 +91,12 @@ def build(
91
91
  find_links: Optional[str] = typer.Option(
92
92
  None, "--find-links", "-f", help="Extra index url to use when downloading dependencies"
93
93
  ),
94
+ only_extra_platforms: Optional[bool] = typer.Option(
95
+ False,
96
+ "--only-extra-platforms",
97
+ "-o",
98
+ help="Only build for the extra platforms, useful when building from arm64 (mac)",
99
+ ),
94
100
  ):
95
101
  """
96
102
  Builds and signs an extension using the developer fused key-certificate
@@ -103,6 +109,7 @@ def build(
103
109
  :param extra_platforms: Attempt to also download wheels for an extra platform (e.g. manylinux1_x86_64 or win_amd64)
104
110
  :param extra_index_url: Extra index url to use when downloading dependencies
105
111
  :param find_links: Extra index url to use when downloading dependencies
112
+ :param only_extra_platforms: If true, only build for the extra platforms, useful when building from arm64
106
113
  """
107
114
  console.print(f"Building and signing extension from {extension_dir} to {target_directory}", style="cyan")
108
115
  if target_directory is None:
@@ -111,7 +118,7 @@ def build(
111
118
  target_directory.mkdir()
112
119
 
113
120
  console.print("Stage 1 - Download and build dependencies", style="bold blue")
114
- wheel(extension_dir, extra_platforms, extra_index_url, find_links)
121
+ wheel(extension_dir, extra_platforms, extra_index_url, find_links, only_extra_platforms)
115
122
 
116
123
  console.print("Stage 2 - Create the extension zip file", style="bold blue")
117
124
  built_zip = assemble(extension_dir, target_directory)
@@ -179,6 +186,12 @@ def wheel(
179
186
  find_links: Optional[str] = typer.Option(
180
187
  None, "--find-links", "-f", help="Extra index url to use when downloading dependencies"
181
188
  ),
189
+ only_extra_platforms: Optional[bool] = typer.Option(
190
+ False,
191
+ "--only-extra-platforms",
192
+ "-o",
193
+ help="Only build for the extra platforms, useful when building from arm64 (mac)",
194
+ ),
182
195
  ):
183
196
  """
184
197
  Builds the extension and it's dependencies into wheel files
@@ -188,6 +201,7 @@ def wheel(
188
201
  :param extra_platforms: Attempt to also download wheels for an extra platform (e.g. manylinux1_x86_64 or win_amd64)
189
202
  :param extra_index_url: Extra index url to use when downloading dependencies
190
203
  :param find_links: Extra index url to use when downloading dependencies
204
+ :param only_extra_platforms: If true, only build for the extra platforms, useful when building from arm64
191
205
  """
192
206
  relative_lib_folder_dir = "extension/lib"
193
207
  lib_folder: Path = extension_dir / relative_lib_folder_dir
@@ -201,6 +215,8 @@ def wheel(
201
215
  command.extend(["--extra-index-url", extra_index_url])
202
216
  if find_links is not None:
203
217
  command.extend(["--find-links", find_links])
218
+ if only_extra_platforms:
219
+ command.append("--no-deps")
204
220
  command.append(".")
205
221
  run_process(command, cwd=extension_dir)
206
222
 
@@ -89,13 +89,13 @@ class WrappedCallback:
89
89
  def initial_wait_time(self) -> float:
90
90
  if not self.running_in_sim:
91
91
  """
92
- Here we chose a random second between 1 and 59 to start the callback
92
+ Here we chose a random second between 5 and 55 to start the callback
93
93
  This is to distribute load for extension running on this host
94
94
  When running from the simulator, this is not done
95
95
  """
96
96
 
97
97
  now = self.get_current_time_with_cluster_diff()
98
- random_second = random.randint(1, 59) # noqa: S311
98
+ random_second = random.randint(5, 55) # noqa: S311
99
99
  next_execution = datetime.now().replace(second=random_second, microsecond=0)
100
100
  if next_execution <= now:
101
101
  # The random chosen second already passed this minute
@@ -397,17 +397,18 @@ class DebugClient(CommunicationClient):
397
397
 
398
398
  batches = divide_into_batches(mint_lines, MAX_METRIC_REQUEST_SIZE)
399
399
  for batch in batches:
400
+ lines = json.loads(batch)
400
401
  if self.local_ingest:
401
402
  response = request(
402
403
  "POST",
403
404
  f"http://localhost:{self.local_ingest_port}/metrics/ingest",
404
- body=batch,
405
+ body="\n".join(lines).encode(),
405
406
  headers={"Content-Type": CONTENT_TYPE_PLAIN},
406
407
  ).json()
407
408
  mint_response = MintResponse.from_json(response)
408
409
  responses.append(mint_response)
409
410
  elif self.print_metrics:
410
- for line in mint_lines:
411
+ for line in lines:
411
412
  self.logger.info(f"send_metric: {line}")
412
413
 
413
414
  return responses
@@ -984,6 +984,8 @@ class Extension:
984
984
  callback.cluster_time_diff = self._cluster_time_diff
985
985
 
986
986
  def _heartbeat(self):
987
+ if self._is_fastcheck:
988
+ return
987
989
  response = bytes("not set", "utf-8")
988
990
  try:
989
991
  overall_status = self._build_current_status()
@@ -193,6 +193,12 @@ def find_log_dir() -> Path:
193
193
  for line in f:
194
194
  if line.startswith("LogDir"):
195
195
  log_dir = line.split("=")[1].strip()
196
+ if not log_dir:
197
+ return (
198
+ Path(os.path.expandvars("%PROGRAMDATA%") + "/dynatrace/oneagent/log")
199
+ if os.name == "nt"
200
+ else Path("/var/log/dynatrace/oneagent")
201
+ )
196
202
  return Path(log_dir)
197
203
  msg = f"Could not find LogDir in {installation_conf}"
198
204
  raise Exception(msg)