Skip to content
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

[PROF-7440] Report status of timeline feature as internal metadata #3040

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Aug 10, 2023

What does this PR do?:

This PR adds support for reporting the status of the timeline feature together with profiles, via the internal metadata field.

I ended up doing a bunch of refactoring to make it easier to adds new reported fields as internal metadata; it may be easier to review this PR commit-by-commit.

Motivation:

While this feature is off-by-default, having this internal metadata makes it easier to spot profiles that have/don't have this data without actually opening them up in the UX.

Additional Notes:

N/A

How to test the change?:

This change includes test coverage. It's possible internally at Datadog to see this information in profile listings (ping me if you'd like to know more).

…s in it

During review of #2927, @marcotc did point out that getting the
internal metadata information from the `Datadog::Profiling::Component`
to the `Flush` object was quite a lot of changes.

As I'm preparing to add a second entry to `internal_metadata`, I'm
refactoring this code to try to change it so that fewer components
need to be touched when we want to add more stuff.
This is a refactor in preparation for adding more internal metadata
entries, but hopefully do so in a way that avoids needing to touch
a lot of internal classes each time.
This is one more step in a refactor in preparation for adding more
internal metadata. By having the `Exporter` receive the
`internal_metadata` as a opaque hash it cares nothing about, we can
easily add more entries directly in the `Profiling::Component` without
needing to touch a lot of classes.
This is the last step of the refactor in preparation for adding more
internal metadata.

By having the `build_profiler_exporter` receive the `internal_metadata`
hash directly, we now only need to modify the creation of the
`internal_metadata` hash to be able to propagate more information.
@ivoanjo ivoanjo requested a review from a team August 10, 2023 09:05
@github-actions github-actions bot added the profiling Involves Datadog profiling label Aug 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2023

Codecov Report

Merging #3040 (c4a52f0) into master (75cb379) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3040   +/-   ##
=======================================
  Coverage   98.12%   98.12%           
=======================================
  Files        1322     1322           
  Lines       74648    74654    +6     
  Branches     3403     3403           
=======================================
+ Hits        73247    73257   +10     
+ Misses       1401     1397    -4     
Files Changed Coverage Δ
spec/datadog/profiling/http_transport_spec.rb 99.60% <ø> (ø)
spec/datadog/profiling/integration_spec.rb 97.26% <ø> (ø)
lib/datadog/profiling/component.rb 97.84% <100.00%> (+0.09%) ⬆️
lib/datadog/profiling/exporter.rb 100.00% <100.00%> (ø)
lib/datadog/profiling/flush.rb 100.00% <100.00%> (ø)
spec/datadog/profiling/component_spec.rb 99.67% <100.00%> (+<0.01%) ⬆️
spec/datadog/profiling/exporter_spec.rb 100.00% <100.00%> (ø)
spec/datadog/profiling/flush_spec.rb 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

**What does this PR do?**:

This PR adds support for reporting the status of the timeline feature
together with profiles, via the internal metadata field.

I ended up doing a bunch of refactoring to make it easier to adds new
reported fields as internal metadata; it may be easier to review this
PR commit-by-commit.

**Motivation**:

While this feature is off-by-default, having this internal metadata
makes it easier to spot profiles that have/don't have this data
without actually opening them up in the UX.

**Additional Notes**:

N/A

**How to test the change?**:

This change includes test coverage. It's possible internally at
Datadog to see this information in profile listings (ping me if you'd
like to know more).
@ivoanjo ivoanjo force-pushed the ivoanjo/expose-timeline-enabled branch from bd6b14f to c4a52f0 Compare August 10, 2023 10:38
@ivoanjo
Copy link
Member Author

ivoanjo commented Aug 15, 2023

Thanks Tony for the review 🙇

@ivoanjo ivoanjo merged commit cfc825a into master Aug 15, 2023
162 checks passed
@ivoanjo ivoanjo deleted the ivoanjo/expose-timeline-enabled branch August 15, 2023 09:47
@github-actions github-actions bot added this to the 1.14.0 milestone Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
profiling Involves Datadog profiling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants