Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add semantic conventions #66

Merged
merged 3 commits into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM openresty/openresty:1.21.4.1-0-centos

RUN yum install -y gcc gcc-c++ git cmake
RUN yum -y --enablerepo=powertools install libyaml-devel libffi-devel
RUN luarocks install lua-resty-http 0.16.1-0
RUN luarocks install lua-protobuf 0.3.3
RUN luarocks install busted 2.0.0-1
RUN luarocks install ldoc 1.4.6-2
RUN luarocks --server=http://rocks.moonscript.org install lyaml
RUN luarocks install --server=https://luarocks.org/dev luaformatter

RUN yum install -y cpanminus perl
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ format:

api-test:
$(CONTAINER_ORCHESTRATOR) run $(CONTAINER_ORCHESTRATOR_EXEC_OPTIONS) -- openresty bash -c 'busted -m "./lib/?.lua;./lib/?/?.lua;./lib/?/?/?.lua" ./spec/api'

generate-semantic-conventions:
$(CONTAINER_ORCHESTRATOR) run --no-deps $(CONTAINER_ORCHESTRATOR_EXEC_OPTIONS) -- openresty bash -c 'pushd tmp && rm -rf opentelemetry-specification && git clone --depth=1 https://github.com/open-telemetry/opentelemetry-specification.git && popd && resty ./utils/generate_semantic_conventions.lua && lua-format -i lib/opentelemetry/semantic_conventions/trace/*.lua'
9 changes: 9 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/aws.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.aws
local _M = {
-- 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).
AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"
}
return _M
17 changes: 17 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/cloudevents.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.cloudevents
local _M = {
-- The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event.
CLOUDEVENTS_EVENT_ID = "cloudevents.event_id",
-- The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened.
CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source",
-- The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses.
CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version",
-- The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence.
CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type",
-- The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source).
CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject"
}
return _M
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.compatibility
local _M = {
-- Parent-child Reference type
OPENTRACING_REF_TYPE = "opentracing.ref_type"
}
return _M
43 changes: 43 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/database.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.database
local _M = {
-- An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
DB_SYSTEM = "db.system",
-- The connection string used to connect to the database. It is recommended to remove embedded credentials.
DB_CONNECTION_STRING = "db.connection_string",
-- Username for accessing the database.
DB_USER = "db.user",
-- The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.
DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname",
-- This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).
DB_NAME = "db.name",
-- The database statement being executed.
DB_STATEMENT = "db.statement",
-- The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.
DB_OPERATION = "db.operation",
-- The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.
DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name",
-- The fetch size used for paging, i.e. how many rows will be returned at once.
DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size",
-- The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level",
-- The name of the primary table that the operation is acting upon, including the keyspace name (if applicable).
DB_CASSANDRA_TABLE = "db.cassandra.table",
-- Whether or not the query is idempotent.
DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence",
-- The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.
DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count",
-- The ID of the coordinating node for a query.
DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id",
-- The data center of the coordinating node for a query.
DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc",
-- The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.
DB_REDIS_DATABASE_INDEX = "db.redis.database_index",
-- The collection being accessed within the database stated in `db.name`.
DB_MONGODB_COLLECTION = "db.mongodb.collection",
-- The name of the primary table that the operation is acting upon, including the database name (if applicable).
DB_SQL_TABLE = "db.sql.table"
}
return _M
11 changes: 11 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/exporter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.exporter
local _M = {
-- Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET.
OTEL_STATUS_CODE = "otel.status_code",
-- Description of the Status if it has a value, otherwise not set.
OTEL_STATUS_DESCRIPTION = "otel.status_description"
}
return _M
31 changes: 31 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/faas.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.faas
local _M = {
-- Type of the trigger which caused this function execution.
FAAS_TRIGGER = "faas.trigger",
-- The execution ID of the current function execution.
FAAS_EXECUTION = "faas.execution",
-- The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.
FAAS_DOCUMENT_COLLECTION = "faas.document.collection",
-- Describes the type of the operation that was performed on the data.
FAAS_DOCUMENT_OPERATION = "faas.document.operation",
-- A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
FAAS_DOCUMENT_TIME = "faas.document.time",
-- The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.
FAAS_DOCUMENT_NAME = "faas.document.name",
-- A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
FAAS_TIME = "faas.time",
-- A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
FAAS_CRON = "faas.cron",
-- A boolean that is true if the serverless function is executed for the first time (aka cold-start).
FAAS_COLDSTART = "faas.coldstart",
-- The name of the invoked function.
FAAS_INVOKED_NAME = "faas.invoked_name",
-- The cloud provider of the invoked function.
FAAS_INVOKED_PROVIDER = "faas.invoked_provider",
-- The cloud region of the invoked function.
FAAS_INVOKED_REGION = "faas.invoked_region"
}
return _M
13 changes: 13 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/feature.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.feature
local _M = {
-- The unique identifier of the feature flag.
FEATURE_FLAG_KEY = "feature_flag.key",
-- The name of the service provider that performs the flag evaluation.
FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name",
-- SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used.
FEATURE_FLAG_VARIANT = "feature_flag.variant"
}
return _M
67 changes: 67 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/general.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.general
local _M = {
-- Transport protocol used. See note below.
NET_TRANSPORT = "net.transport",
-- Application layer protocol used. The value SHOULD be normalized to lowercase.
NET_APP_PROTOCOL_NAME = "net.app.protocol.name",
-- Version of the application layer protocol used. See note below.
NET_APP_PROTOCOL_VERSION = "net.app.protocol.version",
-- Remote socket peer name.
NET_SOCK_PEER_NAME = "net.sock.peer.name",
-- Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
NET_SOCK_PEER_ADDR = "net.sock.peer.addr",
-- Remote socket peer port.
NET_SOCK_PEER_PORT = "net.sock.peer.port",
-- Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication.
NET_SOCK_FAMILY = "net.sock.family",
-- Logical remote hostname, see note below.
NET_PEER_NAME = "net.peer.name",
-- Logical remote port number
NET_PEER_PORT = "net.peer.port",
-- Logical local hostname or similar, see note below.
NET_HOST_NAME = "net.host.name",
-- Logical local port number, preferably the one that the peer used to connect
NET_HOST_PORT = "net.host.port",
-- Local socket address. Useful in case of a multi-IP host.
NET_SOCK_HOST_ADDR = "net.sock.host.addr",
-- Local socket port number.
NET_SOCK_HOST_PORT = "net.sock.host.port",
-- The internet connection type currently being used by the host.
NET_HOST_CONNECTION_TYPE = "net.host.connection.type",
-- This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.
NET_HOST_CONNECTION_SUBTYPE = "net.host.connection.subtype",
-- The name of the mobile carrier.
NET_HOST_CARRIER_NAME = "net.host.carrier.name",
-- The mobile carrier country code.
NET_HOST_CARRIER_MCC = "net.host.carrier.mcc",
-- The mobile carrier network code.
NET_HOST_CARRIER_MNC = "net.host.carrier.mnc",
-- The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.
NET_HOST_CARRIER_ICC = "net.host.carrier.icc",
-- The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any.
PEER_SERVICE = "peer.service",
-- Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system.
ENDUSER_ID = "enduser.id",
-- Actual/assumed role the client is making the request under extracted from token or application security context.
ENDUSER_ROLE = "enduser.role",
-- Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
ENDUSER_SCOPE = "enduser.scope",
-- Current "managed" thread ID (as opposed to OS thread ID).
THREAD_ID = "thread.id",
-- Current thread name.
THREAD_NAME = "thread.name",
-- The method or function name, or equivalent (usually rightmost part of the code unit's name).
CODE_FUNCTION = "code.function",
-- The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.
CODE_NAMESPACE = "code.namespace",
-- The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
CODE_FILEPATH = "code.filepath",
-- The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.
CODE_LINENO = "code.lineno",
-- The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.
CODE_COLUMN = "code.column"
}
return _M
31 changes: 31 additions & 0 deletions lib/opentelemetry/semantic_conventions/trace/http.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- This file was automatically generated by utils/generate_semantic_conventions.lua
-- See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions
--
-- module @semantic_conventions.trace.http
local _M = {
-- HTTP request method.
HTTP_METHOD = "http.method",
-- [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
HTTP_STATUS_CODE = "http.status_code",
-- Kind of HTTP protocol used.
HTTP_FLAVOR = "http.flavor",
-- Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.
HTTP_USER_AGENT = "http.user_agent",
-- The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.
HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length",
-- The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.
HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length",
-- Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
HTTP_URL = "http.url",
-- The ordinal number of request resending attempt (for any reason, including redirects).
HTTP_RESEND_COUNT = "http.resend_count",
-- The URI scheme identifying the used protocol.
HTTP_SCHEME = "http.scheme",
-- The full request target as passed in a HTTP request line or equivalent.
HTTP_TARGET = "http.target",
-- The matched route (path template in the format used by the respective server framework). See note below
HTTP_ROUTE = "http.route",
-- The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
HTTP_CLIENT_IP = "http.client_ip"
}
return _M
Loading