Align runtime metric and resource namespaces (#2112)

A 'process.runtime' namespace is currently defined in the resource
semantic conventions. The metric semantic conventions suggest that
runtime metrics use a 'runtime' namespace. Since the runtime metrics
are directly related to the runtime resources, they ought to share a
common namespace.

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
This commit is contained in:
Daniel Jaglowski 2021-11-18 09:36:45 -05:00 committed by GitHub
parent 76b14b16c2
commit 99fcd04b06
2 changed files with 11 additions and 6 deletions

View File

@ -62,8 +62,8 @@ where similar metrics have significantly different implementations across the
breadth of all existing metrics. For example, every garbage collected runtime breadth of all existing metrics. For example, every garbage collected runtime
has slightly different strategies and measures. Using a single set of metric has slightly different strategies and measures. Using a single set of metric
names for GC, not divided by the runtime, could create dissimilar comparisons names for GC, not divided by the runtime, could create dissimilar comparisons
and confusion for end users. (For example, prefer `runtime.java.gc*` over and confusion for end users. (For example, prefer `process.runtime.java.gc*` over
`runtime.gc.*`.) Measures of many operating system metrics are similarly `process.runtime.gc.*`.) Measures of many operating system metrics are similarly
ambiguous. ambiguous.
### Units ### Units

View File

@ -13,7 +13,8 @@ semantic conventions when instrumenting runtime environments.
<!-- toc --> <!-- toc -->
- [Metric Instruments](#metric-instruments) - [Metric Instruments](#metric-instruments)
* [Runtime Environment Specific Metrics - `runtime.{environment}.`](#runtime-environment-specific-metrics---runtimeenvironment) * [Runtime Environment Specific Metrics - `process.runtime.{environment}.`](#runtime-environment-specific-metrics---processruntimeenvironment)
- [Attributes](#attributes)
<!-- tocstop --> <!-- tocstop -->
@ -27,10 +28,10 @@ does not propose any standard top-level runtime metric instruments. See [OTEP
108](https://github.com/open-telemetry/oteps/pull/108/files) for additional 108](https://github.com/open-telemetry/oteps/pull/108/files) for additional
discussion. discussion.
### Runtime Environment Specific Metrics - `runtime.{environment}.` ### Runtime Environment Specific Metrics - `process.runtime.{environment}.`
Metrics specific to a certain runtime environment should be prefixed with Metrics specific to a certain runtime environment should be prefixed with
`runtime.{environment}.` and follow the semantic conventions outlined in `process.runtime.{environment}.` and follow the semantic conventions outlined in
[general metric semantic [general metric semantic
conventions](README.md#general-metric-semantic-conventions). Authors of conventions](README.md#general-metric-semantic-conventions). Authors of
runtime instrumentations are responsible for the choice of `{environment}` to runtime instrumentations are responsible for the choice of `{environment}` to
@ -40,7 +41,11 @@ For example, some programming languages have multiple runtime environments
that vary significantly in their implementation, like [Python which has many that vary significantly in their implementation, like [Python which has many
implementations](https://wiki.python.org/moin/PythonImplementations). For implementations](https://wiki.python.org/moin/PythonImplementations). For
such languages, consider using specific `{environment}` prefixes to avoid such languages, consider using specific `{environment}` prefixes to avoid
ambiguity, like `runtime.cpython.` and `runtime.pypy.`. ambiguity, like `process.runtime.cpython.` and `process.runtime.pypy.`.
There are other dimensions even within a given runtime environment to There are other dimensions even within a given runtime environment to
consider, for example pthreads vs green thread implementations. consider, for example pthreads vs green thread implementations.
## Attributes
[`process.runtime`](../../resource/semantic_conventions/process.md#process-runtimes) resource attributes SHOULD be included on runtime metric events as appropriate.