From 453d44895372a800de96c9d27987e246182d5975 Mon Sep 17 00:00:00 2001 From: Weyert de Boer Date: Fri, 16 Apr 2021 12:30:09 +0100 Subject: [PATCH] fix: improve the semconv template to better handled referenced attributes --- .../src/trace/SemanticAttributes.ts | 127 ------------------ .../templates/SemanticAttributes.ts.j2 | 5 +- 2 files changed, 2 insertions(+), 130 deletions(-) diff --git a/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts b/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts index a467e99731..6dbda53b4b 100644 --- a/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts +++ b/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts @@ -720,23 +720,6 @@ export enum DbSystemValues { ELASTICSEARCH = 'elasticsearch', } -export enum NetTransportValues { - /** IP.TCP. */ - IP_TCP = 'IP.TCP', - /** IP.UDP. */ - IP_UDP = 'IP.UDP', - /** Another IP-based protocol. */ - IP = 'IP', - /** Unix Domain socket. See below. */ - UNIX = 'Unix', - /** Named or anonymous pipe. See note below. */ - PIPE = 'pipe', - /** In-process communication. */ - INPROC = 'inproc', - /** Something else (non IP-based). */ - OTHER = 'other', -} - export enum DbCassandraConsistencyLevelValues { /** ALL. */ ALL = 'ALL', @@ -823,99 +806,6 @@ export enum HttpFlavorValues { QUIC = 'QUIC', } -export enum DbSystemValues { - /** Some other SQL database. Fallback only. See notes. */ - OTHER_SQL = 'other_sql', - /** Microsoft SQL Server. */ - MSSQL = 'mssql', - /** MySQL. */ - MYSQL = 'mysql', - /** Oracle Database. */ - ORACLE = 'oracle', - /** IBM Db2. */ - DB2 = 'db2', - /** PostgreSQL. */ - POSTGRESQL = 'postgresql', - /** Amazon Redshift. */ - REDSHIFT = 'redshift', - /** Apache Hive. */ - HIVE = 'hive', - /** Cloudscape. */ - CLOUDSCAPE = 'cloudscape', - /** HyperSQL DataBase. */ - HSQLDB = 'hsqldb', - /** Progress Database. */ - PROGRESS = 'progress', - /** SAP MaxDB. */ - MAXDB = 'maxdb', - /** SAP HANA. */ - HANADB = 'hanadb', - /** Ingres. */ - INGRES = 'ingres', - /** FirstSQL. */ - FIRSTSQL = 'firstsql', - /** EnterpriseDB. */ - EDB = 'edb', - /** InterSystems Caché. */ - CACHE = 'cache', - /** Adabas (Adaptable Database System). */ - ADABAS = 'adabas', - /** Firebird. */ - FIREBIRD = 'firebird', - /** Apache Derby. */ - DERBY = 'derby', - /** FileMaker. */ - FILEMAKER = 'filemaker', - /** Informix. */ - INFORMIX = 'informix', - /** InstantDB. */ - INSTANTDB = 'instantdb', - /** InterBase. */ - INTERBASE = 'interbase', - /** MariaDB. */ - MARIADB = 'mariadb', - /** Netezza. */ - NETEZZA = 'netezza', - /** Pervasive PSQL. */ - PERVASIVE = 'pervasive', - /** PointBase. */ - POINTBASE = 'pointbase', - /** SQLite. */ - SQLITE = 'sqlite', - /** Sybase. */ - SYBASE = 'sybase', - /** Teradata. */ - TERADATA = 'teradata', - /** Vertica. */ - VERTICA = 'vertica', - /** H2. */ - H2 = 'h2', - /** ColdFusion IMQ. */ - COLDFUSION = 'coldfusion', - /** Apache Cassandra. */ - CASSANDRA = 'cassandra', - /** Apache HBase. */ - HBASE = 'hbase', - /** MongoDB. */ - MONGODB = 'mongodb', - /** Redis. */ - REDIS = 'redis', - /** Couchbase. */ - COUCHBASE = 'couchbase', - /** CouchDB. */ - COUCHDB = 'couchdb', - /** Microsoft Azure Cosmos DB. */ - COSMOSDB = 'cosmosdb', - /** Amazon DynamoDB. */ - DYNAMODB = 'dynamodb', - /** Neo4j. */ - NEO4J = 'neo4j', - /** Apache Geode. */ - GEODE = 'geode', - /** Elasticsearch. */ - ELASTICSEARCH = 'elasticsearch', -} - export enum MessagingDestinationKindValues { /** A message sent to a queue. */ QUEUE = 'queue', @@ -930,23 +820,6 @@ export enum MessagingOperationValues { PROCESS = 'process', } -export enum NetTransportValues { - /** IP.TCP. */ - IP_TCP = 'IP.TCP', - /** IP.UDP. */ - IP_UDP = 'IP.UDP', - /** Another IP-based protocol. */ - IP = 'IP', - /** Unix Domain socket. See below. */ - UNIX = 'Unix', - /** Named or anonymous pipe. See note below. */ - PIPE = 'pipe', - /** In-process communication. */ - INPROC = 'inproc', - /** Something else (non IP-based). */ - OTHER = 'other', -} - export enum RpcGrpcStatusCodeValues { /** OK. */ OK = 0, diff --git a/scripts/semconv/templates/SemanticAttributes.ts.j2 b/scripts/semconv/templates/SemanticAttributes.ts.j2 index 1e5623ccbd..0342f32aea 100644 --- a/scripts/semconv/templates/SemanticAttributes.ts.j2 +++ b/scripts/semconv/templates/SemanticAttributes.ts.j2 @@ -45,15 +45,14 @@ export const {{class}} = { } // Enum definitions -{%- for attribute in attributes if attribute.is_local %} +{%- for attribute in attributes if attribute.is_local and not attribute.ref %} {%- if attribute.is_enum %} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" %} {%- set type = attribute.attr_type.enum_type %} {% if attribute.attr_type.members is defined and attribute.attr_type.members|length > 0 %} - export enum {{class_name}} { - {%- for member in attribute.attr_type.members %} + {%- for member in attribute.attr_type.members if attribute.is_local and not attribute.ref %} /** {% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %} */ {{ member.member_id | to_const_name }} = {{ print_value(type, member.value) }}, {%- endfor %}