Skip to content

GoogleCloudPlatform/opentelemetry-operations-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1a61677 · Dec 12, 2024
Sep 23, 2024
Sep 27, 2024
Sep 25, 2024
Oct 3, 2024
Dec 12, 2024
Oct 4, 2023
Jan 19, 2023
Oct 4, 2023
Jan 19, 2023
Sep 23, 2024
Feb 21, 2020
Oct 3, 2024
Nov 22, 2023
Aug 15, 2024
Aug 15, 2024
Aug 15, 2024
Aug 15, 2024
Aug 15, 2024
Aug 15, 2024
Aug 15, 2024
Aug 15, 2024
Jun 18, 2021
Jun 23, 2023
Sep 27, 2024
Sep 23, 2024
Apr 12, 2024

Repository files navigation

OpenTelemetry Operations Exporters for JavaScript

The packages in this repository support all officially supported Node.js versions (10, 12, 14, 16).

To get started with instrumentation in Google Cloud, see Generate traces and metrics with Node.js.

To learn more about instrumentation and observability, including opinionated recommendations for Google Cloud Observability, visit Instrumentation and observability.

OpenTelemetry Google Cloud Trace Exporter

npm version

OpenTelemetry Google Cloud Trace Exporter allows the user to send collected traces to Google Cloud.

Google Cloud Trace is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in microservice architectures. It manages both the collection and lookup of this data.

Getting Started

This exporter package assumes your application is already instrumented with the OpenTelemetry SDK. Once you are ready to export OpenTelemetry data, you can add this exporter to your application:

npm install --save @google-cloud/opentelemetry-cloud-trace-exporter

Add the exporter to your existing OpenTelemetry tracer provider (NodeTracerProvider / BasicTracerProvider)

const { TraceExporter } = require('@google-cloud/opentelemetry-cloud-trace-exporter');
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { BatchSpanProcessor } = require('@opentelemetry/sdk-trace-base');


// Enable OpenTelemetry exporters to export traces to Google Cloud Trace.
// Exporters use Application Default Credentials (ADCs) to authenticate.
// See https://developers.google.com/identity/protocols/application-default-credentials
// for more details.

// Use your existing provider
const provider = new NodeTracerProvider();
provider.register();

// Initialize the exporter. When your application is running on Google Cloud,
// you don't need to provide auth credentials or a project id.
const exporter = new TraceExporter();

// Add the exporter to the provider
provider.addSpanProcessor(new BatchSpanProcessor(exporter));

See README.md for installation and usage information.

OpenTelemetry Google Cloud Trace Propagator

npm version

OpenTelemetry Google Cloud Trace Propagator allows other services to create spans with the right context.

See README.md for installation and usage information.

OpenTelemetry Google Cloud Monitoring Exporter

npm version

OpenTelemetry Google Cloud Monitoring Exporter allows the user to send collected metrics to Google Cloud Monitoring.

See README.md for installation and usage information.