Skip to content

Commit 40cd08a

Browse files
basepibeniwohli
authored andcommitted
Change server_url default to avoid ipv6 ambiguity (elastic#1744)
* Change `server_url` default to avoid ipv6 ambiguity * Fix failing test and another minor doc fix
1 parent 9203917 commit 40cd08a

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ endif::[]
4040
===== Bug fixes
4141
4242
* Small fix to underlying Starlette logic to prevent duplicate Client objects {pull}1735[#1735]
43+
* Change `server_url` default to `http://127.0.0.1:8200` to avoid ipv6 ambiguity {pull}1744[#1744]
4344
4445
4546

docs/configuration.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ or whitespace-only.
110110
[options="header"]
111111
|============
112112
| Environment | Django/Flask | Default
113-
| `ELASTIC_APM_SERVER_URL` | `SERVER_URL` | `'http://localhost:8200'`
113+
| `ELASTIC_APM_SERVER_URL` | `SERVER_URL` | `'http://127.0.0.1:8200'`
114114
|============
115115

116116
The URL for your APM Server.

docs/django.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ NOTE: For automatic insertion to work,
8989
your list of middlewares (`settings.MIDDLEWARE` or `settings.MIDDLEWARE_CLASSES`) must be of type `list` or `tuple`.
9090

9191
In addition to broad request metrics (what will appear in the APM app as transactions),
92-
the agent also collects fine grained metrics on template rendering,
92+
the agent also collects fine grained metrics on template rendering,
9393
database queries, HTTP requests, etc.
9494
You can find more information on what we instrument in the <<automatic-instrumentation, Automatic Instrumentation>> section.
9595

@@ -363,7 +363,7 @@ Trying to send a test error using these settings:
363363
364364
SERVICE_NAME: <SERVICE_NAME>
365365
SECRET_TOKEN: <SECRET_TOKEN>
366-
SERVER: http://localhost:8200
366+
SERVER: http://127.0.0.1:8200
367367
368368
Success! We tracked the error successfully! You should be able to see it in a few seconds.
369369
----
@@ -372,4 +372,4 @@ Success! We tracked the error successfully! You should be able to see it in a fe
372372
[[supported-django-and-python-versions]]
373373
==== Supported Django and Python versions
374374

375-
A list of supported <<supported-django,Django>> and <<supported-python,Python>> versions can be found on our <<supported-technologies,Supported Technologies>> page.
375+
A list of supported <<supported-django,Django>> and <<supported-python,Python>> versions can be found on our <<supported-technologies,Supported Technologies>> page.

elasticapm/conf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ class Config(_ConfigBase):
550550
secret_token = _ConfigValue("SECRET_TOKEN")
551551
api_key = _ConfigValue("API_KEY")
552552
debug = _BoolConfigValue("DEBUG", default=False)
553-
server_url = _ConfigValue("SERVER_URL", default="http://localhost:8200", required=True)
553+
server_url = _ConfigValue("SERVER_URL", default="http://127.0.0.1:8200", required=True)
554554
server_cert = _ConfigValue("SERVER_CERT", validators=[FileIsReadableValidator()])
555555
verify_server_cert = _BoolConfigValue("VERIFY_SERVER_CERT", default=True)
556556
use_certifi = _BoolConfigValue("USE_CERTIFI", default=True)

tests/contrib/django/django_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ def test_settings_server_url_default():
12701270
with override_settings(ELASTIC_APM={}):
12711271
call_command("elasticapm", "check", stdout=stdout)
12721272
output = stdout.getvalue()
1273-
assert "SERVER_URL http://localhost:8200 looks fine" in output
1273+
assert "SERVER_URL http://127.0.0.1:8200 looks fine" in output
12741274

12751275

12761276
def test_settings_server_url_is_empty_string():

0 commit comments

Comments
 (0)