-
Notifications
You must be signed in to change notification settings - Fork 833
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Semantic Conventions export individual strings
- Loading branch information
Showing
11 changed files
with
4,282 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
packages/opentelemetry-semantic-conventions/src/internal/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const ACCOUNT_DOT = 'account.'; | ||
export const ARN = 'arn'; | ||
export const AWS = 'aws'; | ||
export const AZURE = 'azure'; | ||
export const CASSANDRA_DOT = 'cassandra.'; | ||
export const CARRIER_DOT = 'carrier.'; | ||
export const CLOUD_DOT = 'cloud.'; | ||
export const CLUSTER_DOT = 'cluster.'; | ||
export const CODE_DOT = 'code.'; | ||
export const COLLECTION = 'collection'; | ||
export const COMMAND = 'command'; | ||
export const COMPRESSED = 'compressed'; | ||
export const CONTAINER_DOT = 'container.'; | ||
export const CONTENT = 'content'; | ||
export const CONNECTION = 'connection'; | ||
export const COORDINATOR_DOT = 'coordinator.'; | ||
export const CRON = 'cron'; | ||
export const DAEMON = 'daemon'; | ||
export const DB_DOT = 'db.'; | ||
export const DEPLOYMENT_DOT = 'deployment.'; | ||
export const DESCRIPTION = 'description'; | ||
export const DEVICE_DOT = 'device.'; | ||
export const DOCUMENT_DOT = 'document.'; | ||
export const DOT = '.'; | ||
export const DYNAMODB_DOT = 'dynamodb.'; | ||
export const ECS_DOT = 'ecs.'; | ||
export const EKS_DOT = 'eks.'; | ||
export const EXECUTABLE_DOT = 'executable.'; | ||
export const ENDUSER_DOT = 'enduser.'; | ||
export const EXCEPTION_DOT = 'exception.'; | ||
export const FAAS_DOT = 'faas.'; | ||
export const GLOBAL = 'global'; | ||
export const GROUP_DOT = 'group.'; | ||
export const KAFKA_DOT = 'kafka.'; | ||
export const K8S_DOT = 'k8s.'; | ||
export const HTTP_DOT = 'http.'; | ||
export const HOST = 'host'; | ||
export const ID = 'id'; | ||
export const IMAGE_DOT = 'image.'; | ||
export const INDEX = 'index'; | ||
export const INSTANCE = 'instance'; | ||
export const INVOKED = 'invoked'; | ||
export const JOB = 'job'; | ||
export const JSONRPC_DOT = 'jsonrpc.'; | ||
export const LAMBDA_DOT = 'lambda.'; | ||
export const LENGTH = 'length'; | ||
export const LOCAL = 'local'; | ||
export const LOG_DOT = 'log.'; | ||
export const MESSAGE = 'message'; | ||
export const MESSAGING_DOT = 'messaging.'; | ||
export const MODEL_DOT = 'model.'; | ||
export const MONGODB_DOT = 'mongodb.'; | ||
export const MSSQL_DOT = 'mssql.'; | ||
export const NAME = 'name'; | ||
export const NET_DOT = 'net.'; | ||
export const NODE_DOT = 'node.'; | ||
export const OS_DOT = 'os.'; | ||
export const PEER_DOT = 'peer.'; | ||
export const PORT = 'port'; | ||
export const PROCESS_DOT = 'process.'; | ||
export const PROTOCOL = 'protocol'; | ||
export const PROVISIONED = 'provisioned'; | ||
export const READ = 'read'; | ||
export const REQUEST = 'request'; | ||
export const REPLICA = 'replica'; | ||
export const RESPONSE = 'response'; | ||
export const RPC_DOT = 'rpc.'; | ||
export const RUNTIME_DOT = 'runtime.'; | ||
export const SDK_DOT = 'sdk.'; | ||
export const SECONDARY = 'secondary'; | ||
export const SERVICE_DOT = 'service.'; | ||
export const SET_DOT = 'set.'; | ||
export const SPACE = 'space'; | ||
export const STATEFUL = 'stateful'; | ||
export const STREAM_DOT = 'stream.'; | ||
export const TASK_DOT = 'task.'; | ||
export const TELEMETRY_DOT = 'telemetry.'; | ||
export const THREAD_DOT = 'thread.'; | ||
export const TYPE = 'type'; | ||
export const UID = 'uid'; | ||
export const UN = 'un'; | ||
export const UNDERSCORE = '_'; | ||
export const WEBENGINE_DOT = 'webengine.'; | ||
export const WRITE = 'write'; | ||
export const VERSION = 'version'; |
34 changes: 34 additions & 0 deletions
34
packages/opentelemetry-semantic-conventions/src/internal/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* Creates a const map from the given values | ||
* @param values - An array of values to be used as keys and values in the map. | ||
* @returns A populated version of the map with the values and keys derived from the values. | ||
*/ | ||
export const createConstMap = <T>(values: Array<T[keyof T]>): T => { | ||
// eslint-disable-next-line prefer-const, @typescript-eslint/no-explicit-any | ||
let res: any = {}; | ||
const len = values.length; | ||
for (let lp = 0; lp < len; lp++) { | ||
const val = values[lp]; | ||
if (val) { | ||
res[String(val).toUpperCase().replace(/[-.]/g, '_')] = val; | ||
} | ||
} | ||
|
||
return res as T; | ||
}; |
Oops, something went wrong.