Skip to content

Commit

Permalink
[SEMANTIC CONVENTION] Deprecated semconv (in the spec) not deprecated…
Browse files Browse the repository at this point in the history
… (in C++) (#2285)
  • Loading branch information
marcalff authored Sep 2, 2023
1 parent f52ec6c commit 01e6581
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 4 deletions.
64 changes: 64 additions & 0 deletions api/include/opentelemetry/trace/semantic_conventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#pragma once

#include "opentelemetry/common/macros.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
Expand Down Expand Up @@ -55,105 +56,168 @@ static constexpr const char *kClientSocketPort = "client.socket.port";

/**
* Deprecated, use {@code http.request.method} instead.
*
* @deprecated Deprecated, use `http.request.method` instead.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kHttpMethod = "http.method";

/**
* Deprecated, use {@code http.response.status_code} instead.
*
* @deprecated Deprecated, use `http.response.status_code` instead.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kHttpStatusCode = "http.status_code";

/**
* Deprecated, use {@code url.scheme} instead.
*
* @deprecated Deprecated, use `url.scheme` instead.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kHttpScheme = "http.scheme";

/**
* Deprecated, use {@code url.full} instead.
*
* @deprecated Deprecated, use `url.full` instead.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kHttpUrl = "http.url";

/**
* Deprecated, use {@code url.path} and {@code url.query} instead.
*
* @deprecated Deprecated, use `url.path` and `url.query` instead.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kHttpTarget = "http.target";

/**
* Deprecated, use {@code http.request.body.size} instead.
*
* @deprecated Deprecated, use `http.request.body.size` instead.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kHttpRequestContentLength = "http.request_content_length";

/**
* Deprecated, use {@code http.response.body.size} instead.
*
* @deprecated Deprecated, use `http.response.body.size` instead.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kHttpResponseContentLength = "http.response_content_length";

/**
* Deprecated, use {@code server.socket.domain} on client spans.
*
* @deprecated Deprecated, use `server.socket.domain` on client spans.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetSockPeerName = "net.sock.peer.name";

/**
* Deprecated, use {@code server.socket.address} on client spans and {@code client.socket.address}
* on server spans.
*
* @deprecated Deprecated, use `server.socket.address` on client spans and `client.socket.address`
* on server spans.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr";

/**
* Deprecated, use {@code server.socket.port} on client spans and {@code client.socket.port} on
* server spans.
*
* @deprecated Deprecated, use `server.socket.port` on client spans and `client.socket.port` on
* server spans.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetSockPeerPort = "net.sock.peer.port";

/**
* Deprecated, use {@code server.address} on client spans and {@code client.address} on server
* spans.
*
* @deprecated Deprecated, use `server.address` on client spans and `client.address` on server
* spans.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetPeerName = "net.peer.name";

/**
* Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans.
*
* @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetPeerPort = "net.peer.port";

/**
* Deprecated, use {@code server.address}.
*
* @deprecated Deprecated, use `server.address`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetHostName = "net.host.name";

/**
* Deprecated, use {@code server.port}.
*
* @deprecated Deprecated, use `server.port`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetHostPort = "net.host.port";

/**
* Deprecated, use {@code server.socket.address}.
*
* @deprecated Deprecated, use `server.socket.address`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetSockHostAddr = "net.sock.host.addr";

/**
* Deprecated, use {@code server.socket.port}.
*
* @deprecated Deprecated, use `server.socket.port`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetSockHostPort = "net.sock.host.port";

/**
* Deprecated, use {@code network.transport}.
*
* @deprecated Deprecated, use `network.transport`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetTransport = "net.transport";

/**
* Deprecated, use {@code network.protocol.name}.
*
* @deprecated Deprecated, use `network.protocol.name`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetProtocolName = "net.protocol.name";

/**
* Deprecated, use {@code network.protocol.version}.
*
* @deprecated Deprecated, use `network.protocol.version`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetProtocolVersion = "net.protocol.version";

/**
* Deprecated, use {@code network.transport} and {@code network.type}.
*
* @deprecated Deprecated, use `network.transport` and `network.type`.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kNetSockFamily = "net.sock.family";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#pragma once

#include "opentelemetry/common/macros.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
Expand All @@ -59,13 +60,13 @@ static constexpr const char *kSchemaUrl = "{{schemaUrl}}";
* <p>Notes:
<ul> {{attribute.note | render_markdown(code="{{@code {0}}}", paragraph="<li>{0}</li>", list="{0}")}} </ul>
{%- endif %}
{%- if attribute.deprecated %}
{%- if (attribute.stability | string()) == "StabilityLevel.DEPRECATED" %}
*
* @deprecated {{attribute.deprecated | to_doc_brief}}.
* @deprecated {{attribute.brief | to_doc_brief}}.
{%- endif %}
*/
{%- if attribute.deprecated %}
@Deprecated
{%- if (attribute.stability | string()) == "StabilityLevel.DEPRECATED" %}
OPENTELEMETRY_DEPRECATED
{%- endif %}
static constexpr const char *k{{attribute.fqn | to_camelcase(True)}} = "{{attribute.fqn}}";
{%- endfor %}
Expand Down
7 changes: 7 additions & 0 deletions sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#pragma once

#include "opentelemetry/common/macros.h"
#include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
Expand Down Expand Up @@ -794,12 +795,18 @@ static constexpr const char *kOtelScopeVersion = "otel.scope.version";

/**
* Deprecated, use the {@code otel.scope.name} attribute.
*
* @deprecated Deprecated, use the `otel.scope.name` attribute.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kOtelLibraryName = "otel.library.name";

/**
* Deprecated, use the {@code otel.scope.version} attribute.
*
* @deprecated Deprecated, use the `otel.scope.version` attribute.
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kOtelLibraryVersion = "otel.library.version";

// Enum definitions
Expand Down

1 comment on commit 01e6581

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 01e6581 Previous: f52ec6c Ratio
BM_SpinLockThrashing/2/process_time/real_time 1.2459196485914625 ms/iter 0.2628843360972182 ms/iter 4.74
BM_ProcYieldSpinLockThrashing/2/process_time/real_time 1.0214710235595703 ms/iter 0.26423881357037365 ms/iter 3.87
BM_NaiveSpinLockThrashing/2/process_time/real_time 1.0528117418289185 ms/iter 0.2615572587634117 ms/iter 4.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.