Skip to content

Commit 3fe8f9d

Browse files
chore(docs): consolidate environment variable configuration (#1320)
* docs: consolidate environment variable configuration * Update docs/configuration.rst Co-Authored-By: Kyle Verhoog <[email protected]> * remove env vars from usage Co-authored-by: Kyle Verhoog <[email protected]>
1 parent 39f42f7 commit 3fe8f9d

File tree

3 files changed

+61
-45
lines changed

3 files changed

+61
-45
lines changed

ddtrace/commands/ddtrace_run.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,10 @@
1717

1818
USAGE = """
1919
Execute the given Python program after configuring it to emit Datadog traces.
20-
Append command line arguments to your program as usual.
21-
22-
Usage: [ENV_VARS] ddtrace-run <my_program>
2320
24-
Available environment variables:
21+
Append command line arguments to your program as usual.
2522
26-
DATADOG_ENV : override an application's environment (no default)
27-
DATADOG_TRACE_ENABLED=true|false : override the value of tracer.enabled (default: true)
28-
DATADOG_TRACE_DEBUG=true|false : enabled debug logging (default: false)
29-
DATADOG_PATCH_MODULES=module:patch,module:patch... e.g. boto:true,redis:false : override the modules patched for this execution of the program (default: none)
30-
DATADOG_TRACE_AGENT_HOSTNAME=localhost: override the address of the trace agent host that the default tracer will attempt to submit to (default: localhost)
31-
DATADOG_TRACE_AGENT_PORT=8126: override the port that the default tracer will submit to (default: 8126)
32-
DD_SERVICE: the service name to be used for this program (default only for select web frameworks)
33-
DATADOG_PRIORITY_SAMPLING=true|false: enables Priority Sampling. (default: false)
34-
DD_LOGS_INJECTION=true|false: enable injecting trace information into log records to correlate. (default: false)
23+
Usage: ddtrace-run <my_program>
3524
""" # noqa: E501
3625

3726

docs/advanced_usage.rst

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -552,35 +552,11 @@ and database modules without the need for changing your code::
552552

553553
Append command line arguments to your program as usual.
554554

555-
Usage: [ENV_VARS] ddtrace-run <my_program>
556-
557-
558-
The available environment variables for ``ddtrace-run`` are:
559-
560-
* ``DATADOG_TRACE_ENABLED=true|false`` (default: true): Enable web framework and
561-
library instrumentation. When false, your application code will not generate
562-
any traces.
563-
* ``DATADOG_ENV`` (no default): Set an application's environment e.g. ``prod``,
564-
``pre-prod``, ``stage``
565-
* ``DD_ENV`` (no default): Set an application's environment e.g. ``prod``,
566-
``pre-prod``, ``stage`` (preferred over ``DATADOG_ENV``)
567-
* ``DD_VERSION`` (no default): Set an application's version e.g. ``1.2.3``, ``6c44da20``, ``2020.02.13``
568-
* ``DATADOG_TRACE_DEBUG=true|false`` (default: false): Enable debug logging in
569-
the tracer
570-
* ``DD_SERVICE`` (no default): override the service name to be used for this
571-
application. A default is provided for the bottle, flask, grpc, pyramid,
572-
pylons, tornado, celery, django and falcon integrations.
573-
* ``DATADOG_PATCH_MODULES=module:patch,module:patch...`` e.g.
574-
``boto:true,redis:false``: override the modules patched for this execution of
575-
the program (default: none)
576-
* ``DATADOG_TRACE_AGENT_HOSTNAME=localhost``: override the address of the trace
577-
agent host that the default tracer will attempt to submit to (default:
578-
``localhost``)
579-
* ``DATADOG_TRACE_AGENT_PORT=8126``: override the port that the default tracer
580-
will submit to (default: 8126)
581-
* ``DATADOG_PRIORITY_SAMPLING`` (default: true): enables :ref:`Priority
582-
Sampling`
583-
* ``DD_LOGS_INJECTION`` (default: false): enables :ref:`Logs Injection`
555+
Usage: ddtrace-run <my_program>
556+
557+
558+
The environment variables for ``ddtrace-run`` used to configure the tracer are
559+
detailed in :ref:`Configuration`.
584560

585561
``ddtrace-run`` respects a variety of common entrypoints for web applications:
586562

docs/configuration.rst

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,67 @@ below:
1515
- Type
1616
- Default value
1717
- Description
18-
* - ``DD_SERVICE_NAME`` or ``DATADOG_SERVICE_NAME``
18+
* - ``DD_ENV``
19+
- String
20+
-
21+
- Set an application's environment e.g. ``prod``, ``pre-prod``, ``stage``.
22+
* - ``DATADOG_ENV``
23+
- String
24+
-
25+
- Deprecated: use ``DD_ENV``
26+
* - ``DD_SERVICE``
1927
- String
2028
- (autodetected)
21-
- The service name to use.
29+
- Set the service name to be used for this application. A default is
30+
provided for these integrations: :ref:`bottle`, :ref:`flask`, :ref:`grpc`,
31+
:ref:`pyramid`, :ref:`pylons`, :ref:`tornado`, :ref:`celery`, :ref:`django` and
32+
:ref:`falcon`.
33+
* - ``DD_SERVICE_NAME`` or ``DATADOG_SERVICE_NAME``
34+
- String
35+
-
36+
- Deprecated: use ``DD_SERVICE``.
37+
* - ``DD_VERSION``
38+
- String
39+
-
40+
- Set an application's version in traces and logs e.g. ``1.2.3``,
41+
``6c44da20``, ``2020.02.13``.
42+
* - ``DATADOG_TRACE_ENABLED``
43+
- Boolean
44+
- True
45+
- Enable web framework and library instrumentation. When false, your
46+
application code will not generate any traces.
47+
* - ``DATADOG_TRACE_DEBUG``
48+
- Boolean
49+
- False
50+
- Enable debug logging in the tracer
51+
* - ``DATADOG_PATCH_MODULES``
52+
- String
53+
-
54+
- Override the modules patched for this execution of the program. Must be
55+
a list in the ``module1:boolean,module2:boolean`` format. For example,
56+
``boto:true,redis:false``.
57+
* - ``DATADOG_PRIORITY_SAMPLING``
58+
- Boolean
59+
- True
60+
- Enables :ref:`Priority Sampling`.
61+
* - ``DD_LOGS_INJECTION``
62+
- Boolean
63+
- True
64+
- Enables :ref:`Logs Injection`.
2265
* - ``DD_TRACE_AGENT_URL``
2366
- URL
2467
- ``http://localhost:8126``
2568
- The URL to use to connect the Datadog agent. The url can starts with
2669
``http://`` to connect using HTTP or with ``unix://`` to use a Unix
2770
Domain Socket.
71+
* - ``DATADOG_TRACE_AGENT_HOSTNAME``
72+
- String
73+
-
74+
- Deprecated: use ``DD_TRACE_AGENT_URL``
75+
* - ``DATADOG_TRACE_AGENT_PORT``
76+
- Integer
77+
-
78+
- Deprecated: use ``DD_TRACE_AGENT_URL``
2879
* - ``DD_PROFILING_API_TIMEOUT``
2980
- Float
3081
- 10
@@ -68,5 +119,5 @@ below:
68119
* - ``DD_PROFILING_TAGS``
69120
- String
70121
-
71-
- The tags to apply to uploaded profile. Must be a list of in the
122+
- The tags to apply to uploaded profile. Must be a list in the
72123
``key1:value,key2:value2`` format.

0 commit comments

Comments
 (0)