Skip to content

Commit

Permalink
fix: improve the semconv template to better handled referenced attrib…
Browse files Browse the repository at this point in the history
…utes
  • Loading branch information
tapico-weyert committed Apr 16, 2021
1 parent e19cfb3 commit 453d448
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions scripts/semconv/templates/SemanticAttributes.ts.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 453d448

Please sign in to comment.