-
Notifications
You must be signed in to change notification settings - Fork 913
Closed
Labels
Milestone
Description
One significant minification issues is that for "common" strings such as the SemanticConventions if any single string is "used" then all of the members of the related SemanticConvension namespace also get included in the final bundle.
The suggestion here is to
- export each "string" independently (as well as to continue to export as a single names (for backward compatability))
- Ban the usage of the "namespace" within the OpenTelemetry packages and only use the individual exported strings (reducing the bundle size for individual components)
Example of change
Change from
// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2
export const SemanticAttributes = {
/**
* The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).
*
* Note: This may be different from `faas.id` if an alias is involved.
*/
AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn',
/**
* An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
*/
DB_SYSTEM: 'db.system',
...
}
to
/**
* The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).
*
* Note: This may be different from `faas.id` if an alias is involved.
*/
export const SEMCONV_AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn';
/**
* An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
*/
export const SEMCONV_DB_SYSTEM = 'db.system';
// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2
export const SemanticAttributes = {
/**
* The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).
*
* Note: This may be different from `faas.id` if an alias is involved.
*/
AWS_LAMBDA_INVOKED_ARN: SEMCONV_AWS_LAMBDA_INVOKED_ARN',
/**
* An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
*/
DB_SYSTEM: SEMCONV_DB_SYSTEM,
/**
}
And then internal usages would only reference the SEMCONV_
constants
I'm not married to the SEMCONV_
prefix (and a prefix is not actually required), I just included here to avoid confusion and to make it easier to call out the differences.