refactor(profiling): make profiling exporter fields private#9043
Conversation
The EventSerializer, AgentExporter, and FileExporter state is read only inside each class, so promote it to #private and let the runtime enforce the boundary instead of the underscore convention. AgentExporter._url stays a plain underscore property: the profiling config spec asserts the resolved intake URL through config.exporters[0]._url, so the field is part of a reachable surface rather than purely internal.
Overall package sizeSelf size: 6.31 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
|
BenchmarksBenchmark execution time: 2026-06-23 20:00:18 Comparing candidate commit 89c7073 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1953 metrics, 12 unstable metrics.
|
The EventSerializer, AgentExporter, and FileExporter state is read only inside each class, so promote it to #private and let the runtime enforce the boundary instead of the underscore convention. AgentExporter._url stays a plain underscore property: the profiling config spec asserts the resolved intake URL through config.exporters[0]._url, so the field is part of a reachable surface rather than purely internal.
The EventSerializer, AgentExporter, and FileExporter state is read only inside each class, so promote it to #private and let the runtime enforce the boundary instead of the underscore convention. AgentExporter._url stays a plain underscore property: the profiling config spec asserts the resolved intake URL through config.exporters[0]._url, so the field is part of a reachable surface rather than purely internal.
Summary
The
EventSerializer,AgentExporter, andFileExporterstate is read only inside each class, yet stayed underscore-prefixed. Promote it to#privateso the runtime enforces the boundary instead of the convention.AgentExporter._urlstays a plain underscore property: the profiling config spec asserts the resolved intake URL throughconfig.exporters[0]._url, so it is part of a reachable surface rather than purely internal.Test plan
packages/dd-trace/test/profiling/**/*.spec.js