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

[Telemetry] Refactor telemetry with build report #93

Merged
merged 29 commits into from
Sep 18, 2024

Conversation

yoannmoinet
Copy link
Member

@yoannmoinet yoannmoinet commented Sep 4, 2024

Warning

To merge into #92

What and why?

Now that we have an universal build-report, we can refactor the telemetry module to also be universal for the most part.

How?

It's a large refactor of the telemetry module.
Removing most of the esbuild/webpack specificities.
Only remaining ones are about the tracing and reporting of plugins/loaders.

Most of the main processes have been streamlined

  • metrics aggregation
  • text report output
  • default configuration

A lot of tests added/redone:

  • Added a .toBeWithinRange helper for Jest.
  • Added the ./setupTests.ts file to inject the helpers and block any network request with nock.
  • More .each to reduce footprint of some tests.

It also introduces some configuration changes:

  • endPoint has moved in telemetry` configuration.
  • We also added enbaledTracing to run the tracing and reporting of plugins/loaders for webpack and esbuild. It is false by default, as it has a somewhat heavy impact on the builds.
  • telemetry.output has been simplified, we only write two files now.
  • The text output of the telemetry module will follow the logLevel configuration on the info channel.
const config = {
    plugins: [
        datadogEsbuildPlugin({
            auth: {
-             endPoint: 'app.datadoghq.com',
            },
            telemetry: {
+             endPoint: 'app.datadoghq.com',
+             enableTracing: false,
              output?: boolean
                  | string
                  | {
                      destination: string;
                      timings?: boolean;
-                     dependencies?: boolean;
-                     bundler?: boolean;
                      metrics?: boolean;
-                     logs?: boolean;
                  };
            },
        }),
    ]
};

Update of the text report:
image

Fixes #79

@yoannmoinet yoannmoinet force-pushed the yoann/refactor-telemetry-with-build-report branch from a42ddf3 to f86dd0f Compare September 5, 2024 12:20
@yoannmoinet yoannmoinet force-pushed the yoann/refactor-telemetry-with-build-report branch from 1c288ad to fe073b1 Compare September 9, 2024 13:23
@yoannmoinet yoannmoinet marked this pull request as ready for review September 9, 2024 14:17
@yoannmoinet yoannmoinet requested a review from a team as a code owner September 9, 2024 14:17
@yoannmoinet yoannmoinet requested review from sarenji and removed request for a team September 9, 2024 14:17
@elbywan elbywan self-requested a review September 9, 2024 15:15
Base automatically changed from yoann/build-report-internal-plugin to master September 18, 2024 14:59
@yoannmoinet yoannmoinet merged commit ff1b213 into master Sep 18, 2024
5 checks passed
@yoannmoinet yoannmoinet deleted the yoann/refactor-telemetry-with-build-report branch September 18, 2024 15:00
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.

Add a way to selectively disable collection of certain metrics (pre-filtering)
4 participants