Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

semconv-metrics: deprecate stable metrics in the experimental package #772

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
{%- endif -%}
{%- endmacro -%}

{%- macro stableRef(metric) -%}
org.typelevel.otel4s.semconv.metrics.{{ ctx.root_namespace | pascal_case }}Metrics.{{ metric.metric_name[ctx.root_namespace | length:] | pascal_case }}
{%- endmacro -%}

{%- set object_name = ctx.root_namespace | pascal_case ~ params.object_prefix ~ "Metrics" -%}

/*
Expand Down Expand Up @@ -112,6 +116,8 @@ object {{ object_name }} {
{{ [metric.brief | replace('$', "$$"), concat_if("\n\n@note\n\n", metric.note)] | comment(indent=2) }}
{%- if metric is deprecated %}
@deprecated("{{ metric.deprecated }}", "")
{%- elif params.experimental == true and metric is stable %}
@deprecated("Use stable `{{ stableRef(metric) }}` instead.", "")
{%- endif %}
object {{ metric.metric_name[ctx.root_namespace | length:] | pascal_case }} {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ object HttpExperimentalMetrics {

/** Duration of HTTP client requests.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.HttpMetrics.ClientRequestDuration` instead.", "")
object ClientRequestDuration {

val Name = "http.client.request.duration"
Expand Down Expand Up @@ -1314,6 +1315,7 @@ object HttpExperimentalMetrics {

/** Duration of HTTP server requests.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.HttpMetrics.ServerRequestDuration` instead.", "")
object ServerRequestDuration {

val Name = "http.server.request.duration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ object JvmExperimentalMetrics {

/** Number of classes currently loaded.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.ClassCount` instead.", "")
object ClassCount {

val Name = "jvm.class.count"
Expand All @@ -210,6 +211,7 @@ object JvmExperimentalMetrics {

/** Number of classes loaded since JVM start.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.ClassLoaded` instead.", "")
object ClassLoaded {

val Name = "jvm.class.loaded"
Expand All @@ -227,6 +229,7 @@ object JvmExperimentalMetrics {

/** Number of classes unloaded since JVM start.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.ClassUnloaded` instead.", "")
object ClassUnloaded {

val Name = "jvm.class.unloaded"
Expand All @@ -244,6 +247,7 @@ object JvmExperimentalMetrics {

/** Number of processors available to the Java virtual machine.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.CpuCount` instead.", "")
object CpuCount {

val Name = "jvm.cpu.count"
Expand All @@ -265,6 +269,7 @@ object JvmExperimentalMetrics {
* measurement (unlike `system.cpu.utilization`). <a
* href="https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()">Reference</a>.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.CpuRecentUtilization` instead.", "")
object CpuRecentUtilization {

val Name = "jvm.cpu.recent_utilization"
Expand All @@ -282,6 +287,7 @@ object JvmExperimentalMetrics {

/** CPU time used by the process as reported by the JVM.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.CpuTime` instead.", "")
object CpuTime {

val Name = "jvm.cpu.time"
Expand All @@ -299,6 +305,7 @@ object JvmExperimentalMetrics {

/** Duration of JVM garbage collection actions.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.GcDuration` instead.", "")
object GcDuration {

val Name = "jvm.gc.duration"
Expand Down Expand Up @@ -358,6 +365,7 @@ object JvmExperimentalMetrics {

/** Measure of memory committed.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.MemoryCommitted` instead.", "")
object MemoryCommitted {

val Name = "jvm.memory.committed"
Expand Down Expand Up @@ -470,6 +478,7 @@ object JvmExperimentalMetrics {

/** Measure of max obtainable memory.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.MemoryLimit` instead.", "")
object MemoryLimit {

val Name = "jvm.memory.limit"
Expand Down Expand Up @@ -526,6 +535,7 @@ object JvmExperimentalMetrics {

/** Measure of memory used.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.MemoryUsed` instead.", "")
object MemoryUsed {

val Name = "jvm.memory.used"
Expand Down Expand Up @@ -582,6 +592,7 @@ object JvmExperimentalMetrics {

/** Measure of memory used, as measured after the most recent garbage collection event on this pool.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.MemoryUsedAfterLastGc` instead.", "")
object MemoryUsedAfterLastGc {

val Name = "jvm.memory.used_after_last_gc"
Expand Down Expand Up @@ -681,6 +692,7 @@ object JvmExperimentalMetrics {

/** Number of executing platform threads.
*/
@deprecated("Use stable `org.typelevel.otel4s.semconv.metrics.JvmMetrics.ThreadCount` instead.", "")
object ThreadCount {

val Name = "jvm.thread.count"
Expand Down
Loading