# Package @google-cloud/trace-agent (8.0.0)

8.0.0 (latest) 7.1.2 7.0.0 5.1.6

## Interfaces

### [Config](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/config)

Available configuration options. All fields are optional. See the defaultConfig object defined in this file for default assigned values.

### [PluginTypes.Intercept](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.intercept)

### [PluginTypes.Monkeypatch](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.monkeypatch)

### [PluginTypes.Propagation](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.propagation)

### [PluginTypes.RootSpan](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.rootspan)

Represents the root span within a trace.

### [PluginTypes.RootSpanOptions](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.rootspanoptions)

An interface that describes the available options for creating root spans.

### [PluginTypes.Span](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.span)

Represents a trace span.

### [PluginTypes.SpanOptions](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.spanoptions)

An interface that describes the available options for creating a span in general.

### [PluginTypes.TraceAgentExtension](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.traceagentextension)

### [PluginTypes.TraceContext](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.tracecontext)

### [PluginTypes.Tracer](https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.tracer)

## Functions

### get()

    export declare function get(): PluginTypes.Tracer;

Get the previously created StackdriverTracer object.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.tracer` | An object exposing functions for creating custom spans. |

### start(config)

    export declare function start(config?: Config): PluginTypes.Tracer;

Start the Stackdriver Trace Agent with the given configuration (if provided). This function should only be called once, and before any other modules are loaded.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `config` | `https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/config` A configuration object. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/nodejs/docs/reference/trace-agent/latest/trace-agent/plugintypes.tracer` | An object exposing functions for creating custom spans. \[Introductory video\]<https://www.youtube.com/watch?v=NCFDqeo7AeY> |

#### Example

trace.start();

## Type Aliases

### PluginTypes.Func

    export type Func

| **Type Parameter** ||
|---|---|
| **Type** | **Description** |
| `T` |   |

### PluginTypes.GetHeaderFunction

    export type GetHeaderFunction = (key: string) => string[] | string | null | undefined;

### PluginTypes.Patch

    export type Patch

| **Type Parameter** ||
|---|---|
| **Type** | **Description** |
| `T` |   |

### PluginTypes.Plugin

    export type Plugin = Array<>

### PluginTypes.SetHeaderFunction

    export type SetHeaderFunction = (key: string, value: string) => void;