Skip to content

Commit 90cd629

Browse files
authored
Updating Python APM for Middleware v2 (#37)
1 parent 2f1cc11 commit 90cd629

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

middleware/lib/_profiler.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ def collect_profiling(service_name, access_token="") -> None:
1111
# Setting Middleware Account Authentication URL
1212
auth_url = os.getenv('MW_AUTH_URL', 'https://app.middleware.io/api/v1/auth')
1313

14-
# Setting Middleware Profiling Server URL
15-
profiling_server_url = os.getenv('MW_PROFILING_SERVER_URL', 'https://profiling.middleware.io')
16-
1714
headers = {
1815
"Content-Type": "application/x-www-form-urlencoded",
1916
# "Authorization": "Bearer " + c.accessToken
@@ -29,6 +26,11 @@ def collect_profiling(service_name, access_token="") -> None:
2926
# Checking if a tenantID could be fetched from API Key
3027
if data["success"]:
3128
account = data["data"]["account"]
29+
30+
# Setting Middleware Profiling Server URL
31+
default_profiling_server_url = f'https://{account}.middleware.io'
32+
profiling_server_url = os.getenv('MW_PROFILING_SERVER_URL', default_profiling_server_url)
33+
3234
pyroscope.configure(
3335
application_name=service_name, # replace this with some name for your application
3436
server_address=profiling_server_url,

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
setuptools.setup(
2121
name="middleware-apm",
22-
version="0.4.1",
22+
version="0.5.0rc1",
2323
install_requires=requirements,
2424
author="middleware-dev",
2525
maintainer="middleware-dev",

0 commit comments

Comments
 (0)