Skip to content

chore(profiling): reduce log spam in native code #13228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sanchda
Copy link
Contributor

@sanchda sanchda commented Apr 17, 2025

This PR

  1. standardizes all native output to cerr
  2. updates some language to be in-line with the actual code
  3. within each function, puts a function-wide block so that logs can only be emitted one time

The inspiration from this is recent escalations and incidents where user code hits a library error at an unprecedented rate; the native code has no limiting/bucketing mechanism at the current time, so this is a desperate first attempt at preventing end-user logs from blowing up.

Checklist

  • 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
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • 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 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

Copy link
Contributor

CODEOWNERS have been resolved as:

ddtrace/internal/datadog/profiling/dd_wrapper/include/libdatadog_helpers.hpp  @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/crashtracker.cpp      @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/ddup_interface.cpp    @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/profile.cpp           @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/sample.cpp            @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/synchronized_sample_pool.cpp  @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/src/uploader.cpp          @DataDog/profiling-python

@sanchda sanchda added the changelog/no-changelog A changelog entry is not required for this PR. label Apr 17, 2025
Copy link
Contributor

github-actions bot commented Apr 17, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 234 ± 4 ms.

The average import time from base is: 234 ± 3 ms.

The import time difference between this PR and base is: -0.3 ± 0.2 ms.

The difference is not statistically significant (z = -1.79).

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.843 ms (0.79%)
ddtrace.bootstrap.sitecustomize 1.177 ms (0.50%)
ddtrace.bootstrap.preload 1.177 ms (0.50%)
ddtrace.internal.products 1.177 ms (0.50%)
ddtrace.internal.remoteconfig.client 0.578 ms (0.25%)
ddtrace 0.666 ms (0.28%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant