From 3429bcf1e60299e9b91e9c67c3e9e43fe01e0f06 Mon Sep 17 00:00:00 2001 From: Bryan Naegele Date: Mon, 15 Jul 2024 17:52:19 -0600 Subject: [PATCH] Add metrics and license to hrl --- .../generate.exs | 36 +- .../include/client_attributes.hrl | 14 + .../include/error_attributes.hrl | 14 + .../include/exception_attributes.hrl | 14 + .../include/http_attributes.hrl | 14 + .../include/incubating/aws_attributes.hrl | 14 + .../include/incubating/browser_attributes.hrl | 14 + .../include/incubating/cloud_attributes.hrl | 14 + .../incubating/cloudevents_attributes.hrl | 14 + .../include/incubating/code_attributes.hrl | 14 + .../incubating/container_attributes.hrl | 14 + .../include/incubating/db_attributes.hrl | 14 + .../incubating/deployment_attributes.hrl | 14 + .../incubating/destination_attributes.hrl | 14 + .../include/incubating/device_attributes.hrl | 14 + .../include/incubating/disk_attributes.hrl | 14 + .../include/incubating/dns_attributes.hrl | 14 + .../include/incubating/enduser_attributes.hrl | 14 + .../include/incubating/event_attributes.hrl | 14 + .../include/incubating/faas_attributes.hrl | 14 + .../incubating/feature_flag_attributes.hrl | 14 + .../include/incubating/file_attributes.hrl | 14 + .../include/incubating/gcp_attributes.hrl | 14 + .../include/incubating/gen_ai_attributes.hrl | 14 + .../include/incubating/graphql_attributes.hrl | 14 + .../include/incubating/heroku_attributes.hrl | 14 + .../include/incubating/host_attributes.hrl | 14 + .../include/incubating/http_attributes.hrl | 14 + .../include/incubating/k_8_s_attributes.hrl | 14 + .../include/incubating/log_attributes.hrl | 14 + .../incubating/messaging_attributes.hrl | 14 + .../incubating/metrics/container_metrics.hrl | 30 + .../include/incubating/metrics/db_metrics.hrl | 90 ++ .../incubating/metrics/dns_metrics.hrl | 18 + .../incubating/metrics/faas_metrics.hrl | 50 ++ .../incubating/metrics/http_metrics.hrl | 46 + .../incubating/metrics/messaging_metrics.hrl | 38 + .../incubating/metrics/process_metrics.hrl | 54 ++ .../incubating/metrics/rpc_metrics.hrl | 54 ++ .../incubating/metrics/system_metrics.hrl | 126 +++ .../include/incubating/network_attributes.hrl | 14 + .../include/incubating/oci_attributes.hrl | 14 + .../incubating/opentracing_attributes.hrl | 14 + .../include/incubating/os_attributes.hrl | 14 + .../include/incubating/otel_attributes.hrl | 14 + .../include/incubating/peer_attributes.hrl | 14 + .../include/incubating/process_attributes.hrl | 14 + .../include/incubating/rpc_attributes.hrl | 14 + .../include/incubating/service_attributes.hrl | 14 + .../include/incubating/session_attributes.hrl | 14 + .../include/incubating/source_attributes.hrl | 14 + .../include/incubating/system_attributes.hrl | 14 + .../incubating/telemetry_attributes.hrl | 14 + .../include/incubating/thread_attributes.hrl | 14 + .../include/incubating/tls_attributes.hrl | 14 + .../include/incubating/url_attributes.hrl | 14 + .../incubating/user_agent_attributes.hrl | 14 + .../incubating/webengine_attributes.hrl | 14 + .../include/metrics/http_metrics.hrl | 22 + .../include/network_attributes.hrl | 14 + .../include/otel_attributes.hrl | 14 + .../include/server_attributes.hrl | 14 + .../include/service_attributes.hrl | 14 + .../include/telemetry_attributes.hrl | 14 + .../include/url_attributes.hrl | 14 + .../include/user_agent_attributes.hrl | 14 + .../incubating/metrics/container_metrics.ex | 129 +++ .../lib/incubating/metrics/db_metrics.ex | 356 ++++++++ .../lib/incubating/metrics/dns_metrics.ex | 32 + .../lib/incubating/metrics/faas_metrics.ex | 248 ++++++ .../lib/incubating/metrics/http_metrics.ex | 237 +++++ .../incubating/metrics/messaging_metrics.ex | 167 ++++ .../lib/incubating/metrics/process_metrics.ex | 275 ++++++ .../lib/incubating/metrics/rpc_metrics.ex | 329 +++++++ .../lib/incubating/metrics/system_metrics.ex | 815 ++++++++++++++++++ .../lib/metrics/http_metrics.ex | 59 ++ .../templates/registry/elixir/common.j2 | 74 ++ .../registry/elixir/semantic_attributes.ex.j2 | 115 +-- .../registry/elixir/semantic_metrics.ex.j2 | 64 ++ .../templates/registry/elixir/weaver.yaml | 24 +- .../erlang/semantic_attributes.hrl.j2 | 17 +- .../registry/erlang/semantic_metrics.hrl.j2 | 24 + .../templates/registry/erlang/weaver.yaml | 23 +- 83 files changed, 4216 insertions(+), 106 deletions(-) create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/container_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/db_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/dns_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/faas_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/http_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/messaging_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/process_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/rpc_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/incubating/metrics/system_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/include/metrics/http_metrics.hrl create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/container_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/db_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/dns_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/faas_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/http_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/messaging_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/process_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/rpc_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/incubating/metrics/system_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/lib/metrics/http_metrics.ex create mode 100644 apps/opentelemetry_semantic_conventions/templates/registry/elixir/common.j2 create mode 100644 apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 create mode 100644 apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_metrics.hrl.j2 diff --git a/apps/opentelemetry_semantic_conventions/generate.exs b/apps/opentelemetry_semantic_conventions/generate.exs index e588f053..ddcd7e62 100644 --- a/apps/opentelemetry_semantic_conventions/generate.exs +++ b/apps/opentelemetry_semantic_conventions/generate.exs @@ -1,6 +1,5 @@ semconv_version = "1.26.0" docker_img_vsn = "0.5.0" -schema_uri = "https://opentelemetry.io/schemas/#{semconv_version}" # build_dir = System.cmd("mktemp", ["-d"]) |> elem(0) |> String.trim() build_dir = "#{File.cwd!()}/semtmp" @@ -30,11 +29,13 @@ cwd = File.cwd!() ######## # elixir + +# stable attrs System.cmd("docker", [ "run", # "--rm", "-v", - "#{build_dir}:/source", + "#{build_dir}/model:/source", "-v", "#{cwd}/templates:/weaver/templates", "-v", @@ -43,30 +44,35 @@ System.cmd("docker", [ # "otel/weaver:#{docker_img_vsn}", "registry", "generate", - "--registry=/source/model", + "--registry=/source", "--templates=/weaver/templates", "--param", + "output=/output/", + "--param", "stability=stable", "elixir", "/output/" ]) +# incubating attrs System.cmd("docker", [ "run", # "--rm", "-v", - "#{build_dir}:/source", + "#{build_dir}/model:/source", "-v", "#{cwd}/templates:/weaver/templates", "-v", - "#{cwd}/lib/incubating:/output", + "#{cwd}/lib:/output", "local-weaver", # "otel/weaver:#{docker_img_vsn}", "registry", "generate", - "--registry=/source/model", + "--registry=/source", "--templates=/weaver/templates", "--param", + "output=/output/incubating/", + "--param", "stability=experimental", "elixir", "/output/" @@ -74,43 +80,49 @@ System.cmd("docker", [ # erlang +# stable attrs System.cmd("docker", [ "run", # "--rm", "-v", - "#{build_dir}:/source", + "#{build_dir}/model:/source", "-v", "#{cwd}/templates:/weaver/templates", "-v", - "#{cwd}/include:/output", + "#{cwd}/include:/output/", "local-weaver", # "otel/weaver:#{docker_img_vsn}", "registry", "generate", - "--registry=/source/model", + "--registry=/source", "--templates=/weaver/templates", "--param", + "output=/output/", + "--param", "stability=stable", "erlang", "/output/" ]) +# incubating attrs System.cmd("docker", [ "run", # "--rm", "-v", - "#{build_dir}:/source", + "#{build_dir}/model:/source", "-v", "#{cwd}/templates:/weaver/templates", "-v", - "#{cwd}/include/incubating:/output", + "#{cwd}/include:/output", "local-weaver", # "otel/weaver:#{docker_img_vsn}", "registry", "generate", - "--registry=/source/model", + "--registry=/source", "--templates=/weaver/templates", "--param", + "output=/output/incubating/", + "--param", "stability=experimental", "erlang", "/output/" diff --git a/apps/opentelemetry_semantic_conventions/include/client_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/client_attributes.hrl index 8c848ac8..193bca86 100644 --- a/apps/opentelemetry_semantic_conventions/include/client_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/client_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -define(CLIENT_ADDRESS, 'client.address'). diff --git a/apps/opentelemetry_semantic_conventions/include/error_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/error_attributes.hrl index b353d44f..880406dc 100644 --- a/apps/opentelemetry_semantic_conventions/include/error_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/error_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Describes a class of error the operation ended with. %% diff --git a/apps/opentelemetry_semantic_conventions/include/exception_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/exception_attributes.hrl index 41d7323b..fee6dd17 100644 --- a/apps/opentelemetry_semantic_conventions/include/exception_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/exception_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. %% diff --git a/apps/opentelemetry_semantic_conventions/include/http_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/http_attributes.hrl index faa29ecb..43b9eef0 100644 --- a/apps/opentelemetry_semantic_conventions/include/http_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/http_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/aws_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/aws_attributes.hrl index 9cd22985..3899e0a9 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/aws_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/aws_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The JSON-serialized value of each item in the `AttributeDefinitions` request field. -define(AWS_DYNAMODB_ATTRIBUTEDEFINITIONS, 'aws.dynamodb.attribute_definitions'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/browser_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/browser_attributes.hrl index 8d66555e..a016ca03 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/browser_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/browser_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Array of brand name and version separated by a space -define(BROWSER_BRANDS, 'browser.brands'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/cloud_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/cloud_attributes.hrl index 1c80ecdf..2ae85c46 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/cloud_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/cloud_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The cloud account ID the resource is assigned to. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/cloudevents_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/cloudevents_attributes.hrl index 8cd3c7c4..842b4638 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/cloudevents_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/cloudevents_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/code_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/code_attributes.hrl index e54514aa..8500b126 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/code_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/code_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/container_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/container_attributes.hrl index 5e637e36..5bf9f714 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/container_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/container_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The command used to run the container (i.e. the command name). %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/db_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/db_attributes.hrl index fd61d73d..08e47d15 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/db_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/db_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% 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). %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/deployment_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/deployment_attributes.hrl index a87bea18..51b0c3fe 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/deployment_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/deployment_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/destination_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/destination_attributes.hrl index 8265517f..3239960a 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/destination_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/destination_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -define(DESTINATION_ADDRESS, 'destination.address'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/device_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/device_attributes.hrl index c3870a9b..8b75ec21 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/device_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/device_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% A unique identifier representing the device %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/disk_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/disk_attributes.hrl index d7afc493..57314318 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/disk_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/disk_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The disk IO operation direction. diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/dns_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/dns_attributes.hrl index 75c62e30..b5399045 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/dns_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/dns_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The name being queried. -define(DNS_QUESTION_NAME, 'dns.question.name'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/enduser_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/enduser_attributes.hrl index 59e8cb9e..2afc72e4 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/enduser_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/enduser_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% 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. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/event_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/event_attributes.hrl index e1ffd76e..58b4dbd1 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/event_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/event_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Identifies the class / type of event. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/faas_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/faas_attributes.hrl index eab1c7f3..0e8f4b46 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/faas_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/faas_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% A boolean that is true if the serverless function is executed for the first time (aka cold-start). %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/feature_flag_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/feature_flag_attributes.hrl index 0a79d661..d931d3a0 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/feature_flag_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/feature_flag_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The unique identifier of the feature flag. -define(FEATUREFLAG_KEY, 'feature_flag.key'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/file_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/file_attributes.hrl index 2a7320d7..0ea28994 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/file_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/file_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Directory where the file is located. It should include the drive letter, when appropriate. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/gcp_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/gcp_attributes.hrl index 64ea016c..95a85150 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/gcp_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/gcp_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/gen_ai_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/gen_ai_attributes.hrl index df9b997c..26433d2f 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/gen_ai_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/gen_ai_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The full response received from the LLM. -define(GENAI_COMPLETION, 'gen_ai.completion'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/graphql_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/graphql_attributes.hrl index e5c5b725..ffb4668e 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/graphql_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/graphql_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The GraphQL document being executed. -define(GRAPHQL_DOCUMENT, 'graphql.document'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/heroku_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/heroku_attributes.hrl index 3f0be564..2116a751 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/heroku_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/heroku_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Unique identifier for the application %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/host_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/host_attributes.hrl index 89a6d832..af29e697 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/host_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/host_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The CPU architecture the host system is running on. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/http_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/http_attributes.hrl index 2b7b11c4..dde158b2 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/http_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/http_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% @deprecated Replaced by `client.address`. %% Deprecated, use `client.address` instead. -define(HTTP_CLIENTIP, 'http.client_ip'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/k_8_s_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/k_8_s_attributes.hrl index 96f17741..d897794c 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/k_8_s_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/k_8_s_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The name of the cluster. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/log_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/log_attributes.hrl index b65d8a70..cac9b33d 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/log_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/log_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The basename of the file. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/messaging_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/messaging_attributes.hrl index d4903656..74fe3b50 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/messaging_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/messaging_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The number of messages sent, received, or processed in the scope of the batching operation. -define(MESSAGING_BATCH_MESSAGECOUNT, 'messaging.batch.message_count'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/container_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/container_metrics.hrl new file mode 100644 index 00000000..70487615 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/container_metrics.hrl @@ -0,0 +1,30 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% Total CPU time consumed +-define(CONTAINER_CPU_TIME, 'container.cpu.time'). + + +%% Disk bytes for the container. +-define(CONTAINER_DISK_IO, 'container.disk.io'). + + +%% Memory usage of the container. +-define(CONTAINER_MEMORY_USAGE, 'container.memory.usage'). + + +%% Network bytes for the container. +-define(CONTAINER_NETWORK_IO, 'container.network.io'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/db_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/db_metrics.hrl new file mode 100644 index 00000000..4aaf0e41 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/db_metrics.hrl @@ -0,0 +1,90 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% The number of connections that are currently in state described by the `state` attribute +-define(DB_CLIENT_CONNECTION_COUNT, 'db.client.connection.count'). + + +%% The time it took to create a new connection +-define(DB_CLIENT_CONNECTION_CREATETIME, 'db.client.connection.create_time'). + + +%% The maximum number of idle open connections allowed +-define(DB_CLIENT_CONNECTION_IDLE_MAX, 'db.client.connection.idle.max'). + + +%% The minimum number of idle open connections allowed +-define(DB_CLIENT_CONNECTION_IDLE_MIN, 'db.client.connection.idle.min'). + + +%% The maximum number of open connections allowed +-define(DB_CLIENT_CONNECTION_MAX, 'db.client.connection.max'). + + +%% The number of pending requests for an open connection, cumulative for the entire pool +-define(DB_CLIENT_CONNECTION_PENDINGREQUESTS, 'db.client.connection.pending_requests'). + + +%% The number of connection timeouts that have occurred trying to obtain a connection from the pool +-define(DB_CLIENT_CONNECTION_TIMEOUTS, 'db.client.connection.timeouts'). + + +%% The time between borrowing a connection and returning it to the pool +-define(DB_CLIENT_CONNECTION_USETIME, 'db.client.connection.use_time'). + + +%% The time it took to obtain an open connection from the pool +-define(DB_CLIENT_CONNECTION_WAITTIME, 'db.client.connection.wait_time'). + +%% @deprecated Replaced by `db.client.connection.create_time`. Note: the unit also changed from `ms` to `s`. +%% Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`. +-define(DB_CLIENT_CONNECTIONS_CREATETIME, 'db.client.connections.create_time'). + +%% @deprecated Replaced by `db.client.connection.idle.max`. +%% Deprecated, use `db.client.connection.idle.max` instead. +-define(DB_CLIENT_CONNECTIONS_IDLE_MAX, 'db.client.connections.idle.max'). + +%% @deprecated Replaced by `db.client.connection.idle.min`. +%% Deprecated, use `db.client.connection.idle.min` instead. +-define(DB_CLIENT_CONNECTIONS_IDLE_MIN, 'db.client.connections.idle.min'). + +%% @deprecated Replaced by `db.client.connection.max`. +%% Deprecated, use `db.client.connection.max` instead. +-define(DB_CLIENT_CONNECTIONS_MAX, 'db.client.connections.max'). + +%% @deprecated Replaced by `db.client.connection.pending_requests`. +%% Deprecated, use `db.client.connection.pending_requests` instead. +-define(DB_CLIENT_CONNECTIONS_PENDINGREQUESTS, 'db.client.connections.pending_requests'). + +%% @deprecated Replaced by `db.client.connection.timeouts`. +%% Deprecated, use `db.client.connection.timeouts` instead. +-define(DB_CLIENT_CONNECTIONS_TIMEOUTS, 'db.client.connections.timeouts'). + +%% @deprecated Replaced by `db.client.connection.count`. +%% Deprecated, use `db.client.connection.count` instead. +-define(DB_CLIENT_CONNECTIONS_USAGE, 'db.client.connections.usage'). + +%% @deprecated Replaced by `db.client.connection.use_time`. Note: the unit also changed from `ms` to `s`. +%% Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`. +-define(DB_CLIENT_CONNECTIONS_USETIME, 'db.client.connections.use_time'). + +%% @deprecated Replaced by `db.client.connection.wait_time`. Note: the unit also changed from `ms` to `s`. +%% Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`. +-define(DB_CLIENT_CONNECTIONS_WAITTIME, 'db.client.connections.wait_time'). + + +%% Duration of database client operations. +-define(DB_CLIENT_OPERATION_DURATION, 'db.client.operation.duration'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/dns_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/dns_metrics.hrl new file mode 100644 index 00000000..52c3855b --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/dns_metrics.hrl @@ -0,0 +1,18 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% Measures the time taken to perform a DNS lookup. +-define(DNS_LOOKUP_DURATION, 'dns.lookup.duration'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/faas_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/faas_metrics.hrl new file mode 100644 index 00000000..8074f61e --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/faas_metrics.hrl @@ -0,0 +1,50 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% Number of invocation cold starts +-define(FAAS_COLDSTARTS, 'faas.coldstarts'). + + +%% Distribution of CPU usage per invocation +-define(FAAS_CPUUSAGE, 'faas.cpu_usage'). + + +%% Number of invocation errors +-define(FAAS_ERRORS, 'faas.errors'). + + +%% Measures the duration of the function's initialization, such as a cold start +-define(FAAS_INITDURATION, 'faas.init_duration'). + + +%% Number of successful invocations +-define(FAAS_INVOCATIONS, 'faas.invocations'). + + +%% Measures the duration of the function's logic execution +-define(FAAS_INVOKEDURATION, 'faas.invoke_duration'). + + +%% Distribution of max memory usage per invocation +-define(FAAS_MEMUSAGE, 'faas.mem_usage'). + + +%% Distribution of net I/O usage per invocation +-define(FAAS_NETIO, 'faas.net_io'). + + +%% Number of invocation timeouts +-define(FAAS_TIMEOUTS, 'faas.timeouts'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/http_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/http_metrics.hrl new file mode 100644 index 00000000..5552b269 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/http_metrics.hrl @@ -0,0 +1,46 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% Number of active HTTP requests. +-define(HTTP_CLIENT_ACTIVEREQUESTS, 'http.client.active_requests'). + + +%% The duration of the successfully established outbound HTTP connections. +-define(HTTP_CLIENT_CONNECTION_DURATION, 'http.client.connection.duration'). + + +%% Number of outbound HTTP connections that are currently active or idle on the client. +-define(HTTP_CLIENT_OPENCONNECTIONS, 'http.client.open_connections'). + + +%% Size of HTTP client request bodies. +-define(HTTP_CLIENT_REQUEST_BODY_SIZE, 'http.client.request.body.size'). + + +%% Size of HTTP client response bodies. +-define(HTTP_CLIENT_RESPONSE_BODY_SIZE, 'http.client.response.body.size'). + + +%% Number of active HTTP server requests. +-define(HTTP_SERVER_ACTIVEREQUESTS, 'http.server.active_requests'). + + +%% Size of HTTP server request bodies. +-define(HTTP_SERVER_REQUEST_BODY_SIZE, 'http.server.request.body.size'). + + +%% Size of HTTP server response bodies. +-define(HTTP_SERVER_RESPONSE_BODY_SIZE, 'http.server.response.body.size'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/messaging_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/messaging_metrics.hrl new file mode 100644 index 00000000..adf9a2c6 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/messaging_metrics.hrl @@ -0,0 +1,38 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% Measures the duration of process operation. +-define(MESSAGING_PROCESS_DURATION, 'messaging.process.duration'). + + +%% Measures the number of processed messages. +-define(MESSAGING_PROCESS_MESSAGES, 'messaging.process.messages'). + + +%% Measures the duration of publish operation. +-define(MESSAGING_PUBLISH_DURATION, 'messaging.publish.duration'). + + +%% Measures the number of published messages. +-define(MESSAGING_PUBLISH_MESSAGES, 'messaging.publish.messages'). + + +%% Measures the duration of receive operation. +-define(MESSAGING_RECEIVE_DURATION, 'messaging.receive.duration'). + + +%% Measures the number of received messages. +-define(MESSAGING_RECEIVE_MESSAGES, 'messaging.receive.messages'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/process_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/process_metrics.hrl new file mode 100644 index 00000000..1e921b53 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/process_metrics.hrl @@ -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. +%%%------------------------------------------------------------------------- + +%% Number of times the process has been context switched. +-define(PROCESS_CONTEXTSWITCHES, 'process.context_switches'). + + +%% Total CPU seconds broken down by different states. +-define(PROCESS_CPU_TIME, 'process.cpu.time'). + + +%% Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. +-define(PROCESS_CPU_UTILIZATION, 'process.cpu.utilization'). + + +%% Disk bytes transferred. +-define(PROCESS_DISK_IO, 'process.disk.io'). + + +%% The amount of physical memory in use. +-define(PROCESS_MEMORY_USAGE, 'process.memory.usage'). + + +%% The amount of committed virtual memory. +-define(PROCESS_MEMORY_VIRTUAL, 'process.memory.virtual'). + + +%% Network bytes transferred. +-define(PROCESS_NETWORK_IO, 'process.network.io'). + + +%% Number of file descriptors in use by the process. +-define(PROCESS_OPENFILEDESCRIPTOR_COUNT, 'process.open_file_descriptor.count'). + + +%% Number of page faults the process has made. +-define(PROCESS_PAGING_FAULTS, 'process.paging.faults'). + + +%% Process threads count. +-define(PROCESS_THREAD_COUNT, 'process.thread.count'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/rpc_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/rpc_metrics.hrl new file mode 100644 index 00000000..c5672692 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/rpc_metrics.hrl @@ -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. +%%%------------------------------------------------------------------------- + +%% Measures the duration of outbound RPC. +-define(RPC_CLIENT_DURATION, 'rpc.client.duration'). + + +%% Measures the size of RPC request messages (uncompressed). +-define(RPC_CLIENT_REQUEST_SIZE, 'rpc.client.request.size'). + + +%% Measures the number of messages received per RPC. +-define(RPC_CLIENT_REQUESTSPERRPC, 'rpc.client.requests_per_rpc'). + + +%% Measures the size of RPC response messages (uncompressed). +-define(RPC_CLIENT_RESPONSE_SIZE, 'rpc.client.response.size'). + + +%% Measures the number of messages sent per RPC. +-define(RPC_CLIENT_RESPONSESPERRPC, 'rpc.client.responses_per_rpc'). + + +%% Measures the duration of inbound RPC. +-define(RPC_SERVER_DURATION, 'rpc.server.duration'). + + +%% Measures the size of RPC request messages (uncompressed). +-define(RPC_SERVER_REQUEST_SIZE, 'rpc.server.request.size'). + + +%% Measures the number of messages received per RPC. +-define(RPC_SERVER_REQUESTSPERRPC, 'rpc.server.requests_per_rpc'). + + +%% Measures the size of RPC response messages (uncompressed). +-define(RPC_SERVER_RESPONSE_SIZE, 'rpc.server.response.size'). + + +%% Measures the number of messages sent per RPC. +-define(RPC_SERVER_RESPONSESPERRPC, 'rpc.server.responses_per_rpc'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/metrics/system_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/system_metrics.hrl new file mode 100644 index 00000000..a0f0d737 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/incubating/metrics/system_metrics.hrl @@ -0,0 +1,126 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% Reports the current frequency of the CPU in Hz +-define(SYSTEM_CPU_FREQUENCY, 'system.cpu.frequency'). + + +%% Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking +-define(SYSTEM_CPU_LOGICAL_COUNT, 'system.cpu.logical.count'). + + +%% Reports the number of actual physical processor cores on the hardware +-define(SYSTEM_CPU_PHYSICAL_COUNT, 'system.cpu.physical.count'). + + +%% Seconds each logical CPU spent on each mode +-define(SYSTEM_CPU_TIME, 'system.cpu.time'). + + +%% Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs +-define(SYSTEM_CPU_UTILIZATION, 'system.cpu.utilization'). + + +%% none +-define(SYSTEM_DISK_IO, 'system.disk.io'). + + +%% Time disk spent activated +-define(SYSTEM_DISK_IOTIME, 'system.disk.io_time'). + + +%% none +-define(SYSTEM_DISK_MERGED, 'system.disk.merged'). + + +%% Sum of the time each operation took to complete +-define(SYSTEM_DISK_OPERATIONTIME, 'system.disk.operation_time'). + + +%% none +-define(SYSTEM_DISK_OPERATIONS, 'system.disk.operations'). + + +%% none +-define(SYSTEM_FILESYSTEM_USAGE, 'system.filesystem.usage'). + + +%% none +-define(SYSTEM_FILESYSTEM_UTILIZATION, 'system.filesystem.utilization'). + + +%% An estimate of how much memory is available for starting new applications, without causing swapping +-define(SYSTEM_LINUX_MEMORY_AVAILABLE, 'system.linux.memory.available'). + + +%% Total memory available in the system. +-define(SYSTEM_MEMORY_LIMIT, 'system.memory.limit'). + + +%% Shared memory used (mostly by tmpfs). +-define(SYSTEM_MEMORY_SHARED, 'system.memory.shared'). + + +%% Reports memory in use by state. +-define(SYSTEM_MEMORY_USAGE, 'system.memory.usage'). + + +%% none +-define(SYSTEM_MEMORY_UTILIZATION, 'system.memory.utilization'). + + +%% none +-define(SYSTEM_NETWORK_CONNECTIONS, 'system.network.connections'). + + +%% Count of packets that are dropped or discarded even though there was no error +-define(SYSTEM_NETWORK_DROPPED, 'system.network.dropped'). + + +%% Count of network errors detected +-define(SYSTEM_NETWORK_ERRORS, 'system.network.errors'). + + +%% none +-define(SYSTEM_NETWORK_IO, 'system.network.io'). + + +%% none +-define(SYSTEM_NETWORK_PACKETS, 'system.network.packets'). + + +%% none +-define(SYSTEM_PAGING_FAULTS, 'system.paging.faults'). + + +%% none +-define(SYSTEM_PAGING_OPERATIONS, 'system.paging.operations'). + + +%% Unix swap or windows pagefile usage +-define(SYSTEM_PAGING_USAGE, 'system.paging.usage'). + + +%% none +-define(SYSTEM_PAGING_UTILIZATION, 'system.paging.utilization'). + + +%% Total number of processes in each state +-define(SYSTEM_PROCESS_COUNT, 'system.process.count'). + + +%% Total number of processes created over uptime of the host +-define(SYSTEM_PROCESS_CREATED, 'system.process.created'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/network_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/network_attributes.hrl index 529d9bea..650c9e02 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/network_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/network_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% @deprecated Replaced by `network.local.address`. %% Deprecated, use `network.local.address`. -define(NET_HOST_IP, 'net.host.ip'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/oci_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/oci_attributes.hrl index b5dde941..18bab4a8 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/oci_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/oci_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/opentracing_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/opentracing_attributes.hrl index fcf15225..49fd7ccc 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/opentracing_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/opentracing_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Parent-child Reference type diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/os_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/os_attributes.hrl index 4588301c..554dcfaa 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/os_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/os_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Unique identifier for a particular build or compilation of the operating system. -define(OS_BUILDID, 'os.build_id'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/otel_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/otel_attributes.hrl index 531f5859..13575604 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/otel_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/otel_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% @deprecated use the `otel.scope.name` attribute. %% -define(OTEL_LIBRARY_NAME, 'otel.library.name'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/peer_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/peer_attributes.hrl index 397d5486..3dfee4e6 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/peer_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/peer_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/process_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/process_attributes.hrl index bf8afa2f..fc451b1b 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/process_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/process_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/rpc_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/rpc_attributes.hrl index bd856543..0e32b826 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/rpc_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/rpc_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% @deprecated Replaced by `rpc.message.compressed_size`. %% Deprecated, use `rpc.message.compressed_size` instead. -define(MESSAGE_COMPRESSEDSIZE, 'message.compressed_size'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/service_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/service_attributes.hrl index 3c7da21e..fd51e6b2 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/service_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/service_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The string ID of the service instance. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/session_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/session_attributes.hrl index 2c54971b..64c3f7b9 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/session_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/session_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% A unique id to identify a session. -define(SESSION_ID, 'session.id'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/source_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/source_attributes.hrl index 183305cb..4f7c3f9b 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/source_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/source_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -define(SOURCE_ADDRESS, 'source.address'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/system_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/system_attributes.hrl index f5341d42..f9fdfac1 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/system_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/system_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The logical CPU number [0..n-1] -define(SYSTEM_CPU_LOGICALNUMBER, 'system.cpu.logical_number'). diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/telemetry_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/telemetry_attributes.hrl index ec99328e..913e6ca0 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/telemetry_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/telemetry_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The name of the auto instrumentation agent or distribution, if used. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/thread_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/thread_attributes.hrl index b5741b9c..8eec8d36 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/thread_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/thread_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Current "managed" thread ID (as opposed to OS thread ID). %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/tls_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/tls_attributes.hrl index 82af9a6a..08c08a63 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/tls_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/tls_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/url_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/url_attributes.hrl index 162ac320..0c2a7d35 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/url_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/url_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Domain extracted from the `url.full`, such as "opentelemetry.io". %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/user_agent_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/user_agent_attributes.hrl index 2fabfe14..5e35719e 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/user_agent_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/user_agent_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Name of the user-agent extracted from original. Usually refers to the browser's name. %% diff --git a/apps/opentelemetry_semantic_conventions/include/incubating/webengine_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/incubating/webengine_attributes.hrl index 3423838c..fe6cd563 100644 --- a/apps/opentelemetry_semantic_conventions/include/incubating/webengine_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/incubating/webengine_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Additional description of the web engine (e.g. detailed version and edition information). %% diff --git a/apps/opentelemetry_semantic_conventions/include/metrics/http_metrics.hrl b/apps/opentelemetry_semantic_conventions/include/metrics/http_metrics.hrl new file mode 100644 index 00000000..32212de8 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/include/metrics/http_metrics.hrl @@ -0,0 +1,22 @@ + +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +%% Duration of HTTP client requests. +-define(HTTP_CLIENT_REQUEST_DURATION, 'http.client.request.duration'). + + +%% Duration of HTTP server requests. +-define(HTTP_SERVER_REQUEST_DURATION, 'http.server.request.duration'). diff --git a/apps/opentelemetry_semantic_conventions/include/network_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/network_attributes.hrl index a8bdcd0b..5997e7c6 100644 --- a/apps/opentelemetry_semantic_conventions/include/network_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/network_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Local address of the network connection - IP address or Unix domain socket name. -define(NETWORK_LOCAL_ADDRESS, 'network.local.address'). diff --git a/apps/opentelemetry_semantic_conventions/include/otel_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/otel_attributes.hrl index 19d26c74..719149db 100644 --- a/apps/opentelemetry_semantic_conventions/include/otel_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/otel_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). -define(OTEL_SCOPE_NAME, 'otel.scope.name'). diff --git a/apps/opentelemetry_semantic_conventions/include/server_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/server_attributes.hrl index 5fd016fd..0b31242b 100644 --- a/apps/opentelemetry_semantic_conventions/include/server_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/server_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -define(SERVER_ADDRESS, 'server.address'). diff --git a/apps/opentelemetry_semantic_conventions/include/service_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/service_attributes.hrl index ae4802aa..5a9422ad 100644 --- a/apps/opentelemetry_semantic_conventions/include/service_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/service_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Logical name of the service. %% diff --git a/apps/opentelemetry_semantic_conventions/include/telemetry_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/telemetry_attributes.hrl index 13a0d439..2c8ff0d1 100644 --- a/apps/opentelemetry_semantic_conventions/include/telemetry_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/telemetry_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The language of the telemetry SDK. %% diff --git a/apps/opentelemetry_semantic_conventions/include/url_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/url_attributes.hrl index aba14826..de20e51b 100644 --- a/apps/opentelemetry_semantic_conventions/include/url_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/url_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component %% diff --git a/apps/opentelemetry_semantic_conventions/include/user_agent_attributes.hrl b/apps/opentelemetry_semantic_conventions/include/user_agent_attributes.hrl index e95e7a2a..c55e0ea2 100644 --- a/apps/opentelemetry_semantic_conventions/include/user_agent_attributes.hrl +++ b/apps/opentelemetry_semantic_conventions/include/user_agent_attributes.hrl @@ -1,4 +1,18 @@ +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- %% Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. %% diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/container_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/container_metrics.ex new file mode 100644 index 00000000..afb594d1 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/container_metrics.ex @@ -0,0 +1,129 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.ContainerMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for Container metrics. + """ + @doc """ + Total CPU time consumed + + Instrument: `counter` + Unit: `s` + ### Notes + + Total CPU time consumed by the specific container on all available CPU cores + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ContainerMetrics.container_cpu_time() + :"container.cpu.time" + + ### Erlang + + ```erlang + ?CONTAINER_CPU_TIME. + 'container.cpu.time' + ``` + + + """ + + @spec container_cpu_time :: :"container.cpu.time" + def container_cpu_time do + :"container.cpu.time" + end + + @doc """ + Disk bytes for the container. + + Instrument: `counter` + Unit: `By` + ### Notes + + The total number of bytes read/written successfully (aggregated from all disks). + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ContainerMetrics.container_disk_io() + :"container.disk.io" + + ### Erlang + + ```erlang + ?CONTAINER_DISK_IO. + 'container.disk.io' + ``` + + + """ + + @spec container_disk_io :: :"container.disk.io" + def container_disk_io do + :"container.disk.io" + end + + @doc """ + Memory usage of the container. + + Instrument: `counter` + Unit: `By` + ### Notes + + Memory usage of the container. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ContainerMetrics.container_memory_usage() + :"container.memory.usage" + + ### Erlang + + ```erlang + ?CONTAINER_MEMORY_USAGE. + 'container.memory.usage' + ``` + + + """ + + @spec container_memory_usage :: :"container.memory.usage" + def container_memory_usage do + :"container.memory.usage" + end + + @doc """ + Network bytes for the container. + + Instrument: `counter` + Unit: `By` + ### Notes + + The number of bytes sent/received on all network interfaces by the container. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ContainerMetrics.container_network_io() + :"container.network.io" + + ### Erlang + + ```erlang + ?CONTAINER_NETWORK_IO. + 'container.network.io' + ``` + + + """ + + @spec container_network_io :: :"container.network.io" + def container_network_io do + :"container.network.io" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/db_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/db_metrics.ex new file mode 100644 index 00000000..b7f24721 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/db_metrics.ex @@ -0,0 +1,356 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for DB metrics. + """ + @doc """ + The number of connections that are currently in state described by the `state` attribute + + Instrument: `updowncounter` + Unit: `{connection}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_count() + :"db.client.connection.count" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_COUNT. + 'db.client.connection.count' + ``` + + + """ + + @spec db_client_connection_count :: :"db.client.connection.count" + def db_client_connection_count do + :"db.client.connection.count" + end + + @doc """ + The time it took to create a new connection + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_createtime() + :"db.client.connection.create_time" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_CREATETIME. + 'db.client.connection.create_time' + ``` + + + """ + + @spec db_client_connection_createtime :: :"db.client.connection.create_time" + def db_client_connection_createtime do + :"db.client.connection.create_time" + end + + @doc """ + The maximum number of idle open connections allowed + + Instrument: `updowncounter` + Unit: `{connection}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_idle_max() + :"db.client.connection.idle.max" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_IDLE_MAX. + 'db.client.connection.idle.max' + ``` + + + """ + + @spec db_client_connection_idle_max :: :"db.client.connection.idle.max" + def db_client_connection_idle_max do + :"db.client.connection.idle.max" + end + + @doc """ + The minimum number of idle open connections allowed + + Instrument: `updowncounter` + Unit: `{connection}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_idle_min() + :"db.client.connection.idle.min" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_IDLE_MIN. + 'db.client.connection.idle.min' + ``` + + + """ + + @spec db_client_connection_idle_min :: :"db.client.connection.idle.min" + def db_client_connection_idle_min do + :"db.client.connection.idle.min" + end + + @doc """ + The maximum number of open connections allowed + + Instrument: `updowncounter` + Unit: `{connection}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_max() + :"db.client.connection.max" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_MAX. + 'db.client.connection.max' + ``` + + + """ + + @spec db_client_connection_max :: :"db.client.connection.max" + def db_client_connection_max do + :"db.client.connection.max" + end + + @doc """ + The number of pending requests for an open connection, cumulative for the entire pool + + Instrument: `updowncounter` + Unit: `{request}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_pendingrequests() + :"db.client.connection.pending_requests" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_PENDINGREQUESTS. + 'db.client.connection.pending_requests' + ``` + + + """ + + @spec db_client_connection_pendingrequests :: :"db.client.connection.pending_requests" + def db_client_connection_pendingrequests do + :"db.client.connection.pending_requests" + end + + @doc """ + The number of connection timeouts that have occurred trying to obtain a connection from the pool + + Instrument: `counter` + Unit: `{timeout}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_timeouts() + :"db.client.connection.timeouts" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_TIMEOUTS. + 'db.client.connection.timeouts' + ``` + + + """ + + @spec db_client_connection_timeouts :: :"db.client.connection.timeouts" + def db_client_connection_timeouts do + :"db.client.connection.timeouts" + end + + @doc """ + The time between borrowing a connection and returning it to the pool + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_usetime() + :"db.client.connection.use_time" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_USETIME. + 'db.client.connection.use_time' + ``` + + + """ + + @spec db_client_connection_usetime :: :"db.client.connection.use_time" + def db_client_connection_usetime do + :"db.client.connection.use_time" + end + + @doc """ + The time it took to obtain an open connection from the pool + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_connection_waittime() + :"db.client.connection.wait_time" + + ### Erlang + + ```erlang + ?DB_CLIENT_CONNECTION_WAITTIME. + 'db.client.connection.wait_time' + ``` + + + """ + + @spec db_client_connection_waittime :: :"db.client.connection.wait_time" + def db_client_connection_waittime do + :"db.client.connection.wait_time" + end + + @deprecated """ + Replaced by `db.client.connection.create_time`. Note: the unit also changed from `ms` to `s`. + """ + + @spec db_client_connections_createtime :: :"db.client.connections.create_time" + def db_client_connections_createtime do + :"db.client.connections.create_time" + end + + @deprecated """ + Replaced by `db.client.connection.idle.max`. + """ + + @spec db_client_connections_idle_max :: :"db.client.connections.idle.max" + def db_client_connections_idle_max do + :"db.client.connections.idle.max" + end + + @deprecated """ + Replaced by `db.client.connection.idle.min`. + """ + + @spec db_client_connections_idle_min :: :"db.client.connections.idle.min" + def db_client_connections_idle_min do + :"db.client.connections.idle.min" + end + + @deprecated """ + Replaced by `db.client.connection.max`. + """ + + @spec db_client_connections_max :: :"db.client.connections.max" + def db_client_connections_max do + :"db.client.connections.max" + end + + @deprecated """ + Replaced by `db.client.connection.pending_requests`. + """ + + @spec db_client_connections_pendingrequests :: :"db.client.connections.pending_requests" + def db_client_connections_pendingrequests do + :"db.client.connections.pending_requests" + end + + @deprecated """ + Replaced by `db.client.connection.timeouts`. + """ + + @spec db_client_connections_timeouts :: :"db.client.connections.timeouts" + def db_client_connections_timeouts do + :"db.client.connections.timeouts" + end + + @deprecated """ + Replaced by `db.client.connection.count`. + """ + + @spec db_client_connections_usage :: :"db.client.connections.usage" + def db_client_connections_usage do + :"db.client.connections.usage" + end + + @deprecated """ + Replaced by `db.client.connection.use_time`. Note: the unit also changed from `ms` to `s`. + """ + + @spec db_client_connections_usetime :: :"db.client.connections.use_time" + def db_client_connections_usetime do + :"db.client.connections.use_time" + end + + @deprecated """ + Replaced by `db.client.connection.wait_time`. Note: the unit also changed from `ms` to `s`. + """ + + @spec db_client_connections_waittime :: :"db.client.connections.wait_time" + def db_client_connections_waittime do + :"db.client.connections.wait_time" + end + + @doc """ + Duration of database client operations. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DbMetrics.db_client_operation_duration() + :"db.client.operation.duration" + + ### Erlang + + ```erlang + ?DB_CLIENT_OPERATION_DURATION. + 'db.client.operation.duration' + ``` + + + """ + + @spec db_client_operation_duration :: :"db.client.operation.duration" + def db_client_operation_duration do + :"db.client.operation.duration" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/dns_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/dns_metrics.ex new file mode 100644 index 00000000..8608cde1 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/dns_metrics.ex @@ -0,0 +1,32 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.DnsMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for DNS metrics. + """ + @doc """ + Measures the time taken to perform a DNS lookup. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.DnsMetrics.dns_lookup_duration() + :"dns.lookup.duration" + + ### Erlang + + ```erlang + ?DNS_LOOKUP_DURATION. + 'dns.lookup.duration' + ``` + + + """ + + @spec dns_lookup_duration :: :"dns.lookup.duration" + def dns_lookup_duration do + :"dns.lookup.duration" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/faas_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/faas_metrics.ex new file mode 100644 index 00000000..594f553a --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/faas_metrics.ex @@ -0,0 +1,248 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for FAAS metrics. + """ + @doc """ + Number of invocation cold starts + + Instrument: `counter` + Unit: `{coldstart}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_coldstarts() + :"faas.coldstarts" + + ### Erlang + + ```erlang + ?FAAS_COLDSTARTS. + 'faas.coldstarts' + ``` + + + """ + + @spec faas_coldstarts :: :"faas.coldstarts" + def faas_coldstarts do + :"faas.coldstarts" + end + + @doc """ + Distribution of CPU usage per invocation + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_cpuusage() + :"faas.cpu_usage" + + ### Erlang + + ```erlang + ?FAAS_CPUUSAGE. + 'faas.cpu_usage' + ``` + + + """ + + @spec faas_cpuusage :: :"faas.cpu_usage" + def faas_cpuusage do + :"faas.cpu_usage" + end + + @doc """ + Number of invocation errors + + Instrument: `counter` + Unit: `{error}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_errors() + :"faas.errors" + + ### Erlang + + ```erlang + ?FAAS_ERRORS. + 'faas.errors' + ``` + + + """ + + @spec faas_errors :: :"faas.errors" + def faas_errors do + :"faas.errors" + end + + @doc """ + Measures the duration of the function's initialization, such as a cold start + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_initduration() + :"faas.init_duration" + + ### Erlang + + ```erlang + ?FAAS_INITDURATION. + 'faas.init_duration' + ``` + + + """ + + @spec faas_initduration :: :"faas.init_duration" + def faas_initduration do + :"faas.init_duration" + end + + @doc """ + Number of successful invocations + + Instrument: `counter` + Unit: `{invocation}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_invocations() + :"faas.invocations" + + ### Erlang + + ```erlang + ?FAAS_INVOCATIONS. + 'faas.invocations' + ``` + + + """ + + @spec faas_invocations :: :"faas.invocations" + def faas_invocations do + :"faas.invocations" + end + + @doc """ + Measures the duration of the function's logic execution + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_invokeduration() + :"faas.invoke_duration" + + ### Erlang + + ```erlang + ?FAAS_INVOKEDURATION. + 'faas.invoke_duration' + ``` + + + """ + + @spec faas_invokeduration :: :"faas.invoke_duration" + def faas_invokeduration do + :"faas.invoke_duration" + end + + @doc """ + Distribution of max memory usage per invocation + + Instrument: `histogram` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_memusage() + :"faas.mem_usage" + + ### Erlang + + ```erlang + ?FAAS_MEMUSAGE. + 'faas.mem_usage' + ``` + + + """ + + @spec faas_memusage :: :"faas.mem_usage" + def faas_memusage do + :"faas.mem_usage" + end + + @doc """ + Distribution of net I/O usage per invocation + + Instrument: `histogram` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_netio() + :"faas.net_io" + + ### Erlang + + ```erlang + ?FAAS_NETIO. + 'faas.net_io' + ``` + + + """ + + @spec faas_netio :: :"faas.net_io" + def faas_netio do + :"faas.net_io" + end + + @doc """ + Number of invocation timeouts + + Instrument: `counter` + Unit: `{timeout}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.FaasMetrics.faas_timeouts() + :"faas.timeouts" + + ### Erlang + + ```erlang + ?FAAS_TIMEOUTS. + 'faas.timeouts' + ``` + + + """ + + @spec faas_timeouts :: :"faas.timeouts" + def faas_timeouts do + :"faas.timeouts" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/http_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/http_metrics.ex new file mode 100644 index 00000000..bfcc956b --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/http_metrics.ex @@ -0,0 +1,237 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for HTTP metrics. + """ + @doc """ + Number of active HTTP requests. + + Instrument: `updowncounter` + Unit: `{request}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_client_activerequests() + :"http.client.active_requests" + + ### Erlang + + ```erlang + ?HTTP_CLIENT_ACTIVEREQUESTS. + 'http.client.active_requests' + ``` + + + """ + + @spec http_client_activerequests :: :"http.client.active_requests" + def http_client_activerequests do + :"http.client.active_requests" + end + + @doc """ + The duration of the successfully established outbound HTTP connections. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_client_connection_duration() + :"http.client.connection.duration" + + ### Erlang + + ```erlang + ?HTTP_CLIENT_CONNECTION_DURATION. + 'http.client.connection.duration' + ``` + + + """ + + @spec http_client_connection_duration :: :"http.client.connection.duration" + def http_client_connection_duration do + :"http.client.connection.duration" + end + + @doc """ + Number of outbound HTTP connections that are currently active or idle on the client. + + Instrument: `updowncounter` + Unit: `{connection}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_client_openconnections() + :"http.client.open_connections" + + ### Erlang + + ```erlang + ?HTTP_CLIENT_OPENCONNECTIONS. + 'http.client.open_connections' + ``` + + + """ + + @spec http_client_openconnections :: :"http.client.open_connections" + def http_client_openconnections do + :"http.client.open_connections" + end + + @doc """ + Size of HTTP client request bodies. + + Instrument: `histogram` + Unit: `By` + ### Notes + + 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. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_client_request_body_size() + :"http.client.request.body.size" + + ### Erlang + + ```erlang + ?HTTP_CLIENT_REQUEST_BODY_SIZE. + 'http.client.request.body.size' + ``` + + + """ + + @spec http_client_request_body_size :: :"http.client.request.body.size" + def http_client_request_body_size do + :"http.client.request.body.size" + end + + @doc """ + Size of HTTP client response bodies. + + Instrument: `histogram` + Unit: `By` + ### Notes + + 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. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_client_response_body_size() + :"http.client.response.body.size" + + ### Erlang + + ```erlang + ?HTTP_CLIENT_RESPONSE_BODY_SIZE. + 'http.client.response.body.size' + ``` + + + """ + + @spec http_client_response_body_size :: :"http.client.response.body.size" + def http_client_response_body_size do + :"http.client.response.body.size" + end + + @doc """ + Number of active HTTP server requests. + + Instrument: `updowncounter` + Unit: `{request}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_server_activerequests() + :"http.server.active_requests" + + ### Erlang + + ```erlang + ?HTTP_SERVER_ACTIVEREQUESTS. + 'http.server.active_requests' + ``` + + + """ + + @spec http_server_activerequests :: :"http.server.active_requests" + def http_server_activerequests do + :"http.server.active_requests" + end + + @doc """ + Size of HTTP server request bodies. + + Instrument: `histogram` + Unit: `By` + ### Notes + + 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. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_server_request_body_size() + :"http.server.request.body.size" + + ### Erlang + + ```erlang + ?HTTP_SERVER_REQUEST_BODY_SIZE. + 'http.server.request.body.size' + ``` + + + """ + + @spec http_server_request_body_size :: :"http.server.request.body.size" + def http_server_request_body_size do + :"http.server.request.body.size" + end + + @doc """ + Size of HTTP server response bodies. + + Instrument: `histogram` + Unit: `By` + ### Notes + + 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. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.HttpMetrics.http_server_response_body_size() + :"http.server.response.body.size" + + ### Erlang + + ```erlang + ?HTTP_SERVER_RESPONSE_BODY_SIZE. + 'http.server.response.body.size' + ``` + + + """ + + @spec http_server_response_body_size :: :"http.server.response.body.size" + def http_server_response_body_size do + :"http.server.response.body.size" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/messaging_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/messaging_metrics.ex new file mode 100644 index 00000000..f1380483 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/messaging_metrics.ex @@ -0,0 +1,167 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.MessagingMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for Messaging metrics. + """ + @doc """ + Measures the duration of process operation. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.MessagingMetrics.messaging_process_duration() + :"messaging.process.duration" + + ### Erlang + + ```erlang + ?MESSAGING_PROCESS_DURATION. + 'messaging.process.duration' + ``` + + + """ + + @spec messaging_process_duration :: :"messaging.process.duration" + def messaging_process_duration do + :"messaging.process.duration" + end + + @doc """ + Measures the number of processed messages. + + Instrument: `counter` + Unit: `{message}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.MessagingMetrics.messaging_process_messages() + :"messaging.process.messages" + + ### Erlang + + ```erlang + ?MESSAGING_PROCESS_MESSAGES. + 'messaging.process.messages' + ``` + + + """ + + @spec messaging_process_messages :: :"messaging.process.messages" + def messaging_process_messages do + :"messaging.process.messages" + end + + @doc """ + Measures the duration of publish operation. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.MessagingMetrics.messaging_publish_duration() + :"messaging.publish.duration" + + ### Erlang + + ```erlang + ?MESSAGING_PUBLISH_DURATION. + 'messaging.publish.duration' + ``` + + + """ + + @spec messaging_publish_duration :: :"messaging.publish.duration" + def messaging_publish_duration do + :"messaging.publish.duration" + end + + @doc """ + Measures the number of published messages. + + Instrument: `counter` + Unit: `{message}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.MessagingMetrics.messaging_publish_messages() + :"messaging.publish.messages" + + ### Erlang + + ```erlang + ?MESSAGING_PUBLISH_MESSAGES. + 'messaging.publish.messages' + ``` + + + """ + + @spec messaging_publish_messages :: :"messaging.publish.messages" + def messaging_publish_messages do + :"messaging.publish.messages" + end + + @doc """ + Measures the duration of receive operation. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.MessagingMetrics.messaging_receive_duration() + :"messaging.receive.duration" + + ### Erlang + + ```erlang + ?MESSAGING_RECEIVE_DURATION. + 'messaging.receive.duration' + ``` + + + """ + + @spec messaging_receive_duration :: :"messaging.receive.duration" + def messaging_receive_duration do + :"messaging.receive.duration" + end + + @doc """ + Measures the number of received messages. + + Instrument: `counter` + Unit: `{message}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.MessagingMetrics.messaging_receive_messages() + :"messaging.receive.messages" + + ### Erlang + + ```erlang + ?MESSAGING_RECEIVE_MESSAGES. + 'messaging.receive.messages' + ``` + + + """ + + @spec messaging_receive_messages :: :"messaging.receive.messages" + def messaging_receive_messages do + :"messaging.receive.messages" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/process_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/process_metrics.ex new file mode 100644 index 00000000..43d85620 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/process_metrics.ex @@ -0,0 +1,275 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for Process metrics. + """ + @doc """ + Number of times the process has been context switched. + + Instrument: `counter` + Unit: `{count}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_contextswitches() + :"process.context_switches" + + ### Erlang + + ```erlang + ?PROCESS_CONTEXTSWITCHES. + 'process.context_switches' + ``` + + + """ + + @spec process_contextswitches :: :"process.context_switches" + def process_contextswitches do + :"process.context_switches" + end + + @doc """ + Total CPU seconds broken down by different states. + + Instrument: `counter` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_cpu_time() + :"process.cpu.time" + + ### Erlang + + ```erlang + ?PROCESS_CPU_TIME. + 'process.cpu.time' + ``` + + + """ + + @spec process_cpu_time :: :"process.cpu.time" + def process_cpu_time do + :"process.cpu.time" + end + + @doc """ + Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. + + Instrument: `gauge` + Unit: `1` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_cpu_utilization() + :"process.cpu.utilization" + + ### Erlang + + ```erlang + ?PROCESS_CPU_UTILIZATION. + 'process.cpu.utilization' + ``` + + + """ + + @spec process_cpu_utilization :: :"process.cpu.utilization" + def process_cpu_utilization do + :"process.cpu.utilization" + end + + @doc """ + Disk bytes transferred. + + Instrument: `counter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_disk_io() + :"process.disk.io" + + ### Erlang + + ```erlang + ?PROCESS_DISK_IO. + 'process.disk.io' + ``` + + + """ + + @spec process_disk_io :: :"process.disk.io" + def process_disk_io do + :"process.disk.io" + end + + @doc """ + The amount of physical memory in use. + + Instrument: `updowncounter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_memory_usage() + :"process.memory.usage" + + ### Erlang + + ```erlang + ?PROCESS_MEMORY_USAGE. + 'process.memory.usage' + ``` + + + """ + + @spec process_memory_usage :: :"process.memory.usage" + def process_memory_usage do + :"process.memory.usage" + end + + @doc """ + The amount of committed virtual memory. + + Instrument: `updowncounter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_memory_virtual() + :"process.memory.virtual" + + ### Erlang + + ```erlang + ?PROCESS_MEMORY_VIRTUAL. + 'process.memory.virtual' + ``` + + + """ + + @spec process_memory_virtual :: :"process.memory.virtual" + def process_memory_virtual do + :"process.memory.virtual" + end + + @doc """ + Network bytes transferred. + + Instrument: `counter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_network_io() + :"process.network.io" + + ### Erlang + + ```erlang + ?PROCESS_NETWORK_IO. + 'process.network.io' + ``` + + + """ + + @spec process_network_io :: :"process.network.io" + def process_network_io do + :"process.network.io" + end + + @doc """ + Number of file descriptors in use by the process. + + Instrument: `updowncounter` + Unit: `{count}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_openfiledescriptor_count() + :"process.open_file_descriptor.count" + + ### Erlang + + ```erlang + ?PROCESS_OPENFILEDESCRIPTOR_COUNT. + 'process.open_file_descriptor.count' + ``` + + + """ + + @spec process_openfiledescriptor_count :: :"process.open_file_descriptor.count" + def process_openfiledescriptor_count do + :"process.open_file_descriptor.count" + end + + @doc """ + Number of page faults the process has made. + + Instrument: `counter` + Unit: `{fault}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_paging_faults() + :"process.paging.faults" + + ### Erlang + + ```erlang + ?PROCESS_PAGING_FAULTS. + 'process.paging.faults' + ``` + + + """ + + @spec process_paging_faults :: :"process.paging.faults" + def process_paging_faults do + :"process.paging.faults" + end + + @doc """ + Process threads count. + + Instrument: `updowncounter` + Unit: `{thread}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.ProcessMetrics.process_thread_count() + :"process.thread.count" + + ### Erlang + + ```erlang + ?PROCESS_THREAD_COUNT. + 'process.thread.count' + ``` + + + """ + + @spec process_thread_count :: :"process.thread.count" + def process_thread_count do + :"process.thread.count" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/rpc_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/rpc_metrics.ex new file mode 100644 index 00000000..6d65e00e --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/rpc_metrics.ex @@ -0,0 +1,329 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for RPC metrics. + """ + @doc """ + Measures the duration of outbound RPC. + + Instrument: `histogram` + Unit: `ms` + ### Notes + + While streaming RPCs may record this metric as start-of-batch + to end-of-batch, it's hard to interpret in practice. + + **Streaming**: N/A. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_client_duration() + :"rpc.client.duration" + + ### Erlang + + ```erlang + ?RPC_CLIENT_DURATION. + 'rpc.client.duration' + ``` + + + """ + + @spec rpc_client_duration :: :"rpc.client.duration" + def rpc_client_duration do + :"rpc.client.duration" + end + + @doc """ + Measures the size of RPC request messages (uncompressed). + + Instrument: `histogram` + Unit: `By` + ### Notes + + **Streaming**: Recorded per message in a streaming batch + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_client_request_size() + :"rpc.client.request.size" + + ### Erlang + + ```erlang + ?RPC_CLIENT_REQUEST_SIZE. + 'rpc.client.request.size' + ``` + + + """ + + @spec rpc_client_request_size :: :"rpc.client.request.size" + def rpc_client_request_size do + :"rpc.client.request.size" + end + + @doc """ + Measures the number of messages received per RPC. + + Instrument: `histogram` + Unit: `{count}` + ### Notes + + Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_client_requestsperrpc() + :"rpc.client.requests_per_rpc" + + ### Erlang + + ```erlang + ?RPC_CLIENT_REQUESTSPERRPC. + 'rpc.client.requests_per_rpc' + ``` + + + """ + + @spec rpc_client_requestsperrpc :: :"rpc.client.requests_per_rpc" + def rpc_client_requestsperrpc do + :"rpc.client.requests_per_rpc" + end + + @doc """ + Measures the size of RPC response messages (uncompressed). + + Instrument: `histogram` + Unit: `By` + ### Notes + + **Streaming**: Recorded per response in a streaming batch + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_client_response_size() + :"rpc.client.response.size" + + ### Erlang + + ```erlang + ?RPC_CLIENT_RESPONSE_SIZE. + 'rpc.client.response.size' + ``` + + + """ + + @spec rpc_client_response_size :: :"rpc.client.response.size" + def rpc_client_response_size do + :"rpc.client.response.size" + end + + @doc """ + Measures the number of messages sent per RPC. + + Instrument: `histogram` + Unit: `{count}` + ### Notes + + Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_client_responsesperrpc() + :"rpc.client.responses_per_rpc" + + ### Erlang + + ```erlang + ?RPC_CLIENT_RESPONSESPERRPC. + 'rpc.client.responses_per_rpc' + ``` + + + """ + + @spec rpc_client_responsesperrpc :: :"rpc.client.responses_per_rpc" + def rpc_client_responsesperrpc do + :"rpc.client.responses_per_rpc" + end + + @doc """ + Measures the duration of inbound RPC. + + Instrument: `histogram` + Unit: `ms` + ### Notes + + While streaming RPCs may record this metric as start-of-batch + to end-of-batch, it's hard to interpret in practice. + + **Streaming**: N/A. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_server_duration() + :"rpc.server.duration" + + ### Erlang + + ```erlang + ?RPC_SERVER_DURATION. + 'rpc.server.duration' + ``` + + + """ + + @spec rpc_server_duration :: :"rpc.server.duration" + def rpc_server_duration do + :"rpc.server.duration" + end + + @doc """ + Measures the size of RPC request messages (uncompressed). + + Instrument: `histogram` + Unit: `By` + ### Notes + + **Streaming**: Recorded per message in a streaming batch + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_server_request_size() + :"rpc.server.request.size" + + ### Erlang + + ```erlang + ?RPC_SERVER_REQUEST_SIZE. + 'rpc.server.request.size' + ``` + + + """ + + @spec rpc_server_request_size :: :"rpc.server.request.size" + def rpc_server_request_size do + :"rpc.server.request.size" + end + + @doc """ + Measures the number of messages received per RPC. + + Instrument: `histogram` + Unit: `{count}` + ### Notes + + Should be 1 for all non-streaming RPCs. + + **Streaming** : This metric is required for server and client streaming RPCs + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_server_requestsperrpc() + :"rpc.server.requests_per_rpc" + + ### Erlang + + ```erlang + ?RPC_SERVER_REQUESTSPERRPC. + 'rpc.server.requests_per_rpc' + ``` + + + """ + + @spec rpc_server_requestsperrpc :: :"rpc.server.requests_per_rpc" + def rpc_server_requestsperrpc do + :"rpc.server.requests_per_rpc" + end + + @doc """ + Measures the size of RPC response messages (uncompressed). + + Instrument: `histogram` + Unit: `By` + ### Notes + + **Streaming**: Recorded per response in a streaming batch + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_server_response_size() + :"rpc.server.response.size" + + ### Erlang + + ```erlang + ?RPC_SERVER_RESPONSE_SIZE. + 'rpc.server.response.size' + ``` + + + """ + + @spec rpc_server_response_size :: :"rpc.server.response.size" + def rpc_server_response_size do + :"rpc.server.response.size" + end + + @doc """ + Measures the number of messages sent per RPC. + + Instrument: `histogram` + Unit: `{count}` + ### Notes + + Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.RpcMetrics.rpc_server_responsesperrpc() + :"rpc.server.responses_per_rpc" + + ### Erlang + + ```erlang + ?RPC_SERVER_RESPONSESPERRPC. + 'rpc.server.responses_per_rpc' + ``` + + + """ + + @spec rpc_server_responsesperrpc :: :"rpc.server.responses_per_rpc" + def rpc_server_responsesperrpc do + :"rpc.server.responses_per_rpc" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/system_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/system_metrics.ex new file mode 100644 index 00000000..72693fee --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/incubating/metrics/system_metrics.ex @@ -0,0 +1,815 @@ +defmodule OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for System metrics. + """ + @doc """ + Reports the current frequency of the CPU in Hz + + Instrument: `gauge` + Unit: `{Hz}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_cpu_frequency() + :"system.cpu.frequency" + + ### Erlang + + ```erlang + ?SYSTEM_CPU_FREQUENCY. + 'system.cpu.frequency' + ``` + + + """ + + @spec system_cpu_frequency :: :"system.cpu.frequency" + def system_cpu_frequency do + :"system.cpu.frequency" + end + + @doc """ + Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking + + Instrument: `updowncounter` + Unit: `{cpu}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_cpu_logical_count() + :"system.cpu.logical.count" + + ### Erlang + + ```erlang + ?SYSTEM_CPU_LOGICAL_COUNT. + 'system.cpu.logical.count' + ``` + + + """ + + @spec system_cpu_logical_count :: :"system.cpu.logical.count" + def system_cpu_logical_count do + :"system.cpu.logical.count" + end + + @doc """ + Reports the number of actual physical processor cores on the hardware + + Instrument: `updowncounter` + Unit: `{cpu}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_cpu_physical_count() + :"system.cpu.physical.count" + + ### Erlang + + ```erlang + ?SYSTEM_CPU_PHYSICAL_COUNT. + 'system.cpu.physical.count' + ``` + + + """ + + @spec system_cpu_physical_count :: :"system.cpu.physical.count" + def system_cpu_physical_count do + :"system.cpu.physical.count" + end + + @doc """ + Seconds each logical CPU spent on each mode + + Instrument: `counter` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_cpu_time() + :"system.cpu.time" + + ### Erlang + + ```erlang + ?SYSTEM_CPU_TIME. + 'system.cpu.time' + ``` + + + """ + + @spec system_cpu_time :: :"system.cpu.time" + def system_cpu_time do + :"system.cpu.time" + end + + @doc """ + Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs + + Instrument: `gauge` + Unit: `1` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_cpu_utilization() + :"system.cpu.utilization" + + ### Erlang + + ```erlang + ?SYSTEM_CPU_UTILIZATION. + 'system.cpu.utilization' + ``` + + + """ + + @spec system_cpu_utilization :: :"system.cpu.utilization" + def system_cpu_utilization do + :"system.cpu.utilization" + end + + @doc """ + none + + Instrument: `counter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_disk_io() + :"system.disk.io" + + ### Erlang + + ```erlang + ?SYSTEM_DISK_IO. + 'system.disk.io' + ``` + + + """ + + @spec system_disk_io :: :"system.disk.io" + def system_disk_io do + :"system.disk.io" + end + + @doc """ + Time disk spent activated + + Instrument: `counter` + Unit: `s` + ### Notes + + The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: + + - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + - Windows: The complement of + ["Disk\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained) + performance counter: `uptime * (100 - "Disk\% Idle Time") / 100` + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_disk_iotime() + :"system.disk.io_time" + + ### Erlang + + ```erlang + ?SYSTEM_DISK_IOTIME. + 'system.disk.io_time' + ``` + + + """ + + @spec system_disk_iotime :: :"system.disk.io_time" + def system_disk_iotime do + :"system.disk.io_time" + end + + @doc """ + none + + Instrument: `counter` + Unit: `{operation}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_disk_merged() + :"system.disk.merged" + + ### Erlang + + ```erlang + ?SYSTEM_DISK_MERGED. + 'system.disk.merged' + ``` + + + """ + + @spec system_disk_merged :: :"system.disk.merged" + def system_disk_merged do + :"system.disk.merged" + end + + @doc """ + Sum of the time each operation took to complete + + Instrument: `counter` + Unit: `s` + ### Notes + + Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: + + - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes) + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_disk_operationtime() + :"system.disk.operation_time" + + ### Erlang + + ```erlang + ?SYSTEM_DISK_OPERATIONTIME. + 'system.disk.operation_time' + ``` + + + """ + + @spec system_disk_operationtime :: :"system.disk.operation_time" + def system_disk_operationtime do + :"system.disk.operation_time" + end + + @doc """ + none + + Instrument: `counter` + Unit: `{operation}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_disk_operations() + :"system.disk.operations" + + ### Erlang + + ```erlang + ?SYSTEM_DISK_OPERATIONS. + 'system.disk.operations' + ``` + + + """ + + @spec system_disk_operations :: :"system.disk.operations" + def system_disk_operations do + :"system.disk.operations" + end + + @doc """ + none + + Instrument: `updowncounter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_filesystem_usage() + :"system.filesystem.usage" + + ### Erlang + + ```erlang + ?SYSTEM_FILESYSTEM_USAGE. + 'system.filesystem.usage' + ``` + + + """ + + @spec system_filesystem_usage :: :"system.filesystem.usage" + def system_filesystem_usage do + :"system.filesystem.usage" + end + + @doc """ + none + + Instrument: `gauge` + Unit: `1` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_filesystem_utilization() + :"system.filesystem.utilization" + + ### Erlang + + ```erlang + ?SYSTEM_FILESYSTEM_UTILIZATION. + 'system.filesystem.utilization' + ``` + + + """ + + @spec system_filesystem_utilization :: :"system.filesystem.utilization" + def system_filesystem_utilization do + :"system.filesystem.utilization" + end + + @doc """ + An estimate of how much memory is available for starting new applications, without causing swapping + + Instrument: `updowncounter` + Unit: `By` + ### Notes + + This is an alternative to `system.memory.usage` metric with `state=free`. + Linux starting from 3.14 exports "available" memory. It takes "free" memory as a baseline, and then factors in kernel-specific values. + This is supposed to be more accurate than just "free" memory. + For reference, see the calculations [here](https://superuser.com/a/980821). + See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_linux_memory_available() + :"system.linux.memory.available" + + ### Erlang + + ```erlang + ?SYSTEM_LINUX_MEMORY_AVAILABLE. + 'system.linux.memory.available' + ``` + + + """ + + @spec system_linux_memory_available :: :"system.linux.memory.available" + def system_linux_memory_available do + :"system.linux.memory.available" + end + + @doc """ + Total memory available in the system. + + Instrument: `updowncounter` + Unit: `By` + ### Notes + + Its value **SHOULD** equal the sum of `system.memory.state` over all states. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_memory_limit() + :"system.memory.limit" + + ### Erlang + + ```erlang + ?SYSTEM_MEMORY_LIMIT. + 'system.memory.limit' + ``` + + + """ + + @spec system_memory_limit :: :"system.memory.limit" + def system_memory_limit do + :"system.memory.limit" + end + + @doc """ + Shared memory used (mostly by tmpfs). + + Instrument: `updowncounter` + Unit: `By` + ### Notes + + Equivalent of `shared` from [`free` command](https://man7.org/linux/man-pages/man1/free.1.html) or + `Shmem` from [`/proc/meminfo`](https://man7.org/linux/man-pages/man5/proc.5.html)" + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_memory_shared() + :"system.memory.shared" + + ### Erlang + + ```erlang + ?SYSTEM_MEMORY_SHARED. + 'system.memory.shared' + ``` + + + """ + + @spec system_memory_shared :: :"system.memory.shared" + def system_memory_shared do + :"system.memory.shared" + end + + @doc """ + Reports memory in use by state. + + Instrument: `updowncounter` + Unit: `By` + ### Notes + + The sum over all `system.memory.state` values **SHOULD** equal the total memory + available on the system, that is `system.memory.limit`. + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_memory_usage() + :"system.memory.usage" + + ### Erlang + + ```erlang + ?SYSTEM_MEMORY_USAGE. + 'system.memory.usage' + ``` + + + """ + + @spec system_memory_usage :: :"system.memory.usage" + def system_memory_usage do + :"system.memory.usage" + end + + @doc """ + none + + Instrument: `gauge` + Unit: `1` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_memory_utilization() + :"system.memory.utilization" + + ### Erlang + + ```erlang + ?SYSTEM_MEMORY_UTILIZATION. + 'system.memory.utilization' + ``` + + + """ + + @spec system_memory_utilization :: :"system.memory.utilization" + def system_memory_utilization do + :"system.memory.utilization" + end + + @doc """ + none + + Instrument: `updowncounter` + Unit: `{connection}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_network_connections() + :"system.network.connections" + + ### Erlang + + ```erlang + ?SYSTEM_NETWORK_CONNECTIONS. + 'system.network.connections' + ``` + + + """ + + @spec system_network_connections :: :"system.network.connections" + def system_network_connections do + :"system.network.connections" + end + + @doc """ + Count of packets that are dropped or discarded even though there was no error + + Instrument: `counter` + Unit: `{packet}` + ### Notes + + Measured as: + + - Linux: the `drop` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)) + - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2) + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_network_dropped() + :"system.network.dropped" + + ### Erlang + + ```erlang + ?SYSTEM_NETWORK_DROPPED. + 'system.network.dropped' + ``` + + + """ + + @spec system_network_dropped :: :"system.network.dropped" + def system_network_dropped do + :"system.network.dropped" + end + + @doc """ + Count of network errors detected + + Instrument: `counter` + Unit: `{error}` + ### Notes + + Measured as: + + - Linux: the `errs` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)). + - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). + + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_network_errors() + :"system.network.errors" + + ### Erlang + + ```erlang + ?SYSTEM_NETWORK_ERRORS. + 'system.network.errors' + ``` + + + """ + + @spec system_network_errors :: :"system.network.errors" + def system_network_errors do + :"system.network.errors" + end + + @doc """ + none + + Instrument: `counter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_network_io() + :"system.network.io" + + ### Erlang + + ```erlang + ?SYSTEM_NETWORK_IO. + 'system.network.io' + ``` + + + """ + + @spec system_network_io :: :"system.network.io" + def system_network_io do + :"system.network.io" + end + + @doc """ + none + + Instrument: `counter` + Unit: `{packet}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_network_packets() + :"system.network.packets" + + ### Erlang + + ```erlang + ?SYSTEM_NETWORK_PACKETS. + 'system.network.packets' + ``` + + + """ + + @spec system_network_packets :: :"system.network.packets" + def system_network_packets do + :"system.network.packets" + end + + @doc """ + none + + Instrument: `counter` + Unit: `{fault}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_paging_faults() + :"system.paging.faults" + + ### Erlang + + ```erlang + ?SYSTEM_PAGING_FAULTS. + 'system.paging.faults' + ``` + + + """ + + @spec system_paging_faults :: :"system.paging.faults" + def system_paging_faults do + :"system.paging.faults" + end + + @doc """ + none + + Instrument: `counter` + Unit: `{operation}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_paging_operations() + :"system.paging.operations" + + ### Erlang + + ```erlang + ?SYSTEM_PAGING_OPERATIONS. + 'system.paging.operations' + ``` + + + """ + + @spec system_paging_operations :: :"system.paging.operations" + def system_paging_operations do + :"system.paging.operations" + end + + @doc """ + Unix swap or windows pagefile usage + + Instrument: `updowncounter` + Unit: `By` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_paging_usage() + :"system.paging.usage" + + ### Erlang + + ```erlang + ?SYSTEM_PAGING_USAGE. + 'system.paging.usage' + ``` + + + """ + + @spec system_paging_usage :: :"system.paging.usage" + def system_paging_usage do + :"system.paging.usage" + end + + @doc """ + none + + Instrument: `gauge` + Unit: `1` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_paging_utilization() + :"system.paging.utilization" + + ### Erlang + + ```erlang + ?SYSTEM_PAGING_UTILIZATION. + 'system.paging.utilization' + ``` + + + """ + + @spec system_paging_utilization :: :"system.paging.utilization" + def system_paging_utilization do + :"system.paging.utilization" + end + + @doc """ + Total number of processes in each state + + Instrument: `updowncounter` + Unit: `{process}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_process_count() + :"system.process.count" + + ### Erlang + + ```erlang + ?SYSTEM_PROCESS_COUNT. + 'system.process.count' + ``` + + + """ + + @spec system_process_count :: :"system.process.count" + def system_process_count do + :"system.process.count" + end + + @doc """ + Total number of processes created over uptime of the host + + Instrument: `counter` + Unit: `{process}` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Incubating.Metrics.SystemMetrics.system_process_created() + :"system.process.created" + + ### Erlang + + ```erlang + ?SYSTEM_PROCESS_CREATED. + 'system.process.created' + ``` + + + """ + + @spec system_process_created :: :"system.process.created" + def system_process_created do + :"system.process.created" + end +end diff --git a/apps/opentelemetry_semantic_conventions/lib/metrics/http_metrics.ex b/apps/opentelemetry_semantic_conventions/lib/metrics/http_metrics.ex new file mode 100644 index 00000000..bdb66804 --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/lib/metrics/http_metrics.ex @@ -0,0 +1,59 @@ +defmodule OpenTelemetry.SemConv.Metrics.HttpMetrics do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for HTTP metrics. + """ + @doc """ + Duration of HTTP client requests. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Metrics.HttpMetrics.http_client_request_duration() + :"http.client.request.duration" + + ### Erlang + + ```erlang + ?HTTP_CLIENT_REQUEST_DURATION. + 'http.client.request.duration' + ``` + + + """ + + @spec http_client_request_duration :: :"http.client.request.duration" + def http_client_request_duration do + :"http.client.request.duration" + end + + @doc """ + Duration of HTTP server requests. + + Instrument: `histogram` + Unit: `s` + + + ### Elixir + + iex> OpenTelemetry.SemConv.Metrics.HttpMetrics.http_server_request_duration() + :"http.server.request.duration" + + ### Erlang + + ```erlang + ?HTTP_SERVER_REQUEST_DURATION. + 'http.server.request.duration' + ``` + + + """ + + @spec http_server_request_duration :: :"http.server.request.duration" + def http_server_request_duration do + :"http.server.request.duration" + end +end diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/common.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/common.j2 new file mode 100644 index 00000000..8fe2a6db --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/common.j2 @@ -0,0 +1,74 @@ +{%- macro acronyms() -%} +["http", "url", "tls", "rpc", "os", "oci", "gcp", "faas", "dns", "db", "aws"] +{%- endmacro -%} + +{%- macro func_name(text) -%} + {{ text | snake_case_const }} +{%- endmacro -%} + +{%- macro to_atom(text) -%} +{% if text | split_id | length > 1 -%}:"{{ text }}"{%- else -%}:{{ text }}{%- endif %} +{%- endmacro -%} + +{% macro to_elixir_type(member) -%} + {%- if member.id == member.value -%} + {{ to_atom(member.value) }} + {%- else -%} + {{ member }} + {{ member.type | type_mapping }} + {%- endif -%} +{%- endmacro %} + +{%- macro enum_value_to_elixir_type(value) -%} + {%- if value is string %}{{ to_atom(value) }}{% else -%}{{ value }}{%- endif %} +{%- endmacro -%} + +{%- macro enum_value_return_type(value) -%} + {%- if value is string -%} + atom() | String.t() + {%- elif value is integer -%} + integer() + {%- else -%} + NOT_MAPPED + {%- endif -%} +{%- endmacro -%} + +{%- macro enum_value_return_type_example(value) -%} + {%- if value is string -%} + :custom_value + {%- elif value is integer -%} + 27 + {%- else -%} + NOT_MAPPED + {%- endif -%} +{%- endmacro -%} + +{%- macro erlang_enum_value_return_type_example(value) -%} + {%- if value is string -%} + custom_value + {%- elif value is integer -%} + 27 + {%- else -%} + NOT_MAPPED + {%- endif -%} +{%- endmacro -%} + +{%- macro enum_to_map(members) -%} + {% raw %}%{{% endraw %} + {% for member in members %} + {{ to_atom(member.id) }} => {{ enum_value_to_elixir_type(member.value) }}{% if not loop.last %},{% endif %} + {% endfor %} + {% raw %}}{% endraw %} +{%- endmacro -%} + +{%- macro strong_reqs(string) -%} + {{ string | replace(" MUST ", " **MUST** ") | replace(" MUST NOT ", " **MUST NOT** ") | replace(" SHOULD ", " **SHOULD** ") | replace(" SHOULD NOT ", " **SHOULD NOT** ") | replace(" MAY ", " **MAY** ") | replace(" NOT ", " **NOT** ") }} +{%- endmacro -%} + +{%- macro format_acronym(value, acronyms) -%} + {%- if value | lower in acronyms -%} + {{ value | upper }} + {%- else -%} + {{ value }} + {%- endif -%} +{%- endmacro -%} \ No newline at end of file diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 index d05da2c8..05537652 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 +++ b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 @@ -1,76 +1,15 @@ {#- waiting on https://github.com/open-telemetry/weaver/pull/207 for split to be available -#} {# {{ text | snake_case_const | replace('_', ' ') | split | reject(ctx.id) | join('_') }} #} -{%- set acronyms = ["http", "url", "tls", "rpc", "os", "oci", "gcp", "faas", "dns", "db", "aws"] %} -{%- macro func_name(text) -%} - {{ text | snake_case_const }} -{%- endmacro -%} -{%- macro to_atom(text) -%} -{% if text | split_id | length > 1 -%}:"{{ text }}"{%- else -%}:{{ text }}{%- endif %} -{%- endmacro -%} -{% macro to_elixir_type(member) -%} - {%- if member.id == member.value -%} - {{ to_atom(member.value) }} - {%- else -%} - {{ member }} - {{ member.type | type_mapping }} - {%- endif -%} -{%- endmacro %} -{%- macro enum_value_to_elixir_type(value) -%} - {%- if value is string %}{{ to_atom(value) }}{% else -%}{{ value }}{%- endif %} -{%- endmacro -%} -{%- macro enum_value_return_type(value) -%} - {%- if value is string -%} - atom() | String.t() - {%- elif value is integer -%} - integer() - {%- else -%} - NOT_MAPPED - {%- endif -%} -{%- endmacro -%} -{%- macro enum_value_return_type_example(value) -%} - {%- if value is string -%} - :custom_value - {%- elif value is integer -%} - 27 - {%- else -%} - NOT_MAPPED - {%- endif -%} -{%- endmacro -%} -{%- macro erlang_enum_value_return_type_example(value) -%} - {%- if value is string -%} - custom_value - {%- elif value is integer -%} - 27 - {%- else -%} - NOT_MAPPED - {%- endif -%} -{%- endmacro -%} -{%- macro enum_to_map(members) -%} - {% raw %}%{{% endraw %} - {% for member in members %} - {{ to_atom(member.id) }} => {{ enum_value_to_elixir_type(member.value) }}{% if not loop.last %},{% endif %} - {% endfor %} - {% raw %}}{% endraw %} -{%- endmacro -%} -{%- macro strong_reqs(string) -%} - {{ string | replace(" MUST ", " **MUST** ") | replace(" MUST NOT ", " **MUST NOT** ") | replace(" SHOULD ", " **SHOULD** ") | replace(" SHOULD NOT ", " **SHOULD NOT** ") | replace(" MAY ", " **MAY** ") | replace(" NOT ", " **NOT** ") }} -{%- endmacro -%} -{%- macro format_acronym(value) -%} - {%- if value | lower in acronyms -%} - {{ value | upper }} - {%- else -%} - {{ value }} - {%- endif -%} -{%- endmacro -%} -{%- set file_name = ctx.id | snake_case ~ "_attributes.ex" -%} +{%- import 'common.j2' as c %} +{%- set acronyms = c.acronyms() -%} + +{%- set file_name = ctx.output + ctx.id | snake_case ~ "_attributes.ex" -%} {%- set module_name = (ctx.id | pascal_case) -%} -{%- set trim_blocks = true %} -{%- set trim_lstrip_blocks = true %} {{ template.set_file_name(file_name) }} -{%- set module_name = format_acronym(ctx.id | pascal_case) ~ "Attributes" -%} +{%- set module_name = c.format_acronym(ctx.id | pascal_case, acronyms) ~ "Attributes" -%} {%- if params.stability == "experimental" -%} {%- set module_namespace = "OpenTelemetry.SemConv.Incubating" -%} {%- else -%} @@ -79,20 +18,20 @@ defmodule {{ module_namespace }}.{{ module_name }} do # This is an auto-generated file @moduledoc """ - OpenTelemetry Semantic Conventions for {{ format_acronym(ctx.id | title) }} attributes. + OpenTelemetry Semantic Conventions for {{ c.format_acronym(ctx.id | title, acronyms) }} attributes. """ {%- for attribute in ctx.attributes | sort(attribute="name") %} {% if attribute.type is mapping %} @typedoc """ - {{ strong_reqs(attribute.brief) }} + {{ c.strong_reqs(attribute.brief) }} ### Enum Values {% for member in attribute.type.members -%} - * `{{ to_atom(member.id) }}` + * `{{ c.to_atom(member.id) }}` {%- if member is experimental %} ^[e](`m:OpenTelemetry.SemConv#experimental`)^{% endif %}{% if member.brief != none %} - {% if member is deprecated %}**deprecated** ~~{% endif %}{{ member.brief }}{% if member is deprecated %}~~{% endif %}{% endif %} {% endfor -%} """ - @type {{ attribute.name | snake_case_const }}() :: {{ enum_to_map(attribute.type.members) }} + @type {{ attribute.name | snake_case_const }}() :: {{ c.enum_to_map(attribute.type.members) }} {%- endif -%} {% if attribute is deprecated %} @@ -102,7 +41,7 @@ defmodule {{ module_namespace }}.{{ module_name }} do {%- endif -%} {% if not(attribute is deprecated) %} @doc """ - {{ strong_reqs(attribute.brief | replace("\n", "\n ")) }} + {{ c.strong_reqs(attribute.brief | replace("\n", "\n ")) }} {% if (attribute.type is simple_type) or (attribute.type is template_type) -%} ### Value type @@ -111,7 +50,7 @@ defmodule {{ module_namespace }}.{{ module_name }} do {%- if attribute.note %} ### Notes - {{ strong_reqs(attribute.note | replace("\n", "\n ")) }} + {{ c.strong_reqs(attribute.note | replace("\n", "\n ")) }} {%- endif %} {%- if attribute.examples %} ### Examples @@ -127,11 +66,11 @@ defmodule {{ module_namespace }}.{{ module_name }} do ### Elixir - iex> {{ module_namespace }}.{{ module_name }}.{{ func_name(attribute.name) }}().{{ attribute.type.members|first|attr('id') }} - {{ enum_value_to_elixir_type(attribute.type.members|first|attr('value')) }} + iex> {{ module_namespace }}.{{ module_name }}.{{ c.func_name(attribute.name) }}().{{ attribute.type.members|first|attr('id') }} + {{ c.enum_value_to_elixir_type(attribute.type.members|first|attr('value')) }} - iex> {{ module_namespace }}.{{ module_name }}.{{ func_name(attribute.name) }}({{ enum_value_return_type_example(attribute.type.members|first|attr('value')) }}) - {{ enum_value_return_type_example(attribute.type.members|first|attr('value')) }} + iex> {{ module_namespace }}.{{ module_name }}.{{ c.func_name(attribute.name) }}({{ c.enum_value_return_type_example(attribute.type.members|first|attr('value')) }}) + {{ c.enum_value_return_type_example(attribute.type.members|first|attr('value')) }} ### Erlang @@ -139,15 +78,15 @@ defmodule {{ module_namespace }}.{{ module_name }} do ?'{{ attribute.name | snake_case_const }}.{{ attribute.type.members|first|attr('id') }}'. {{ attribute.type.members|first|attr('value') }} - ?{{ attribute.name | snake_case_const }}({{ erlang_enum_value_return_type_example(attribute.type.members|first|attr('value')) }}). - {{ erlang_enum_value_return_type_example(attribute.type.members|first|attr('value')) }} + ?{{ attribute.name | snake_case_const }}({{ c.erlang_enum_value_return_type_example(attribute.type.members|first|attr('value')) }}). + {{ c.erlang_enum_value_return_type_example(attribute.type.members|first|attr('value')) }} ``` {%- else %} ### Elixir - iex> {{ module_namespace }}.{{ module_name }}.{{ func_name(attribute.name) }}() - {{ to_atom(attribute.name) }} + iex> {{ module_namespace }}.{{ module_name }}.{{ c.func_name(attribute.name) }}() + {{ c.to_atom(attribute.name) }} ### Erlang @@ -162,18 +101,18 @@ defmodule {{ module_namespace }}.{{ module_name }} do {%- endif %} {%- if not(attribute.type is mapping) %} - @spec {{ func_name(attribute.name) }} :: {{ to_atom(attribute.name) }} - def {{ func_name(attribute.name) }} do - {{ to_atom(attribute.name) }} + @spec {{ c.func_name(attribute.name) }} :: {{ c.to_atom(attribute.name) }} + def {{ c.func_name(attribute.name) }} do + {{ c.to_atom(attribute.name) }} end {%- else %} - @spec {{ func_name(attribute.name) }}() :: {{ attribute.name | snake_case_const }}() - def {{ func_name(attribute.name) }}() do - {{ enum_to_map(attribute.type.members) }} + @spec {{ c.func_name(attribute.name) }}() :: {{ attribute.name | snake_case_const }}() + def {{ c.func_name(attribute.name) }}() do + {{ c.enum_to_map(attribute.type.members) }} end - @spec {{ func_name(attribute.name) }}({{ enum_value_return_type(attribute.type.members|first|attr('value')) }}) :: {{ enum_value_return_type(attribute.type.members|first|attr('value')) }} - def {{ func_name(attribute.name) }}(custom_value) do + @spec {{ c.func_name(attribute.name) }}({{ c.enum_value_return_type(attribute.type.members|first|attr('value')) }}) :: {{ c.enum_value_return_type(attribute.type.members|first|attr('value')) }} + def {{ c.func_name(attribute.name) }}(custom_value) do custom_value end {%- endif %} diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 new file mode 100644 index 00000000..1b3b85db --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 @@ -0,0 +1,64 @@ +{#- waiting on https://github.com/open-telemetry/weaver/pull/207 for split to be available -#} + + {# {{ text | snake_case_const | replace('_', ' ') | split | reject(ctx.id) | join('_') }} #} + +{%- import 'common.j2' as c %} +{%- set acronyms = c.acronyms() -%} +{%- set file_name = ctx.output ~ ctx.id | snake_case ~ "_metrics.ex" -%} +{%- set module_name = c.format_acronym(ctx.id | pascal_case, acronyms) ~ "Metrics" -%} +{%- set trim_blocks = true %} +{%- set trim_lstrip_blocks = true %} +{{ template.set_file_name(file_name) }} + +{%- set module_name = c.format_acronym(ctx.id | pascal_case) ~ "Metrics" -%} +{%- if params.stability == "experimental" -%} +{%- set module_namespace = "OpenTelemetry.SemConv.Incubating.Metrics" -%} +{%- else -%} +{%- set module_namespace = "OpenTelemetry.SemConv.Metrics" -%} +{%- endif -%} +defmodule {{ module_namespace }}.{{ module_name }} do + # This is an auto-generated file + @moduledoc """ + OpenTelemetry Semantic Conventions for {{ c.format_acronym(ctx.id | title, acronyms) }} metrics. + """ +{%- for metric in ctx.metrics | sort(attribute="metric_name") %} + {% if metric is deprecated %} + @deprecated """ + {{ metric.deprecated | replace("\n", "\n ") }} + """ + {%- else -%} + @doc """ + {{ c.strong_reqs(metric.brief | replace("\n", "\n ")) }} + + Instrument: `{{ metric.instrument }}` + Unit: `{{ metric.unit }}` + + {%- if metric.note %} + ### Notes + + {{ c.strong_reqs(metric.note | replace("\n", "\n ")) }} + {%- endif %} + + + ### Elixir + + iex> {{ module_namespace }}.{{ module_name }}.{{ c.func_name(metric.metric_name) }}() + {{ c.to_atom(metric.metric_name) }} + + ### Erlang + + ```erlang + ?{{ metric.metric_name | snake_case_const | upper }}. + '{{ metric.metric_name }}' + ``` + + + """ + {%- endif %} + + @spec {{ c.func_name(metric.metric_name) }} :: {{ c.to_atom(metric.metric_name) }} + def {{ c.func_name(metric.metric_name) }} do + {{ c.to_atom(metric.metric_name) }} + end +{% endfor %} +end \ No newline at end of file diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml index 168f62ac..14c99fc9 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml +++ b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml @@ -1,21 +1,39 @@ params: stability: "stable" + excluded: ["android", "aspnetcore", "dotnet", "go", "ios", "jvm", "kestrel", "nodejs", "signalr", "v8js"] templates: - pattern: semantic_attributes.ex.j2 filter: > - ["ios", "android", "dotnet", "aspnetcore", "signalr", "jvm"] as $excluded | .groups | map(select(.type == "attribute_group")) | map(select(.id | startswith("registry."))) | map({ id: .id, group_id: .id | split(".") | .[1], attributes: .attributes}) | map(select([.attributes[] | select(.stability == $stability)] | any)) | group_by(.group_id) - | map({ id: .[0].group_id, attributes: [.[].attributes[] | select(.stability == $stability)] | sort_by(.id) }) + | map({ + id: .[0].group_id, + attributes: [.[].attributes[] | select(.stability == $stability)] | sort_by(.id), + output: $output + }) | map(select( .id as $id | any( $excluded[]; . == $id) | not )) | map(select(.attributes | length > 0)) application_mode: each - + - pattern: semantic_metrics.ex.j2 + filter: > + .groups + | map(select(.type == "metric")) + | map(select(.stability == $stability)) + | map({ id: .id, group_id: .id | split(".") | .[1], brief, unit, stability, deprecated, instrument, metric_name, note}) + | group_by(.group_id) + | map({ + id: .[0].group_id, + metrics: . | sort_by(.metric_name), + output: $output + "/metrics/" + }) + | map(select( .id as $id | any( $excluded[]; . == $id) | not )) + | map(select(.metrics | length > 0)) + application_mode: each text_maps: elixir_types: "int": "integer()" diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 index f3153545..5896055b 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 +++ b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 @@ -1,5 +1,20 @@ -{%- set file_name = ctx.id | snake_case ~ "_attributes.hrl" -%} +{%- set file_name = ctx.output + ctx.id | snake_case ~ "_attributes.hrl" -%} {{ template.set_file_name(file_name) }} +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + {%- for attribute in ctx.attributes | sort(attribute="name") %} {% if attribute is deprecated -%} %% @deprecated {{ attribute.deprecated | replace("\n", "\n%% ") }} diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_metrics.hrl.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_metrics.hrl.j2 new file mode 100644 index 00000000..f37188fe --- /dev/null +++ b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_metrics.hrl.j2 @@ -0,0 +1,24 @@ +{%- set file_name = ctx.output + ctx.id | snake_case ~ "_metrics.hrl" -%} +{{ template.set_file_name(file_name) }} +%%%------------------------------------------------------------------------ +%% 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. +%%%------------------------------------------------------------------------- + +{%- for metric in ctx.metrics | sort(attribute="metric_name") %} +{% if metric is deprecated -%} +%% @deprecated {{ metric.deprecated | replace("\n", "\n%% ") }} +{%- endif %} +%% {{ metric.brief | replace("\n", "\n%% ") }} +-define({{ metric.metric_name | snake_case_const | upper }}, '{{ metric.metric_name }}'). +{% endfor %} diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml index 0f8c6f88..b108bc57 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml +++ b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml @@ -1,20 +1,39 @@ params: stability: "stable" + excluded: ["android", "aspnetcore", "dotnet", "go", "ios", "jvm", "kestrel", "nodejs", "signalr", "v8js"] templates: - pattern: semantic_attributes.hrl.j2 filter: > - ["ios", "android", "dotnet", "aspnetcore", "signalr", "jvm"] as $excluded | .groups | map(select(.type == "attribute_group")) | map(select(.id | startswith("registry."))) | map({ id: .id, group_id: .id | split(".") | .[1], attributes: .attributes}) | map(select([.attributes[] | select(.stability == $stability)] | any)) | group_by(.group_id) - | map({ id: .[0].group_id, attributes: [.[].attributes[] | select(.stability == $stability)] | sort_by(.id) }) + | map({ + id: .[0].group_id, + attributes: [.[].attributes[] | select(.stability == $stability)] | sort_by(.id), + output: $output + }) | map(select( .id as $id | any( $excluded[]; . == $id) | not )) | map(select(.attributes | length > 0)) application_mode: each + - pattern: semantic_metrics.hrl.j2 + filter: > + .groups + | map(select(.type == "metric")) + | map(select(.stability == $stability)) + | map({ id: .id, group_id: .id | split(".") | .[1], brief, unit, stability, deprecated, instrument, metric_name, note}) + | group_by(.group_id) + | map({ + id: .[0].group_id, + metrics: . | sort_by(.metric_name), + output: $output + "/metrics/" + }) + | map(select( .id as $id | any( $excluded[]; . == $id) | not )) + | map(select(.metrics | length > 0)) + application_mode: each text_maps: erlang_types: