Skip to content

Commit 440ebc6

Browse files
dd-octo-sts[bot]BaptisteFoybrettlangdon
authored
fix: use default trace agent url for tracer flare [backport 3.12] (#14407)
Backport 2a4773c from #14395 to 3.12. ## Description This PR fixes the tracer flare when `DD_TRACE_AGENT_URL` is not set. `ddtrace.config._trace_agent_url` is `None` when not set, which leads to `Failed to send tracer flare to Zendesk ticket XXXXXXXXX: Unsupported protocol 'b''' in intake URL 'None'. Must be one of: http, https, unix` when sending a flare. This PR makes sure to use the default. ## Motivation Making tracer flares for Python work again ## Testing strategy - Create a VM - Install the agent - Install the tracer with SSI - Create a sample Flask app - Start it with `DD_TRACE_DEBUG=true` - Go to the Datadog UI & trigger a flare for your host (no need to force debug logs) - After a few minutes a Zendesk ticket should be created and contain your tracer flare - You should see a log starting with `Successfully sent the flare to Zendesk ticket`  ## 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) Co-authored-by: Baptiste Foy <[email protected]> Co-authored-by: Brett Langdon <[email protected]>
1 parent 9be6b31 commit 440ebc6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ddtrace/internal/remoteconfig/products/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from ddtrace import config
22
from ddtrace.internal.remoteconfig.client import config as rc_config
3+
from ddtrace.settings._agent import config as agent_config
34

45

56
# TODO: Modularize better into their own respective components
@@ -10,7 +11,7 @@ def _register_rc_products() -> None:
1011
from ddtrace.internal.flare.handler import _tracerFlarePubSub
1112
from ddtrace.internal.remoteconfig.worker import remoteconfig_poller
1213

13-
flare = Flare(trace_agent_url=config._trace_agent_url, api_key=config._dd_api_key, ddconfig=config.__dict__)
14+
flare = Flare(trace_agent_url=agent_config.trace_agent_url, api_key=config._dd_api_key, ddconfig=config.__dict__)
1415
tracerflare_pubsub = _tracerFlarePubSub()(_handle_tracer_flare, flare)
1516
remoteconfig_poller.register("AGENT_CONFIG", tracerflare_pubsub)
1617
remoteconfig_poller.register("AGENT_TASK", tracerflare_pubsub)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fixes:
2+
- |
3+
internal: This fix resolves an issue where the tracer flare was not sent when ``DD_TRACE_AGENT_URL`` was not set,
4+
as the default URL was not used.

0 commit comments

Comments
 (0)