Skip to content

Commit

Permalink
changed env variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
niemijoe committed Aug 9, 2022
1 parent ba8d8c5 commit e7c0b28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions mqtt_data_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def listen_topic_thread(topic_data_string):
threads[i].join()

send_mqtt_msg_count_into_azure(topic_data_collection)
print(f'Mqtt metrics sent: {datetime.now().strftime("%Y-%m-%dT%H:%M:%S")}')

def listen_topic(topic_data_collection, address, topic, port):
"""
Expand Down
5 changes: 2 additions & 3 deletions send_data_to_azure_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
TENANT_ID=os.getenv('TENANT_ID')
CLIENT_ID=os.getenv('CLIENT_ID')
CLIENT_SECRET=os.getenv('CLIENT_SECRET')
PULSAR_PROXY_RESOURCE_ID=os.getenv('PULSAR_PROXY_RESOURCE_ID')
MONITOR_DATA_COLLECTOR_RESOURCE_ID=os.getenv('MONITOR_DATA_COLLECTOR_RESOURCE_ID')
ACCESS_TOKEN_PATH = os.getenv('ACCESS_TOKEN_PATH')

### SECRETS / ENV VARIABLES ###
Expand All @@ -27,8 +27,7 @@ def send_custom_metrics_request(custom_metric_json, attempts_remaining):
existing_access_token = f.read()
f.close()

pulsar_proxy_resource_id = PULSAR_PROXY_RESOURCE_ID
request_url = f'https://westeurope.monitoring.azure.com/{pulsar_proxy_resource_id}/metrics'
request_url = f'https://westeurope.monitoring.azure.com/{MONITOR_DATA_COLLECTOR_RESOURCE_ID}/metrics'
headers = {'Content-type': 'application/json', 'Authorization': f'Bearer {existing_access_token}'}
response = requests.post(request_url, data=custom_metric_json, headers=headers)

Expand Down

0 comments on commit e7c0b28

Please sign in to comment.