Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 5a90adb

Browse files
authored
Merge pull request #27 from signalfx/lambda_fix
Remove trailing slashes from endpoint url
2 parents 38b717a + f6e0113 commit 5a90adb

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Environment Variables
4040

4141
# endpoint for both metrics and tracer. Overridden by SIGNALFX_METRICS_URL
4242
# and SIGNALFX_TRACING_URL if set
43-
SIGNALFX_ENDPOINT_URL=endpoint url
43+
SIGNALFX_ENDPOINT_URL=http://<my_gateway>:8080
4444

4545
# optional metrics and tracing configuration
4646

@@ -60,7 +60,7 @@ For example, if only SIGNALFX_ENDPOINT_URL is set:
6060

6161
::
6262

63-
SIGNALFX_ENDPOINT_URL=<gateway_address>
63+
SIGNALFX_ENDPOINT_URL=http://<my_gateway>:8080
6464

6565
both metrics and traces will be sent to the gateway address.
6666

@@ -70,7 +70,7 @@ If SIGNALFX_ENDPOINT_URL and SIGNALFX_METRICS_URL are set:
7070

7171
SIGNALFX_METRICS_URL=https://pops.signalfx.com
7272

73-
SIGNALFX_ENDPOINT_URL=<gateway_address>
73+
SIGNALFX_ENDPOINT_URL=http://<my_gateway>:8080
7474

7575
Traces will be sent to the gateway and metrics will go through POPS.
7676

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
signalfx>=1.0.16
22
sfx-jaeger-client>=3.13.1.dev0
3+
six>=1.4.0

signalfx_lambda/utils.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import warnings
3+
import six.moves.urllib.parse as urlparse
34

45
from .version import name, version
56

@@ -60,17 +61,11 @@ def get_metrics_url():
6061

6162
def get_tracing_url():
6263
url = os.environ.get('SIGNALFX_TRACING_URL')
64+
if url:
65+
return url
6366

64-
if not url:
65-
url = os.environ.get('SIGNALFX_ENDPOINT_URL')
66-
67-
if url:
68-
# if the common endpoint url is used, we need to append the trace path
69-
url = url + '/v1/trace'
70-
else:
71-
url = 'https://ingest.signalfx.com/v1/trace'
72-
73-
return url
67+
url = os.environ.get('SIGNALFX_ENDPOINT_URL', 'https://ingest.signalfx.com')
68+
return urlparse.urljoin(url, '/v1/trace')
7469

7570

7671
def get_access_token():

0 commit comments

Comments
 (0)