Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
58 lines
No EOL
3.3 KiB
Text
58 lines
No EOL
3.3 KiB
Text
"use strict";
|
|
/*
|
|
* Copyright The OpenTelemetry Authors
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.reconfigureLimits = exports.mergeConfig = void 0;
|
|
const config_1 = require("./config");
|
|
const core_1 = require("@opentelemetry/core");
|
|
/**
|
|
* Function to merge Default configuration (as specified in './config') with
|
|
* user provided configurations.
|
|
*/
|
|
function mergeConfig(userConfig) {
|
|
const perInstanceDefaults = {
|
|
sampler: (0, config_1.buildSamplerFromEnv)(),
|
|
};
|
|
const DEFAULT_CONFIG = (0, config_1.loadDefaultConfig)();
|
|
const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig);
|
|
target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {});
|
|
target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {});
|
|
return target;
|
|
}
|
|
exports.mergeConfig = mergeConfig;
|
|
/**
|
|
* When general limits are provided and model specific limits are not,
|
|
* configures the model specific limits by using the values from the general ones.
|
|
* @param userConfig User provided tracer configuration
|
|
*/
|
|
function reconfigureLimits(userConfig) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
const spanLimits = Object.assign({}, userConfig.spanLimits);
|
|
const parsedEnvConfig = (0, core_1.getEnvWithoutDefaults)();
|
|
/**
|
|
* Reassign span attribute count limit to use first non null value defined by user or use default value
|
|
*/
|
|
spanLimits.attributeCountLimit =
|
|
(_f = (_e = (_d = (_b = (_a = userConfig.spanLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) !== null && _b !== void 0 ? _b : (_c = userConfig.generalLimits) === null || _c === void 0 ? void 0 : _c.attributeCountLimit) !== null && _d !== void 0 ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== void 0 ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== void 0 ? _f : core_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT;
|
|
/**
|
|
* Reassign span attribute value length limit to use first non null value defined by user or use default value
|
|
*/
|
|
spanLimits.attributeValueLengthLimit =
|
|
(_m = (_l = (_k = (_h = (_g = userConfig.spanLimits) === null || _g === void 0 ? void 0 : _g.attributeValueLengthLimit) !== null && _h !== void 0 ? _h : (_j = userConfig.generalLimits) === null || _j === void 0 ? void 0 : _j.attributeValueLengthLimit) !== null && _k !== void 0 ? _k : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _l !== void 0 ? _l : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _m !== void 0 ? _m : core_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT;
|
|
return Object.assign({}, userConfig, { spanLimits });
|
|
}
|
|
exports.reconfigureLimits = reconfigureLimits;
|
|
//# sourceMappingURL=utility.js.map |