Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A set of universal bundler plugins to interact with Datadog directly from your builds.

License

NotificationsYou must be signed in to change notification settings

DataDog/build-plugins

 
 

Repository files navigation

A set of bundler plugins for:

To interact with Datadog directly from your builds.

Note

If you want to upgrade from v1 to v2, please follow ourmigration guide.

Table of content

Installation

  • Yarn
yarn add -D @datadog/{{bundler}}-plugin
  • npm
npm install --save-dev @datadog/{{bundler}}-plugin

Usage

In your bundler's configuration file:

const{datadog{{Bundler}}Plugin}=require('@datadog/{{bundler}}-plugin');exportconstconfig={plugins:[datadog{{Bundler}}Plugin({// Configuration}),],};

Tip

It is best to have the plugin in the first position in order to report every other plugins.

Follow the specific documentation for each bundler:

Configuration

Full configuration object
{auth?:{apiKey?:string;};    customPlugins?:(options:Options,context:GlobalContext,log:Logger)=>UnpluginPlugin[];    logLevel?:'debug'|'info'|'warn'|'error'|'none';    errorTracking?:{disabled?:boolean;        sourcemaps?:{bailOnError?:boolean;            disableGit?:boolean;            dryRun?:boolean;            intakeUrl?:string;            maxConcurrency?:number;            minifiedPathPrefix:string;            releaseVersion:string;            service:string;};};    synthetics?:{disabled?:boolean;};    telemetry?:{disabled?:boolean;        enableTracing?:boolean;        endPoint?:string;        output?:boolean|string|{destination:string;                timings?:boolean;                metrics?:boolean;};        prefix?:string;        tags?:string[];        timestamp?:number;        filters?:((metric:Metric)=>Metric|null)[];};}

auth.apiKey

defaultnull

In order to interact with Datadog, you have to useyour own API Key.

auth.appKey

defaultnull

In order to interact with Datadog, you have to useyour own Application Key.

disableGit

default:false

Disable theGit plugin if you don't want to use it.
For instance if you see aError: No git remotes available error.

logLevel

default:'warn'

Which level of log do you want to show.

customPlugins

default:[]

This is a way for you to inject anyUnplugin Plugin you want.

It's particularly useful to use ourglobal, shared context of the main plugin.

And to prototype some new plugins in the same environment.

{    customPlugins:(options,context)=>{constname='my-custom-plugin';constlog=context.getLogger(name);return[{            name,buildStart(){log.info('Hello world');},}]};}

Your function will receive three arguments:

  • options: The options you passed to the main plugin (including your custom plugins).
  • context: The global context shared accross our plugin.

Thecontext is a shared object that is mutated during the build process.

Full context object
type GlobalContext = {    // Mirror of the user's config.    auth?: {        apiKey?: string;    };    // More details on the currently running bundler.    bundler:BundlerReport    // Added in `writeBundle`.    build:BuildReport    cwd: string;    getLogger: (name: string) =>Logger    // Added in `buildStart`.    git?:Git    inject:Injection    start: number;    version: string;}

Features

Error TrackingESBuildRollupRspackViteWebpack

Interact with Error Tracking directly from your build system.

Configuration
datadogWebpackPlugin({errorTracking?:{disabled?:boolean,sourcemaps?:{bailOnError?:boolean,disableGit?:boolean,dryRun?:boolean,intakeUrl?:string,maxConcurrency?:number,minifiedPathPrefix:string,releaseVersion:string,service:string,},}});

SyntheticsESBuildRollupRspackViteWebpack

Interact with Synthetics at build time.

Configuration
datadogWebpackPlugin({synthetics?:{disabled?:boolean,}});

TelemetryESBuildRollupRspackViteWebpack

Display and send telemetry data as metrics to Datadog.

Configuration
datadogWebpackPlugin({telemetry?:{disabled?:boolean,enableTracing?:boolean,endPoint?:string,output?:boolean|string|{destination:string,timings?:boolean,metrics?:boolean,},prefix?:string,tags?:string[],timestamp?:number,filters?:((metric:Metric)=>Metric|null)[],}});

Contributing

Check outCONTRIBUTING.md for more information about how to work with the build-plugins ecosystem.

License

MIT

About

A set of universal bundler plugins to interact with Datadog directly from your builds.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors11


[8]ページ先頭

©2009-2025 Movatter.jp