Skip to content

feat(crashtracker): add Go crashtracker API#5026

Draft
kakkoyun wants to merge 16 commits into
mainfrom
feat/crashtracker-api
Draft

feat(crashtracker): add Go crashtracker API#5026
kakkoyun wants to merge 16 commits into
mainfrom
feat/crashtracker-api

Conversation

@kakkoyun

Copy link
Copy Markdown
Member

Summary

Adds a crashtracker package that captures Go application crashes and uploads structured reports to Datadog Error Tracking. The feature covers unhandled panics, runtime fatals (concurrent map writes, stack exhaustion), and signal-triggered crashes (SIGSEGV, SIGABRT).

How it works:

The package uses runtime/debug.SetCrashOutput (Go 1.23+) and the monitor-process pattern:

  1. Start() re-execs the current binary as a lightweight monitor child (identified by DD_CRASHTRACKING_IS_MONITOR_PROCESS=1).
  2. The monitor child is intercepted in the package init(), before any user init() functions run, so app-level side-effects (DB connections, gRPC dials) don't fire in the monitor.
  3. The app calls SetCrashOutput(pipeWriteEnd), wiring the runtime's crash dump to the monitor's stdin.
  4. On a crash, the Go runtime writes the dump to the pipe. The monitor reads it (bounded at 32 MiB), parses it into the errorsintake data model, and uploads a structured report to Datadog Error Tracking.
  5. On clean exit, the pipe closes with no data. The monitor detects EOF and exits cleanly.

Configuration:

  • DD_CRASHTRACKING_ENABLED: enables/disables crash reporting (default: true).
  • Standard DD_SITE, DD_API_KEY, DD_TRACE_AGENT_URL for routing.

Report format:

Structured errorsintake payload: error.type, error.message, error.stack (per-frame function/file/line), error.threads (flat goroutine list), os_info, sig_info for signal crashes, and ddtags with service/env/version/language:go.

Upload goes via the Agent EVP proxy (/evp_proxy/v2/api/v2/errors) or directly to the site-templated intake when DD_API_KEY is set. Two TODOs remain for the Error Tracking team to confirm the exact intake path.

Usage:

func main() {
    if err := crashtracker.Start(); err != nil {
        log.Printf("crashtracker.Start: %v", err)
    }
    defer crashtracker.Stop()
    // application code
}

Test plan

  • Unit tests: crash-dump parser (panic / fatal-error / SIGSEGV fixtures), buildDDTags output shape, idempotent Start(), upload against httptest.Server (agent path, agentless path, 5xx error)
  • All tests pass with -race -count=1
  • golangci-lint run ./crashtracker/... — 0 issues
  • go run ./scripts/configinverter/main.go check — in sync
  • Manual end-to-end against a real Datadog intake (pending Error Tracking team confirming the EVP proxy path)

kakkoyun added 4 commits July 13, 2026 15:59
Add the compilable skeleton for the new crashtracker package:
- Public API (Start/Stop/Option) stubs
- Report, StackTrace, Frame, Thread, OSInfo, SigInfo structs (errorsintake model)
- parse, upload, monitor stubs for parallel workstreams
- Register DD_CRASHTRACKING_ENABLED and DD_CRASHTRACKING_IS_MONITOR_PROCESS via configinverter
Add the crashtracker package, which captures Go application crashes via
runtime/debug.SetCrashOutput (Go 1.23+) and uploads structured reports
to Datadog Error Tracking.

Architecture:
- Start() re-execs the current binary as a monitor child process.
  In the app process, SetCrashOutput pipes the runtime's crash dump
  to the child's stdin. In the monitor process, Start() hijacks
  control: it reads the pipe, parses the dump, uploads the report,
  and calls os.Exit — never returning.
- GOMEMLIMIT and GOGC are filtered from the monitor child env to
  avoid inheriting the application's runtime tuning (see golang/go#73490).
- Crash output reads are bounded at 32 MiB to handle large goroutine dumps.
- Start() is idempotent via sync.Once; Stop() calls SetCrashOutput(nil).

Report format:
- Parses Go crash text into the errorsintake data model: error.type,
  error.message, structured error.stack (StackTrace with per-frame
  function/file/line), error.threads (flat []Thread, one per goroutine),
  os_info (architecture, os_type), and sig_info for signal crashes.
- ddtags carries service/env/version/language:go/go.version/library_version
  and git metadata from ReadBuildInfo.

Configuration:
- DD_CRASHTRACKING_ENABLED: gate, default true (opt-out).
- DD_CRASHTRACKING_IS_MONITOR_PROCESS: internal re-exec marker.
- Standard DD_SITE / DD_API_KEY / DD_TRACE_AGENT_URL for routing.

Upload:
- Agent path: EVP proxy /evp_proxy/v2/api/v2/errors (TODO: confirm
  exact subdomain with Error Tracking team).
- Agentless: site-templated https://errorsintake.agent.<site>/api/v2/errors.
- Add package init() to intercept monitor role before user init()s run,
  preventing app-level side-effects (DB, gRPC, signals) in the monitor
- Add cmd.Wait() goroutine to reap the monitor child and avoid fd/zombie leak
- Log upload failures to stderr so operators know when crash reporting fails
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jul 13, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 64.33%
Overall Coverage: 62.76% (+11.40%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b6efd81 | Docs | Datadog PR Page | Give us feedback!

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Config Audit

PACKAGE: contrib/cloud.google.com/go/pubsubtrace
  STATUS      CONFIG                                            CALL_SITES
  UNMIGRATED  DD_GOOGLE_CLOUD_PUBSUB_PROPAGATION_AS_SPAN_LINKS  1

PACKAGE: contrib/confluentinc/confluent-kafka-go/kafkatrace
  STATUS      CONFIG                            CALL_SITES
  UNMIGRATED  DD_TRACE_KAFKA_ANALYTICS_ENABLED  1

PACKAGE: crashtracker
  STATUS      CONFIG                    CALL_SITES
  STILL_READ  DD_API_KEY                1
  STILL_READ  DD_ENV                    1
  STILL_READ  DD_SITE                   1
  STILL_READ  DD_VERSION                1
  UNMIGRATED  DD_CRASHTRACKING_ENABLED  1

PACKAGE: ddtrace/opentelemetry/log
  STATUS      CONFIG                            CALL_SITES
  STILL_READ  DD_AGENT_HOST                     2
  STILL_READ  DD_ENV                            1
  STILL_READ  DD_SERVICE                        1
  STILL_READ  DD_TAGS                           1
  STILL_READ  DD_TRACE_AGENT_URL                2
  STILL_READ  DD_TRACE_REPORT_HOSTNAME          1
  STILL_READ  DD_VERSION                        1
  UNMIGRATED  DD_HOSTNAME                       1
  UNMIGRATED  OTEL_BLRP_EXPORT_TIMEOUT          1
  UNMIGRATED  OTEL_BLRP_MAX_EXPORT_BATCH_SIZE   1
  UNMIGRATED  OTEL_BLRP_MAX_QUEUE_SIZE          1
  UNMIGRATED  OTEL_BLRP_SCHEDULE_DELAY          1
  UNMIGRATED  OTEL_EXPORTER_OTLP_ENDPOINT       4
  UNMIGRATED  OTEL_EXPORTER_OTLP_HEADERS        2
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_ENDPOINT  4
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_HEADERS   2
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_PROTOCOL  2
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_TIMEOUT   1
  UNMIGRATED  OTEL_EXPORTER_OTLP_PROTOCOL       2
  UNMIGRATED  OTEL_EXPORTER_OTLP_TIMEOUT        1
  UNMIGRATED  OTEL_RESOURCE_ATTRIBUTES          1

PACKAGE: ddtrace/opentelemetry/metric
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_AGENT_HOST                                      2
  STILL_READ  DD_ENV                                             1
  STILL_READ  DD_METRICS_OTEL_ENABLED                            1
  STILL_READ  DD_SERVICE                                         1
  STILL_READ  DD_TAGS                                            1
  STILL_READ  DD_TRACE_AGENT_URL                                 2
  STILL_READ  DD_TRACE_REPORT_HOSTNAME                           1
  STILL_READ  DD_VERSION                                         1
  STILL_READ  OTEL_METRICS_EXPORTER                              1
  UNMIGRATED  DD_HOSTNAME                                        1
  UNMIGRATED  OTEL_EXPORTER_OTLP_ENDPOINT                        2
  UNMIGRATED  OTEL_EXPORTER_OTLP_HEADERS                         1
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_ENDPOINT                2
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_HEADERS                 1
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_PROTOCOL                2
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE  1
  UNMIGRATED  OTEL_EXPORTER_OTLP_PROTOCOL                        2
  UNMIGRATED  OTEL_EXPORTER_OTLP_TIMEOUT                         1
  UNMIGRATED  OTEL_RESOURCE_ATTRIBUTES                           1
  UNMIGRATED  OTEL_SERVICE_NAME                                  1

PACKAGE: ddtrace/tracer
  STATUS      CONFIG                                    CALL_SITES
  STILL_READ  DD_API_KEY                                1
  STILL_READ  DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT     1
  STILL_READ  DD_TRACE_PROPAGATION_EXTRACT_FIRST        1
  STILL_READ  DD_TRACE_PROPAGATION_STYLE_EXTRACT        1
  STILL_READ  DD_TRACE_PROPAGATION_STYLE_INJECT         1
  UNMIGRATED  DD_APM_TRACING_ENABLED                    1
  UNMIGRATED  DD_LLMOBS_AGENTLESS_ENABLED               1
  UNMIGRATED  DD_LLMOBS_ENABLED                         1
  UNMIGRATED  DD_LLMOBS_ML_APP                          1
  UNMIGRATED  DD_LLMOBS_PROJECT_NAME                    1
  UNMIGRATED  DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED  1
  UNMIGRATED  DD_TRACE_DEBUG_SEELOG_WORKAROUND          1
  UNMIGRATED  OTEL_TRACES_SAMPLER_ARG                   1

PACKAGE: instrumentation
  STATUS      CONFIG                                       CALL_SITES
  STILL_READ  DD_DATA_STREAMS_ENABLED                      1
  UNMIGRATED  DD_API_SECURITY_ENDPOINT_COLLECTION_ENABLED  1

PACKAGE: instrumentation/graphql
  STATUS      CONFIG                             CALL_SITES
  UNMIGRATED  DD_TRACE_GRAPHQL_ERROR_EXTENSIONS  1

PACKAGE: instrumentation/httptrace
  STATUS      CONFIG                                                 CALL_SITES
  UNMIGRATED  DD_GOOGLE_CLOUD_PUBSUB_PROPAGATION_AS_SPAN_LINKS       1
  UNMIGRATED  DD_TRACE_BAGGAGE_TAG_KEYS                              1
  UNMIGRATED  DD_TRACE_CLIENT_IP_ENABLED                             1
  UNMIGRATED  DD_TRACE_HTTP_SERVER_ERROR_STATUSES                    1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST               1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST_CLIENT        1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST_SERVER        1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_DISABLED                1
  UNMIGRATED  DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED               1
  UNMIGRATED  DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP               2
  UNMIGRATED  DD_TRACE_RESOURCE_RENAMING_ALWAYS_SIMPLIFIED_ENDPOINT  1
  UNMIGRATED  DD_TRACE_RESOURCE_RENAMING_ENABLED                     1

PACKAGE: instrumentation/internal/namingschema
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_SERVICE                                         1
  STILL_READ  DD_TRACE_SPAN_ATTRIBUTE_SCHEMA                     1
  UNMIGRATED  DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED  1

PACKAGE: internal
  STATUS      CONFIG                         CALL_SITES
  STILL_READ  DD_AGENT_HOST                  1
  STILL_READ  DD_TAGS                        1
  STILL_READ  DD_TRACE_AGENT_PORT            1
  STILL_READ  DD_TRACE_AGENT_URL             1
  UNMIGRATED  DD_EXTERNAL_ENV                1
  UNMIGRATED  DD_GIT_COMMIT_SHA              1
  UNMIGRATED  DD_GIT_REPOSITORY_URL          1
  UNMIGRATED  DD_TRACE_GIT_METADATA_ENABLED  1

PACKAGE: internal/appsec
  STATUS      CONFIG           CALL_SITES
  UNMIGRATED  DD_APPSEC_RULES  1

PACKAGE: internal/appsec/config
  STATUS      CONFIG                                                CALL_SITES
  UNMIGRATED  DD_API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE  1
  UNMIGRATED  DD_API_SECURITY_ENABLED                               1
  UNMIGRATED  DD_API_SECURITY_MAX_DOWNSTREAM_REQUEST_BODY_ANALYSIS  1
  UNMIGRATED  DD_API_SECURITY_PROXY_SAMPLE_RATE                     1
  UNMIGRATED  DD_API_SECURITY_REQUEST_SAMPLE_RATE                   1
  UNMIGRATED  DD_API_SECURITY_SAMPLE_DELAY                          1
  UNMIGRATED  DD_APM_TRACING_ENABLED                                1
  UNMIGRATED  DD_APPSEC_ENABLED                                     1
  UNMIGRATED  DD_APPSEC_RASP_ENABLED                                1
  UNMIGRATED  DD_APPSEC_RULES                                       1
  UNMIGRATED  DD_APPSEC_SCA_ENABLED                                 1
  UNMIGRATED  DD_APPSEC_TRACE_RATE_LIMIT                            1
  UNMIGRATED  DD_APPSEC_WAF_TIMEOUT                                 1

PACKAGE: internal/appsec/listener/httpsec
  STATUS      CONFIG                     CALL_SITES
  UNMIGRATED  DD_TRACE_CLIENT_IP_HEADER  1

PACKAGE: internal/bazel
  STATUS      CONFIG                                  CALL_SITES
  UNMIGRATED  DD_TEST_OPTIMIZATION_MANIFEST_FILE      1
  UNMIGRATED  DD_TEST_OPTIMIZATION_PAYLOADS_IN_FILES  1

PACKAGE: internal/civisibility/envconfig
  STATUS      CONFIG                   CALL_SITES
  STILL_READ  DD_CIVISIBILITY_ENABLED  1

PACKAGE: internal/civisibility/integrations
  STATUS      CONFIG                                               CALL_SITES
  STILL_READ  DD_SERVICE                                           1
  STILL_READ  DD_TRACE_DEBUG                                       1
  UNMIGRATED  DD_CIVISIBILITY_CODE_COVERAGE_REPORT_UPLOAD_ENABLED  1
  UNMIGRATED  DD_CIVISIBILITY_FLAKY_RETRY_COUNT                    1
  UNMIGRATED  DD_CIVISIBILITY_FLAKY_RETRY_ENABLED                  1
  UNMIGRATED  DD_CIVISIBILITY_GIT_UPLOAD_ENABLED                   1
  UNMIGRATED  DD_CIVISIBILITY_IMPACTED_TESTS_DETECTION_ENABLED     1
  UNMIGRATED  DD_CIVISIBILITY_SUBTEST_FEATURES_ENABLED             1
  UNMIGRATED  DD_CIVISIBILITY_TOTAL_FLAKY_RETRY_COUNT              1
  UNMIGRATED  DD_TEST_MANAGEMENT_ATTEMPT_TO_FIX_RETRIES            1
  UNMIGRATED  DD_TEST_MANAGEMENT_ENABLED                           1

PACKAGE: internal/civisibility/integrations/gotesting
  STATUS      CONFIG                                                           CALL_SITES
  UNMIGRATED  DD_CIVISIBILITY_INTERNAL_PARALLEL_EARLY_FLAKE_DETECTION_ENABLED  1
  UNMIGRATED  DD_TEST_MANAGEMENT_ENABLED                                       1

PACKAGE: internal/civisibility/integrations/logs
  STATUS      CONFIG                        CALL_SITES
  UNMIGRATED  DD_CIVISIBILITY_LOGS_ENABLED  1

PACKAGE: internal/civisibility/utils
  STATUS      CONFIG                              CALL_SITES
  STILL_READ  DD_SERVICE                          1
  UNMIGRATED  DD_ACTION_EXECUTION_ID              1
  UNMIGRATED  DD_PIPELINE_EXECUTION_ID            1
  UNMIGRATED  DD_TEST_OPTIMIZATION_ENV_DATA_FILE  1
  UNMIGRATED  DD_TEST_SESSION_NAME                1

PACKAGE: internal/civisibility/utils/net
  STATUS      CONFIG                             CALL_SITES
  STILL_READ  DD_API_KEY                         1
  STILL_READ  DD_CIVISIBILITY_AGENTLESS_ENABLED  1
  STILL_READ  DD_CIVISIBILITY_AGENTLESS_URL      1
  STILL_READ  DD_ENV                             1
  STILL_READ  DD_SERVICE                         1
  STILL_READ  DD_SITE                            1
  STILL_READ  DD_TAGS                            1
  STILL_READ  DD_VERSION                         1

PACKAGE: internal/civisibility/utils/telemetry
  STATUS      CONFIG                                         CALL_SITES
  UNMIGRATED  DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER  1

PACKAGE: internal/globalconfig
  STATUS      CONFIG                           CALL_SITES
  UNMIGRATED  DD_INSTRUMENTATION_INSTALL_ID    1
  UNMIGRATED  DD_INSTRUMENTATION_INSTALL_TIME  1
  UNMIGRATED  DD_INSTRUMENTATION_INSTALL_TYPE  1

PACKAGE: internal/hostname
  STATUS      CONFIG       CALL_SITES
  UNMIGRATED  DD_HOSTNAME  1

PACKAGE: internal/namingschema
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_SERVICE                                         1
  STILL_READ  DD_TRACE_SPAN_ATTRIBUTE_SCHEMA                     1
  UNMIGRATED  DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED  1

PACKAGE: internal/processtags
  STATUS      CONFIG                                          CALL_SITES
  UNMIGRATED  DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED  1

PACKAGE: internal/remoteconfig
  STATUS      CONFIG                                  CALL_SITES
  STILL_READ  DD_ENV                                  1
  UNMIGRATED  DD_RC_TUF_ROOT                          1
  UNMIGRATED  DD_REMOTE_CONFIGURATION_ENABLED         1
  UNMIGRATED  DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS  1

PACKAGE: internal/stacktrace
  STATUS      CONFIG                           CALL_SITES
  UNMIGRATED  DD_APPSEC_MAX_STACK_TRACE_DEPTH  1
  UNMIGRATED  DD_APPSEC_STACK_TRACE_ENABLED    1

PACKAGE: internal/telemetry
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_API_KEY                                         1
  STILL_READ  DD_SITE                                            1
  UNMIGRATED  DD_API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT  1
  UNMIGRATED  DD_INSTRUMENTATION_TELEMETRY_ENABLED               1
  UNMIGRATED  DD_TELEMETRY_DEBUG                                 1
  UNMIGRATED  DD_TELEMETRY_DEPENDENCY_COLLECTION_ENABLED         1
  UNMIGRATED  DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL           1
  UNMIGRATED  DD_TELEMETRY_HEARTBEAT_INTERVAL                    1
  UNMIGRATED  DD_TELEMETRY_LOG_COLLECTION_ENABLED                1
  UNMIGRATED  DD_TELEMETRY_METRICS_ENABLED                       1

PACKAGE: openfeature
  STATUS      CONFIG                                                     CALL_SITES
  STILL_READ  DD_ENV                                                     2
  STILL_READ  DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED                  1
  STILL_READ  DD_SERVICE                                                 2
  STILL_READ  DD_VERSION                                                 2
  UNMIGRATED  DD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED  1
  UNMIGRATED  DD_FLAGGING_EVALUATION_COUNTS_ENABLED                      1

PACKAGE: profiler
  STATUS      CONFIG                                    CALL_SITES
  STILL_READ  DD_API_KEY                                1
  STILL_READ  DD_ENV                                    1
  STILL_READ  DD_SERVICE                                1
  STILL_READ  DD_SITE                                   1
  STILL_READ  DD_TAGS                                   1
  STILL_READ  DD_TRACE_STARTUP_LOGS                     1
  STILL_READ  DD_VERSION                                1
  UNMIGRATED  DD_PROFILING_AGENTLESS                    1
  UNMIGRATED  DD_PROFILING_DEBUG_COMPRESSION_SETTINGS   1
  UNMIGRATED  DD_PROFILING_DELTA                        1
  UNMIGRATED  DD_PROFILING_ENABLED                      3
  UNMIGRATED  DD_PROFILING_ENDPOINT_COUNT_ENABLED       1
  UNMIGRATED  DD_PROFILING_EXECUTION_TRACE_ENABLED      1
  UNMIGRATED  DD_PROFILING_EXECUTION_TRACE_LIMIT_BYTES  1
  UNMIGRATED  DD_PROFILING_EXECUTION_TRACE_PERIOD       1
  UNMIGRATED  DD_PROFILING_FLUSH_ON_EXIT                1
  UNMIGRATED  DD_PROFILING_OUTPUT_DIR                   1
  UNMIGRATED  DD_PROFILING_UPLOAD_TIMEOUT               1
  UNMIGRATED  DD_PROFILING_URL                          1

Comment thread crashtracker/parse.go Fixed
…igurations

DD_CRASHTRACKING_IS_MONITOR_PROCESS is an internal re-exec marker read
directly via os.Getenv, not via env.Get. It is not a user-facing config
and does not belong in supported_configurations.json.

DD_CRASHTRACKING_ENABLED remains and requires registration in the
internal configuration registry by a Datadog maintainer.
@kakkoyun

Copy link
Copy Markdown
Member Author

@codex review

kakkoyun added 2 commits July 13, 2026 17:02
… 32-bit

Passing bitSize 64 to strconv.ParseInt and then casting to int is unsafe
on 32-bit platforms where int is 32 bits. bitSize 0 bounds the result to
the native int width, making the int() conversion always safe.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6987c29b3e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crashtracker/crashtracker.go
Comment thread crashtracker/parse.go
Comment thread crashtracker/upload.go
Comment thread crashtracker/parse.go Outdated
Comment thread crashtracker/crashtracker.go Outdated
Comment thread crashtracker/parse.go
Comment thread crashtracker/doc.go
Comment thread crashtracker/crashtracker.go
Comment thread crashtracker/monitor.go
Comment thread crashtracker/parse.go
- Set DDTags on every crash report (was always empty)
- Add UDS-aware client for unix:// agent URLs
- Fix goroutineHeaderRe to parse GOTRACEBACK=system headers
- Fix funcName to handle pointer-receiver methods (main.(*T).M)
- Drain crash pipe after 32 MiB cap so crashing process is not blocked
- Preserve first Start error; return it on subsequent idempotent calls
- Add SIGTRAP (5) to signal number table
- Document: monitor options are env-var only, GOTRACEBACK=all for full
  goroutine list, init order nuance
@pr-commenter

pr-commenter Bot commented Jul 13, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-15 13:25:03

Comparing candidate commit b6efd81 in PR branch feat/crashtracker-api with baseline commit 9ffdd0f in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 326 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

kakkoyun added 4 commits July 13, 2026 19:47
… 'A'

.NET already registered this key at version A in the Feature Parity
Dashboard. Using implementation C caused a mismatch; changing to A makes
validate_supported_configurations_v2_local_file pass.
…ing them

As an observability product, we should surface failures in Stop() rather
than silently dropping them. SetCrashOutput and pipe close errors are
now logged at WARN level via internal/log.
Baseline: ~7µs/parse, ~50 allocs/op on M4 Max across the three dump
types (panic, concurrent-map-write, SIGSEGV). SetBytes enables MB/s
throughput tracking for future comparisons.
- parse.go: check sc.Err() after splitDump scan loop; scanner truncation
  now returns an Incomplete report instead of silently partial data
- parse.go: preallocate lines slice with len(dump)/80 capacity hint
- monitor.go: log cmd.Wait() errors; monitor panics are now visible
- monitor.go: extract buildChildEnv() helper; spawnMonitor drops from 63
  to 45 lines, under the 60-line TigerStyle limit
- parse_bench_test.go: add tb.Helper() to loadFixture
Comment thread crashtracker/crashtracker.go Outdated
Comment thread crashtracker/crashtracker.go Outdated
Comment thread crashtracker/monitor.go Outdated
kakkoyun added 2 commits July 14, 2026 13:39
…eguard

The codebase uses err.Error() not bare err with %v in log calls.
Matches the pattern in profiler/ and ddtrace/tracer/.
…eline

TestE2ECrashReport_Panic: spawns a crash-victim subprocess that panics
with crashtracker.Start() active; waits for the monitor grandchild to
POST an errorsintake report to a mock server; asserts ddsource, error.type,
error.is_crash, error.stack.frames, error.threads, one crashed goroutine,
os_info.architecture, and ddtags language:go.

TestE2ECrashReport_CleanExit: verifies clean exit produces no report.

Uses the TestMain subprocess-role pattern: the test binary re-execs itself
with _CRASHTRACKER_E2E set; crashtracker.init() intercepts the monitor
grandchild role before TestMain runs.
@kakkoyun kakkoyun requested a review from hannahkm July 14, 2026 12:14

@hannahkm hannahkm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a really quick skim-through of the code! Thanks for making the first implementation. Two small nits, and also we should update the READMEs and AGENT files

Comment thread crashtracker/monitor.go
Comment thread crashtracker/monitor.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants