Skip to content

Commit 494c4d5

Browse files
authored
docs: instrumentation telemetry usage [LANGPLAT-352] (#13647)
This change adds minimal documentation explaining how contributors should use Instrumentation Telemetry. ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent 5592908 commit 494c4d5

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

docs/contributing.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,23 @@ Keep the following in mind when writing logging code:
106106
* Log messages should be standalone and actionable. They should not require context from other logs, metrics or trace data.
107107
* Log data is sensitive and should not contain application secrets or other sensitive data.
108108

109+
Instrumentation Telemetry
110+
-------------------------
111+
112+
When you implement a new feature in ddtrace, you should usually have the library emit some Instrumentation
113+
Telemetry about the feature. Instrumentation Telemetry provides data about the operation of the library in
114+
real production environments and is often used to understand rates of product adoption.
115+
116+
Instrumentation Telemetry conforms to an internal Datadog API. You can find the API specification in the
117+
private Confluence space. To send Instrumentation Telemetry data to this API from ddtrace, you can use
118+
the ``ddtrace.internal.telemetry.telemetry_writer`` object that provides a Python interface to the API.
119+
120+
The most common ``telemetry_writer`` call you may use is ``add_count_metric``. This call generates timeseries
121+
metrics that you can use to, for example, count the number of times a given feature is used. Another useful
122+
call is ``add_integration``, which generates telemetry data about the integration with a particular module.
123+
124+
Read the docstrings in ``ddtrace/internal/telemetry/writer.py`` for more comprehensive usage information
125+
about Instrumentation Telemetry.
109126

110127
.. toctree::
111128
:hidden:

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ contacting support.
250250
Instrumentation Telemetry
251251
-------------------------
252252

253-
Datadog may gather environmental and diagnostic information about instrumentation libraries; this includes information
253+
dd-trace-py gathers environmental and diagnostic information at runtime. This includes information
254254
about the host running an application, operating system, programming language and runtime, APM integrations used,
255-
and application dependencies. Additionally, Datadog may collect information such as diagnostic logs, crash dumps
255+
and application dependencies. It also gathers information such as diagnostic logs, crash dumps
256256
with obfuscated stack traces, and various system performance metrics.
257257

258-
To disable set ``DD_INSTRUMENTATION_TELEMETRY_ENABLED=false`` environment variable.
258+
To disable this collection, set ``DD_INSTRUMENTATION_TELEMETRY_ENABLED=false`` environment variable.
259259

260260
See our official `datadog documentation <https://docs.datadoghq.com/tracing/configure_data_security#telemetry-collection>`_ for more details.
261261

docs/spelling_wordlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ DES
8585
deserializing
8686
django
8787
docstring
88+
docstrings
8889
doctest
8990
dogpile
9091
dogpile.cache
@@ -294,6 +295,7 @@ TensorBoard
294295
testagent
295296
TestCase
296297
testrunner
298+
timeseries
297299
Timeseries
298300
timestamp
299301
tokenizer

0 commit comments

Comments
 (0)