diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/app/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/app/events.rb new file mode 100644 index 000000000..ec1f47cb4 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/app/events.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module APP + # @!group Event Names + + # This event indicates that the application has detected substandard UI rendering performance. + # + # Jank happens when the UI is rendered slowly enough for the user to experience some disruption or sluggishness. + # + # @note Stability Level: development + APP_JANK = 'app.jank' + + # This event represents an instantaneous click on the screen of an application. + # + # The `app.screen.click` event can be used to indicate that a user has clicked or tapped on the screen portion of an application. Clicks outside of an application's active area SHOULD NOT generate this event. This event does not differentiate between touch/mouse down and touch/mouse up. Implementations SHOULD give preference to generating this event at the time the click is complete, typically on touch release or mouse up. The location of the click event MUST be provided in absolute screen pixels. + # + # @note Stability Level: development + APP_SCREEN_CLICK = 'app.screen.click' + + # This event indicates that an application widget has been clicked. + # + # Use this event to indicate that visual application component has been clicked, typically through a user's manual interaction. + # + # @note Stability Level: development + APP_WIDGET_CLICK = 'app.widget.click' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/az/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/az/events.rb new file mode 100644 index 000000000..9e9e3af1e --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/az/events.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module AZ + # @!group Event Names + + # Deprecated. Use `azure.resource.log` instead. + # + # @note Stability Level: development + # @deprecated Replaced by `azure.resource.log`. + AZ_RESOURCE_LOG = 'az.resource.log' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/azure/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/azure/events.rb new file mode 100644 index 000000000..e95147977 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/azure/events.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module AZURE + # @!group Event Names + + # Describes Azure Resource Log event, see [Azure Resource Log Top-level Schema](https://learn.microsoft.com/azure/azure-monitor/essentials/resource-logs-schema#top-level-common-schema) for more details. + # + # @note Stability Level: development + AZURE_RESOURCE_LOG = 'azure.resource.log' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/browser/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/browser/events.rb new file mode 100644 index 000000000..0d8567cb1 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/browser/events.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module BROWSER + # @!group Event Names + + # This event describes the website performance metrics introduced by Google, See [web vitals](https://web.dev/vitals). + # + # @note Stability Level: development + BROWSER_WEB_VITAL = 'browser.web_vital' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/device/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/device/events.rb new file mode 100644 index 000000000..64e9990f2 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/device/events.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module DEVICE + # @!group Event Names + + # This event represents an occurrence of a lifecycle transition on Android or iOS platform. + # + # The event body fields MUST be used to describe the state of the application at the time of the event. + # This event is meant to be used in conjunction with `os.name` [resource semantic convention](/docs/resource/os.md) to identify the mobile operating system (e.g. Android, iOS). + # The `android.app.state` and `ios.app.state` fields are mutually exclusive and MUST NOT be used together, each field MUST be used with its corresponding `os.name` value. + # + # @note Stability Level: development + DEVICE_APP_LIFECYCLE = 'device.app.lifecycle' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/exception/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/exception/events.rb new file mode 100644 index 000000000..abac6dbf4 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/exception/events.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module EXCEPTION + # @!group Event Names + + # This event describes a single exception. + # + # @note Stability Level: stable + # + # @deprecated Now available in the stable namespace at {OpenTelemetry::SemConv::EXCEPTION::EXCEPTION}. + EXCEPTION = 'exception' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/feature_flag/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/feature_flag/events.rb new file mode 100644 index 000000000..24135e02a --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/feature_flag/events.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module FEATURE_FLAG + # @!group Event Names + + # Defines feature flag evaluation as an event. + # + # A `feature_flag.evaluation` event SHOULD be emitted whenever a feature flag value is evaluated, which may happen many times over the course of an application lifecycle. For example, a website A/B testing different animations may evaluate a flag each time a button is clicked. A `feature_flag.evaluation` event is emitted on each evaluation even if the result is the same. + # + # @note Stability Level: release_candidate + FEATURE_FLAG_EVALUATION = 'feature_flag.evaluation' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/gen_ai/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/gen_ai/events.rb new file mode 100644 index 000000000..3517c81c1 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/gen_ai/events.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module GEN_AI + # @!group Event Names + + # This event describes the assistant message passed to GenAI system. + # + # @note Stability Level: development + # @deprecated Chat history is reported on `gen_ai.input.messages` attribute on spans or `gen_ai.client.inference.operation.details` event. + GEN_AI_ASSISTANT_MESSAGE = 'gen_ai.assistant.message' + + # This event describes the Gen AI response message. + # + # @note Stability Level: development + # @deprecated Chat history is reported on `gen_ai.output.messages` attribute on spans or `gen_ai.client.inference.operation.details` event. + GEN_AI_CHOICE = 'gen_ai.choice' + + # Describes the details of a GenAI completion request including chat history and parameters. + # + # This event is opt-in and could be used to store input and output details independently from traces. + # + # @note Stability Level: development + GEN_AI_CLIENT_INFERENCE_OPERATION_DETAILS = 'gen_ai.client.inference.operation.details' + + # This event describes the system instructions passed to the GenAI model. + # + # @note Stability Level: development + # @deprecated Chat history is reported on `gen_ai.system_instructions` attribute on spans or `gen_ai.client.inference.operation.details` event. + GEN_AI_SYSTEM_MESSAGE = 'gen_ai.system.message' + + # This event describes the response from a tool or function call passed to the GenAI model. + # + # @note Stability Level: development + # @deprecated Chat history is reported on `gen_ai.input.messages` attribute on spans or `gen_ai.client.inference.operation.details` event. + GEN_AI_TOOL_MESSAGE = 'gen_ai.tool.message' + + # This event describes the user message passed to the GenAI model. + # + # @note Stability Level: development + # @deprecated Chat history is reported on `gen_ai.input.messages` attribute on spans or `gen_ai.client.inference.operation.details` event. + GEN_AI_USER_MESSAGE = 'gen_ai.user.message' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/rpc/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/rpc/events.rb new file mode 100644 index 000000000..72a3d6e66 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/rpc/events.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module RPC + # @!group Event Names + + # Describes a message sent or received within the context of an RPC call. + # + # In the lifetime of an RPC stream, an event for each message sent/received on client and server spans SHOULD be created. In case of unary calls only one sent and one received message will be recorded for both client and server spans. + # + # @note Stability Level: development + RPC_MESSAGE = 'rpc.message' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/lib/opentelemetry/semconv/incubating/session/events.rb b/semantic_conventions/lib/opentelemetry/semconv/incubating/session/events.rb new file mode 100644 index 000000000..04ef4dd96 --- /dev/null +++ b/semantic_conventions/lib/opentelemetry/semconv/incubating/session/events.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# 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 +# +# http://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. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file was autogenerated. Do not edit it by hand. + +module OpenTelemetry + module SemConv + module Incubating + module SESSION + # @!group Event Names + + # Indicates that a session has ended. + # + # For instrumentation that tracks user behavior during user sessions, a `session.end` event SHOULD be emitted every time a session ends. When a session ends and continues as a new session, this event SHOULD be emitted prior to the `session.start` event. + # + # @note Stability Level: development + SESSION_END = 'session.end' + + # Indicates that a new session has been started, optionally linking to the prior session. + # + # For instrumentation that tracks user behavior during user sessions, a `session.start` event MUST be emitted every time a session is created. When a new session is created as a continuation of a prior session, the `session.previous_id` SHOULD be included in the event. The values of `session.id` and `session.previous_id` MUST be different. + # When the `session.start` event contains both `session.id` and `session.previous_id` fields, the event indicates that the previous session has ended. If the session ID in `session.previous_id` has not yet ended via explicit `session.end` event, then the consumer SHOULD treat this continuation event as semantically equivalent to `session.end(session.previous_id)` and `session.start(session.id)`. + # + # @note Stability Level: development + SESSION_START = 'session.start' + + # @!endgroup + end + end + end +end diff --git a/semantic_conventions/templates/registry/ruby/events.j2 b/semantic_conventions/templates/registry/ruby/events.j2 new file mode 100644 index 000000000..28d237aaf --- /dev/null +++ b/semantic_conventions/templates/registry/ruby/events.j2 @@ -0,0 +1,54 @@ +{#- +# 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 +# +# http://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. +#} +{%- import 'common.j2' as common -%} +{{- common.file_header() }} + +module OpenTelemetry + module SemConv + {%- if params.incubating %} + module Incubating + {%- endif %} + module {{ ctx.id | screaming_snake_case }} + # @!group Event Names + {{ ctx }} + {% for attribute in ctx.groups %} + {%- set attr_const_name = attribute.name | screaming_snake_case %} + {%- if attribute.type is template_type %} + {%- set attr_const_name = attr_const_name ~ "_LAMBDA" %} + {%- endif %} + {{ [attribute.brief, + concat_if("\n", attribute.note), + concat_if("\n@note Stability Level: ", attribute.stability), + ] | comment(indent=6) }} + {%- if attribute is deprecated %} + {{ concat_if("\n@deprecated ", attribute.deprecated.note | default(attribute.deprecated.reason | capitalize ~ ".")) | comment(indent=6)}} + {%- elif attribute is stable and params.incubating %} + # + # @deprecated Now available in the stable namespace at {OpenTelemetry::SemConv::{{ ctx.id | screaming_snake_case }}::{{ attr_const_name }}}. + {%- endif %} + {%- if attribute.type is template_type %} + {{ attr_const_name }} = ->(key) { "{{ attribute.name }}.#{key}" } + {%- else %} + {{ attr_const_name }} = '{{ attribute.name }}' + {%- endif %} + {% endfor %} + # @!endgroup + end + {%- if params.incubating %} + end + {%- endif %} + end +end + diff --git a/semantic_conventions/templates/registry/ruby/weaver.yaml b/semantic_conventions/templates/registry/ruby/weaver.yaml index 18913a5f4..b82df6e38 100644 --- a/semantic_conventions/templates/registry/ruby/weaver.yaml +++ b/semantic_conventions/templates/registry/ruby/weaver.yaml @@ -45,6 +45,12 @@ templates: file_name: "incubating/{{ctx.root_namespace | snake_case}}/metrics.rb" params: incubating: true + - pattern: events.j2 + application_mode: each + filter: '.groups | map(select(.type == "event")) | group_by(.name | split(".") | .[0]) | map({id: .[0].id | split(".") | .[1], groups: .})' + file_name: "incubating/{{ctx.id | snake_case}}/events.rb" + params: + incubating: true default_comment_format: yard_doc comment_formats: