UNPKG

@aws/aws-distro-opentelemetry-node-autoinstrumentation

Version:

This package provides Amazon Web Services distribution of the OpenTelemetry Node Instrumentation, which allows for auto-instrumentation of NodeJS applications.

36 lines 1.68 kB
"use strict"; // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.AwsMetricAttributesSpanExporterBuilder = void 0; const aws_metric_attribute_generator_1 = require("./aws-metric-attribute-generator"); const aws_metric_attributes_span_exporter_1 = require("./aws-metric-attributes-span-exporter"); class AwsMetricAttributesSpanExporterBuilder { static create(delegate, resource) { return new AwsMetricAttributesSpanExporterBuilder(delegate, resource); } constructor(delegate, resource) { // Optional builder elements this.generator = AwsMetricAttributesSpanExporterBuilder.DEFAULT_GENERATOR; this.delegate = delegate; this.resource = resource; } /** * Sets the generator used to generate attributes used spancs exported by the exporter. If unset, * defaults to {@link DEFAULT_GENERATOR}. Must not be null. */ setGenerator(generator) { if (generator == null) { throw new Error('generator must not be null/undefined'); } this.generator = generator; return this; } build() { return aws_metric_attributes_span_exporter_1.AwsMetricAttributesSpanExporter.create(this.delegate, this.generator, this.resource); } } // Defaults AwsMetricAttributesSpanExporterBuilder.DEFAULT_GENERATOR = new aws_metric_attribute_generator_1.AwsMetricAttributeGenerator(); exports.AwsMetricAttributesSpanExporterBuilder = AwsMetricAttributesSpanExporterBuilder; //# sourceMappingURL=aws-metric-attributes-span-exporter-builder.js.map