diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index e0dc166e08..3d01361b7a 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- - uses: actions/stale@v5
+ - uses: actions/stale@v6
with:
stale-issue-message: "This issue was marked as stale due to lack of activity."
days-before-issue-stale: 60
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 26195e04bd..6a5e5af31e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,11 +15,42 @@ Increment the:
## [Unreleased]
+## [1.6.1] 2022-09-22
+
* [BUILD] Upgrade opentelemetry-proto to v0.19.0 [#1579](https://github.com/open-telemetry/opentelemetry-cpp/pull/1579)
* [METRICS EXPORTER] Add `OtlpGrpcMetricExporterFactory` and `OtlpHttpMetricExporterFactory`.
[#1606](https://github.com/open-telemetry/opentelemetry-cpp/pull/1606)
-* [METRICS EXPORTER] Add `OtlpGrpcClient` [#1606](https://github.com/open-telemetry/opentelemetry-cpp/pull/1606)
-* [BUILD] Fix header only api singletons [#1604](https://github.com/open-telemetry/opentelemetry-cpp/pull/1604)
+* [SEMANTIC CONVENTIONS] Upgrade to version 1.13.0 [#1624](https://github.com/open-telemetry/opentelemetry-cpp/pull/1624)
+* [BUILD] Fixes span creation benchmark issue. [#1622](https://github.com/open-telemetry/opentelemetry-cpp/pull/1622)
+* [BUILD] Fix more build warnings (#1616) [#1620](https://github.com/open-telemetry/opentelemetry-cpp/pull/1620)
+* [SDK gRPC]: Fix out-of-bounds access of string_view in GrpcClientCarrier in
+ the example
+ [#1619](https://github.com/open-telemetry/opentelemetry-cpp/pull/1619)
+* [EXPORTER ETW] Add Trace flags in SpanContext [#1618](https://github.com/open-telemetry/opentelemetry-cpp/pull/1618)
+* [SDK] resource sdk: Update Resource::Merge function docs [#1615](https://github.com/open-telemetry/opentelemetry-cpp/pull/1615)
+* [BUILD] Fix build warnings [#1613](https://github.com/open-telemetry/opentelemetry-cpp/pull/1613)
+* [API BUILD] Fix header only api singletons (#1520) [#1604](https://github.com/open-telemetry/opentelemetry-cpp/pull/1604)
+* [METRICS SDK] Fix default value of
+ `OtlpHttpMetricExporterOptions::aggregation_temporality`.
+ [#1601](https://github.com/open-telemetry/opentelemetry-cpp/pull/1601)
+* [METRICS EXAMPLE] Example for OTLP gRPC exporter for Metrics. [#1598](https://github.com/open-telemetry/opentelemetry-cpp/pull/1598)
+* [SDK] Fix `LoggerContext::Shutdown` and tsan of `OtlpHttpClient` [#1592](https://github.com/open-telemetry/opentelemetry-cpp/pull/1592)
+* [METRICS SDK] Fix 1585 - Multiple cumulative metric collections without
+ measurement recording.
+ [#1586](https://github.com/open-telemetry/opentelemetry-cpp/pull/1586)
+* [BUILD] metrics warnings [#1583](https://github.com/open-telemetry/opentelemetry-cpp/pull/1583)
+* [METRICS SDK] Fix ObservableInstrument::RemoveCallback [#1582](https://github.com/open-telemetry/opentelemetry-cpp/pull/1582)
+* [SDK] Add error log when getting a http error code [#1581](https://github.com/open-telemetry/opentelemetry-cpp/pull/1581)
+* [EXPORTER] ETW Exporter - Add support for Sampler and ID Generator [#1547](https://github.com/open-telemetry/opentelemetry-cpp/pull/1547)
+
+Notes:
+
+While [OpenTelemetry semantic
+convention](https://github.com/open-telemetry/opentelemetry-specification/tree/main/semantic_conventions)
+is still in experimental state, PR
+[#1624](https://github.com/open-telemetry/opentelemetry-cpp/pull/1624) upgraded
+it from 1.12.0 to 1.13.0 which **MAY** break the instrumentation library. Please
+update the semantic convention in instrumentation library is needed.
## [1.6.0] 2022-08-15
diff --git a/README.md b/README.md
index 72f0f691a4..3cf157687d 100644
--- a/README.md
+++ b/README.md
@@ -121,6 +121,7 @@ For edit access, get in touch on
([@open-telemetry/cpp-approvers](https://github.com/orgs/open-telemetry/teams/cpp-approvers)):
* [Josh Suereth](https://github.com/jsuereth), Google
+* [Marc Alff](https://github.com/marcalff), Oracle
* [Reiley Yang](https://github.com/reyang), Microsoft
* [WenTao Ou](https://github.com/owent), Tencent
diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h
index 2334ced67b..93bb86d789 100644
--- a/api/include/opentelemetry/trace/semantic_conventions.h
+++ b/api/include/opentelemetry/trace/semantic_conventions.h
@@ -33,7 +33,7 @@ namespace SemanticConventions
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
-static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.12.0";
+static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.13.0";
/**
* The full invoked ARN as provided on the {@code Context} passed to the function ({@code
@@ -355,18 +355,45 @@ static constexpr const char *FAAS_INVOKED_REGION = "faas.invoked_region";
static constexpr const char *NET_TRANSPORT = "net.transport";
/**
- * Remote address of the peer (dotted decimal for IPv4 or RFC5952 for IPv6)
+ * Application layer protocol used. The value SHOULD be normalized to lowercase.
*/
-static constexpr const char *NET_PEER_IP = "net.peer.ip";
+static constexpr const char *NET_APP_PROTOCOL_NAME = "net.app.protocol.name";
/**
- * Remote port number.
+ * Version of the application layer protocol used. See note below.
+ *
+ *
Notes:
+
- {@code net.app.protocol.version} refers to the version of the protocol used and might be
+ different from the protocol client's version. If the HTTP client used has a version of {@code
+ 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to {@code 1.1}.
+
*/
-static constexpr const char *NET_PEER_PORT = "net.peer.port";
+static constexpr const char *NET_APP_PROTOCOL_VERSION = "net.app.protocol.version";
+
+/**
+ * Remote socket peer name.
+ */
+static constexpr const char *NET_SOCK_PEER_NAME = "net.sock.peer.name";
+
+/**
+ * Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, etc.
+ */
+static constexpr const char *NET_SOCK_PEER_ADDR = "net.sock.peer.addr";
/**
- * Remote hostname or similar, see note below.
+ * Remote socket peer port.
+ */
+static constexpr const char *NET_SOCK_PEER_PORT = "net.sock.peer.port";
+
+/**
+ * Protocol address
+ * family which is used for communication.
+ */
+static constexpr const char *NET_SOCK_FAMILY = "net.sock.family";
+
+/**
+ * Logical remote hostname, see note below.
*
* Notes:
- {@code net.peer.name} SHOULD NOT be set if capturing it would require an extra DNS
@@ -375,19 +402,29 @@ static constexpr const char *NET_PEER_PORT = "net.peer.port";
static constexpr const char *NET_PEER_NAME = "net.peer.name";
/**
- * Like {@code net.peer.ip} but for the host IP. Useful in case of a multi-IP host.
+ * Logical remote port number
*/
-static constexpr const char *NET_HOST_IP = "net.host.ip";
+static constexpr const char *NET_PEER_PORT = "net.peer.port";
/**
- * Like {@code net.peer.port} but for the host port.
+ * Logical local hostname or similar, see note below.
+ */
+static constexpr const char *NET_HOST_NAME = "net.host.name";
+
+/**
+ * Logical local port number, preferably the one that the peer used to connect
*/
static constexpr const char *NET_HOST_PORT = "net.host.port";
/**
- * Local hostname or similar, see note below.
+ * Local socket address. Useful in case of a multi-IP host.
*/
-static constexpr const char *NET_HOST_NAME = "net.host.name";
+static constexpr const char *NET_SOCK_HOST_ADDR = "net.sock.host.addr";
+
+/**
+ * Local socket port number.
+ */
+static constexpr const char *NET_SOCK_HOST_PORT = "net.sock.host.port";
/**
* The internet connection type currently being used by the host.
@@ -489,39 +526,6 @@ static constexpr const char *CODE_LINENO = "code.lineno";
*/
static constexpr const char *HTTP_METHOD = "http.method";
-/**
- * Full HTTP request URL in the form {@code scheme://host[:port]/path?query[#fragment]}. Usually the
- fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
- *
- *
Notes:
-
- {@code http.url} MUST NOT contain credentials passed via URL in form of {@code
- https://username:password@www.example.com/}. In such case the attribute's value should be {@code
- https://www.example.com/}.
- */
-static constexpr const char *HTTP_URL = "http.url";
-
-/**
- * The full request target as passed in a HTTP request line or equivalent.
- */
-static constexpr const char *HTTP_TARGET = "http.target";
-
-/**
- * The value of the HTTP host header.
- An empty Host header should also be reported, see note.
- *
- * Notes:
-
- When the header is present but empty the attribute SHOULD be set to the empty string.
- Note that this is a valid situation that is expected in certain cases, according the aforementioned
- section of RFC 7230. When the header
- is not set the attribute MUST NOT be set.
- */
-static constexpr const char *HTTP_HOST = "http.host";
-
-/**
- * The URI scheme identifying the used protocol.
- */
-static constexpr const char *HTTP_SCHEME = "http.scheme";
-
/**
* HTTP response status code.
*/
@@ -537,40 +541,37 @@ static constexpr const char *HTTP_STATUS_CODE = "http.status_code";
static constexpr const char *HTTP_FLAVOR = "http.flavor";
/**
- * Value of the HTTP User-Agent
- * header sent by the client.
+ * Value of the HTTP
+ * User-Agent header sent by the client.
*/
static constexpr const char *HTTP_USER_AGENT = "http.user_agent";
/**
* 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 header. For requests
- * using transport encoding, this should be the compressed size.
+ * href="https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length">Content-Length
+ * header. For requests using transport encoding, this should be the compressed size.
*/
static constexpr const char *HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length";
-/**
- * The size of the uncompressed request payload body after transport decoding. Not set if transport
- * encoding not used.
- */
-static constexpr const char *HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED =
- "http.request_content_length_uncompressed";
-
/**
* 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 header. For requests
- * using transport encoding, this should be the compressed size.
+ * href="https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length">Content-Length
+ * header. For requests using transport encoding, this should be the compressed size.
*/
static constexpr const char *HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length";
/**
- * The size of the uncompressed response payload body after transport decoding. Not set if transport
- * encoding not used.
+ * Full HTTP request URL in the form {@code scheme://host[:port]/path?query[#fragment]}. Usually the
+ fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
+ *
+ * Notes:
+
- {@code http.url} MUST NOT contain credentials passed via URL in form of {@code
+ https://username:password@www.example.com/}. In such case the attribute's value should be {@code
+ https://www.example.com/}.
*/
-static constexpr const char *HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED =
- "http.response_content_length_uncompressed";
+static constexpr const char *HTTP_URL = "http.url";
/**
* The ordinal number of request re-sending attempt.
@@ -578,20 +579,23 @@ static constexpr const char *HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED =
static constexpr const char *HTTP_RETRY_COUNT = "http.retry_count";
/**
- * The primary server name of the matched virtual host. This should be obtained via configuration.
- If no such configuration can be obtained, this attribute MUST NOT be set ( {@code net.host.name}
- should be used instead).
- *
- * Notes:
-
- {@code http.url} is usually not readily available on the server side but would have to be
- assembled in a cumbersome and sometimes lossy process from other information (see e.g.
- open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is
- available.
+ * The URI scheme identifying the used protocol.
*/
-static constexpr const char *HTTP_SERVER_NAME = "http.server_name";
+static constexpr const char *HTTP_SCHEME = "http.scheme";
/**
- * The matched route (path template).
+ * The full request target as passed in a HTTP request line or equivalent.
+ */
+static constexpr const char *HTTP_TARGET = "http.target";
+
+/**
+ * The matched route (path template in the format used by the respective server framework). See note
+ below
+ *
+ * Notes:
+
- 'http.route' MUST NOT be populated when this is not supported by the HTTP server
+ framework as the route attribute should have low-cardinality and the URI path can NOT substitute
+ it.
*/
static constexpr const char *HTTP_ROUTE = "http.route";
@@ -600,13 +604,13 @@ static constexpr const char *HTTP_ROUTE = "http.route";
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For">X-Forwarded-For).
*
* Notes:
-
- This is not necessarily the same as {@code net.peer.ip}, which would
+
- This is not necessarily the same as {@code net.sock.peer.addr}, which would
identify the network-level peer, which may be a proxy.
- This attribute should be set when a
-source of information different from the one used for {@code net.peer.ip}, is available even if that
-other source just confirms the same value as {@code net.peer.ip}. Rationale: For {@code
-net.peer.ip}, one typically does not know if it comes from a proxy, reverse proxy, or the actual
-client. Setting
-{@code http.client_ip} when it's the same as {@code net.peer.ip} means that
+source of information different from the one used for {@code net.sock.peer.addr}, is available even
+if that other source just confirms the same value as {@code net.sock.peer.addr}. Rationale: For
+{@code net.sock.peer.addr}, one typically does not know if it comes from a proxy, reverse proxy, or
+the actual client. Setting
+{@code http.client_ip} when it's the same as {@code net.sock.peer.addr} means that
one is at least somewhat confident that the address is not that of
the closest proxy.
*/
@@ -731,6 +735,24 @@ static constexpr const char *AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS =
static constexpr const char *AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES =
"aws.dynamodb.global_secondary_index_updates";
+/**
+ * The name of the operation being executed.
+ */
+static constexpr const char *GRAPHQL_OPERATION_NAME = "graphql.operation.name";
+
+/**
+ * The type of the operation being executed.
+ */
+static constexpr const char *GRAPHQL_OPERATION_TYPE = "graphql.operation.type";
+
+/**
+ * The GraphQL document being executed.
+ *
+ * Notes:
+
- The value may be sanitized to exclude sensitive information.
+ */
+static constexpr const char *GRAPHQL_DOCUMENT = "graphql.document";
+
/**
* A string identifying the messaging system.
*/
@@ -1069,6 +1091,8 @@ static constexpr const char *ELASTICSEARCH = "elasticsearch";
static constexpr const char *MEMCACHED = "memcached";
/** CockroachDB. */
static constexpr const char *COCKROACHDB = "cockroachdb";
+/** OpenSearch. */
+static constexpr const char *OPENSEARCH = "opensearch";
} // namespace DbSystemValues
namespace DbCassandraConsistencyLevelValues
@@ -1141,10 +1165,6 @@ namespace NetTransportValues
static constexpr const char *IP_TCP = "ip_tcp";
/** ip_udp. */
static constexpr const char *IP_UDP = "ip_udp";
-/** Another IP-based protocol. */
-static constexpr const char *IP = "ip";
-/** Unix Domain socket. See below. */
-static constexpr const char *UNIX = "unix";
/** Named or anonymous pipe. See note below. */
static constexpr const char *PIPE = "pipe";
/** In-process communication. */
@@ -1153,6 +1173,16 @@ static constexpr const char *INPROC = "inproc";
static constexpr const char *OTHER = "other";
} // namespace NetTransportValues
+namespace NetSockFamilyValues
+{
+/** IPv4 address. */
+static constexpr const char *INET = "inet";
+/** IPv6 address. */
+static constexpr const char *INET6 = "inet6";
+/** Unix domain socket path. */
+static constexpr const char *UNIX = "unix";
+} // namespace NetSockFamilyValues
+
namespace NetHostConnectionTypeValues
{
/** wifi. */
@@ -1229,6 +1259,16 @@ static constexpr const char *SPDY = "SPDY";
static constexpr const char *QUIC = "QUIC";
} // namespace HttpFlavorValues
+namespace GraphqlOperationTypeValues
+{
+/** GraphQL query. */
+static constexpr const char *QUERY = "query";
+/** GraphQL mutation. */
+static constexpr const char *MUTATION = "mutation";
+/** GraphQL subscription. */
+static constexpr const char *SUBSCRIPTION = "subscription";
+} // namespace GraphqlOperationTypeValues
+
namespace MessagingDestinationKindValues
{
/** A message sent to a queue. */
diff --git a/api/include/opentelemetry/version.h b/api/include/opentelemetry/version.h
index 71885471b6..85357309bf 100644
--- a/api/include/opentelemetry/version.h
+++ b/api/include/opentelemetry/version.h
@@ -6,7 +6,7 @@
#include "opentelemetry/detail/preprocessor.h"
#define OPENTELEMETRY_ABI_VERSION_NO 1
-#define OPENTELEMETRY_VERSION "1.6.0"
+#define OPENTELEMETRY_VERSION "1.6.1"
#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)
// clang-format off
diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh
index 9410c72eb6..5cf63ce5c2 100755
--- a/buildscripts/semantic-convention/generate.sh
+++ b/buildscripts/semantic-convention/generate.sh
@@ -10,10 +10,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"
# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
-SEMCONV_VERSION=1.12.0
+SEMCONV_VERSION=1.13.0
SPEC_VERSION=v$SEMCONV_VERSION
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
-GENERATOR_VERSION=0.7.0
+GENERATOR_VERSION=0.14.0
cd ${SCRIPT_DIR}
diff --git a/ci/setup_grpc.sh b/ci/setup_grpc.sh
index d42fbb7d2e..6e86f20cb9 100755
--- a/ci/setup_grpc.sh
+++ b/ci/setup_grpc.sh
@@ -6,14 +6,15 @@
set -e
export DEBIAN_FRONTEND=noninteractive
old_grpc_version='v1.33.2'
-new_grpc_version='v1.43.2'
+new_grpc_version='v1.48.1'
gcc_version_for_new_grpc='5.1'
+std_version='14'
install_grpc_version=${new_grpc_version}
grpc_version='v1.39.0'
install_dir='/usr/local/'
usage() { echo "Usage: $0 [-v ] [-i "] 1>&2; exit 1;}
-while getopts ":v:i:" o; do
+while getopts ":v:i:r:s:" o; do
case "${o}" in
v)
gcc_version=${OPTARG}
@@ -21,6 +22,12 @@ while getopts ":v:i:" o; do
i)
install_dir=${OPTARG}
;;
+ r)
+ install_grpc_version=${OPTARG}
+ ;;
+ s)
+ std_version=${OPTARG}
+ ;;
*)
usage
;;
@@ -31,6 +38,7 @@ if [ -z "${gcc_version}" ]; then
fi
if [[ "${gcc_version}" < "${gcc_version_for_new_grpc}" ]]; then
echo "less"
+ std_version='11'
install_grpc_version=${old_grpc_version}
fi
if ! type cmake > /dev/null; then
@@ -52,7 +60,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \
make -j${nproc} install && popd
mkdir -p build && pushd build
cmake -DgRPC_INSTALL=ON \
- -DCMAKE_CXX_STANDARD=11 \
+ -DCMAKE_CXX_STANDARD=${std_version} \
-DgRPC_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
-DCMAKE_PREFIX_PATH=$INSTALL_DIR \
diff --git a/docs/dependencies.md b/docs/dependencies.md
index 4cd4d39a5f..d6a3449adb 100644
--- a/docs/dependencies.md
+++ b/docs/dependencies.md
@@ -31,7 +31,7 @@ Both these dependencies are listed here:
License`
- Uses Abseil C++ Library for `absl::variant` as default `nostd::variant` if
`WITH_ABSEIL` cmake option or
- `--@io_opentelemetry_cpp/api:with_abseil=true` (aka
+ `--@io_opentelemetry_cpp//api:with_abseil=true` (aka
`--//api:with_abseil=true`) bazel option is enabled. License: `Apache
License 2.0`
diff --git a/docs/public/conf.py b/docs/public/conf.py
index 22705e20da..eb79a39815 100644
--- a/docs/public/conf.py
+++ b/docs/public/conf.py
@@ -21,7 +21,7 @@
author = 'OpenTelemetry authors'
# The full version, including alpha/beta/rc tags
-release = "1.6.0"
+release = "1.6.1"
# Run sphinx on subprojects and copy output
# -----------------------------------------
diff --git a/examples/grpc/client.cc b/examples/grpc/client.cc
index ea7c5053f9..2525f2d479 100644
--- a/examples/grpc/client.cc
+++ b/examples/grpc/client.cc
@@ -50,7 +50,7 @@ class GreeterClient
{{SemanticConventions::RPC_SYSTEM, "grpc"},
{SemanticConventions::RPC_SERVICE, "grpc-example.GreetService"},
{SemanticConventions::RPC_METHOD, "Greet"},
- {SemanticConventions::NET_PEER_IP, ip},
+ {SemanticConventions::NET_SOCK_PEER_ADDR, ip},
{SemanticConventions::NET_PEER_PORT, port}},
options);
diff --git a/examples/http/server.cc b/examples/http/server.cc
index cf7e6bba51..b451499d58 100644
--- a/examples/http/server.cc
+++ b/examples/http/server.cc
@@ -39,7 +39,7 @@ class RequestHandler : public HTTP_SERVER_NS::HttpRequestCallback
// start span with parent context extracted from http header
auto span = get_tracer("http-server")
->StartSpan(span_name,
- {{SemanticConventions::HTTP_SERVER_NAME, server_name},
+ {{SemanticConventions::NET_HOST_NAME, server_name},
{SemanticConventions::NET_HOST_PORT, server_port},
{SemanticConventions::HTTP_METHOD, request.method},
{SemanticConventions::HTTP_SCHEME, "http"},
diff --git a/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h
index b23443595b..79731a80bc 100644
--- a/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h
+++ b/sdk/include/opentelemetry/sdk/metrics/state/async_metric_storage.h
@@ -44,6 +44,7 @@ class AsyncMetricStorage : public MetricStorage, public AsyncWritableMetricStora
opentelemetry::common::SystemTimestamp /* observation_time */) noexcept
{
// process the read measurements - aggregate and store in hashmap
+ std::lock_guard guard(hashmap_lock_);
for (auto &measurement : measurements)
{
auto aggr = DefaultAggregation::CreateAggregation(aggregation_type_, instrument_descriptor_);
@@ -96,10 +97,16 @@ class AsyncMetricStorage : public MetricStorage, public AsyncWritableMetricStora
nostd::function_ref metric_collection_callback) noexcept override
{
- auto status = temporal_metric_storage_.buildMetrics(collector, collectors, sdk_start_ts,
- collection_ts, std::move(delta_hash_map_),
- metric_collection_callback);
- delta_hash_map_.reset(new AttributesHashMap());
+ std::shared_ptr delta_metrics = nullptr;
+ {
+ std::lock_guard guard(hashmap_lock_);
+ delta_metrics = std::move(delta_hash_map_);
+ delta_hash_map_.reset(new AttributesHashMap);
+ }
+
+ auto status =
+ temporal_metric_storage_.buildMetrics(collector, collectors, sdk_start_ts, collection_ts,
+ delta_metrics, metric_collection_callback);
return status;
}
@@ -110,6 +117,7 @@ class AsyncMetricStorage : public MetricStorage, public AsyncWritableMetricStora
void *state_;
std::unique_ptr cumulative_hash_map_;
std::unique_ptr delta_hash_map_;
+ opentelemetry::common::SpinLockMutex hashmap_lock_;
TemporalMetricStorage temporal_metric_storage_;
};
diff --git a/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h b/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h
index be86c96826..2f93b32f66 100644
--- a/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h
+++ b/sdk/include/opentelemetry/sdk/metrics/state/attributes_hashmap.h
@@ -3,7 +3,6 @@
#pragma once
#ifndef ENABLE_METRICS_PREVIEW
-# include "opentelemetry/common/spin_lock_mutex.h"
# include "opentelemetry/nostd/function_ref.h"
# include "opentelemetry/sdk/common/attribute_utils.h"
# include "opentelemetry/sdk/common/attributemap_hash.h"
@@ -13,7 +12,6 @@
# include
# include
-# include
# include
OPENTELEMETRY_BEGIN_NAMESPACE
@@ -37,7 +35,6 @@ class AttributesHashMap
public:
Aggregation *Get(const MetricAttributes &attributes) const
{
- std::lock_guard guard(lock_);
auto it = hash_map_.find(attributes);
if (it != hash_map_.end())
{
@@ -52,7 +49,6 @@ class AttributesHashMap
*/
bool Has(const MetricAttributes &attributes) const
{
- std::lock_guard guard(lock_);
return (hash_map_.find(attributes) == hash_map_.end()) ? false : true;
}
@@ -64,8 +60,6 @@ class AttributesHashMap
Aggregation *GetOrSetDefault(const MetricAttributes &attributes,
std::function()> aggregation_callback)
{
- std::lock_guard guard(lock_);
-
auto it = hash_map_.find(attributes);
if (it != hash_map_.end())
{
@@ -81,7 +75,6 @@ class AttributesHashMap
*/
void Set(const MetricAttributes &attributes, std::unique_ptr value)
{
- std::lock_guard guard(lock_);
hash_map_[attributes] = std::move(value);
}
@@ -91,7 +84,6 @@ class AttributesHashMap
bool GetAllEnteries(
nostd::function_ref callback) const
{
- std::lock_guard guard(lock_);
for (auto &kv : hash_map_)
{
if (!callback(kv.first, *(kv.second.get())))
@@ -105,17 +97,11 @@ class AttributesHashMap
/**
* Return the size of hash.
*/
- size_t Size()
- {
- std::lock_guard guard(lock_);
- return hash_map_.size();
- }
+ size_t Size() { return hash_map_.size(); }
private:
std::unordered_map, AttributeHashGenerator>
hash_map_;
-
- mutable opentelemetry::common::SpinLockMutex lock_;
};
} // namespace metrics
diff --git a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h
index a9b0604f05..16bac34079 100644
--- a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h
+++ b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h
@@ -52,6 +52,7 @@ class SyncMetricStorage : public MetricStorage, public SyncWritableMetricStorage
return;
}
exemplar_reservoir_->OfferMeasurement(value, {}, context, std::chrono::system_clock::now());
+ std::lock_guard guard(attribute_hashmap_lock_);
attributes_hashmap_->GetOrSetDefault({}, create_default_aggregation_)->Aggregate(value);
}
@@ -67,6 +68,7 @@ class SyncMetricStorage : public MetricStorage, public SyncWritableMetricStorage
exemplar_reservoir_->OfferMeasurement(value, attributes, context,
std::chrono::system_clock::now());
auto attr = attributes_processor_->process(attributes);
+ std::lock_guard guard(attribute_hashmap_lock_);
attributes_hashmap_->GetOrSetDefault(attr, create_default_aggregation_)->Aggregate(value);
}
@@ -77,6 +79,7 @@ class SyncMetricStorage : public MetricStorage, public SyncWritableMetricStorage
return;
}
exemplar_reservoir_->OfferMeasurement(value, {}, context, std::chrono::system_clock::now());
+ std::lock_guard guard(attribute_hashmap_lock_);
attributes_hashmap_->GetOrSetDefault({}, create_default_aggregation_)->Aggregate(value);
}
@@ -93,6 +96,7 @@ class SyncMetricStorage : public MetricStorage, public SyncWritableMetricStorage
exemplar_reservoir_->OfferMeasurement(value, attributes, context,
std::chrono::system_clock::now());
auto attr = attributes_processor_->process(attributes);
+ std::lock_guard guard(attribute_hashmap_lock_);
attributes_hashmap_->GetOrSetDefault(attr, create_default_aggregation_)->Aggregate(value);
}
@@ -117,6 +121,7 @@ class SyncMetricStorage : public MetricStorage, public SyncWritableMetricStorage
std::function()> create_default_aggregation_;
nostd::shared_ptr exemplar_reservoir_;
TemporalMetricStorage temporal_metric_storage_;
+ opentelemetry::common::SpinLockMutex attribute_hashmap_lock_;
};
} // namespace metrics
diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
index 28d5438653..48f51b00b2 100644
--- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
+++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
@@ -23,7 +23,7 @@ namespace SemanticConventions
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
-static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.12.0";
+static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.13.0";
/**
* Array of brand name and version separated by a space
@@ -508,6 +508,11 @@ static constexpr const char *OS_VERSION = "os.version";
*/
static constexpr const char *PROCESS_PID = "process.pid";
+/**
+ * Parent Process identifier (PID).
+ */
+static constexpr const char *PROCESS_PARENT_PID = "process.parent_pid";
+
/**
* The name of the process executable. On Linux based systems, can be set to the {@code Name} in
* {@code proc/[pid]/status}. On Windows, can be set to the base name of {@code
diff --git a/sdk/include/opentelemetry/sdk/version/version.h b/sdk/include/opentelemetry/sdk/version/version.h
index ee15593ff8..86176ba71f 100644
--- a/sdk/include/opentelemetry/sdk/version/version.h
+++ b/sdk/include/opentelemetry/sdk/version/version.h
@@ -5,7 +5,7 @@
#include "opentelemetry/detail/preprocessor.h"
-#define OPENTELEMETRY_SDK_VERSION "1.6.0"
+#define OPENTELEMETRY_SDK_VERSION "1.6.1"
#include "opentelemetry/version.h"
diff --git a/sdk/src/metrics/state/sync_metric_storage.cc b/sdk/src/metrics/state/sync_metric_storage.cc
index eec68ed6d7..be753ca98f 100644
--- a/sdk/src/metrics/state/sync_metric_storage.cc
+++ b/sdk/src/metrics/state/sync_metric_storage.cc
@@ -20,8 +20,12 @@ bool SyncMetricStorage::Collect(CollectorHandle *collector,
// Add the current delta metrics to `unreported metrics stash` for all the collectors,
// this will also empty the delta metrics hashmap, and make it available for
// recordings
- std::shared_ptr delta_metrics = std::move(attributes_hashmap_);
- attributes_hashmap_.reset(new AttributesHashMap);
+ std::shared_ptr delta_metrics = nullptr;
+ {
+ std::lock_guard guard(attribute_hashmap_lock_);
+ delta_metrics = std::move(attributes_hashmap_);
+ attributes_hashmap_.reset(new AttributesHashMap);
+ }
return temporal_metric_storage_.buildMetrics(collector, collectors, sdk_start_ts, collection_ts,
std::move(delta_metrics), callback);
diff --git a/sdk/src/version/version.cc b/sdk/src/version/version.cc
index 2c6db82ddc..c4dff0cb56 100644
--- a/sdk/src/version/version.cc
+++ b/sdk/src/version/version.cc
@@ -10,16 +10,16 @@ namespace version
{
const int MAJOR_VERSION = 1;
const int MINOR_VERSION = 6;
-const int PATCH_VERSION = 0;
+const int PATCH_VERSION = 1;
const char *PRE_RELEASE = "NONE";
const char *BUILD_METADATA = "NONE";
-const int COUNT_NEW_COMMITS = 23;
-const char *BRANCH = "pre_release_1.6.0";
-const char *COMMIT_HASH = "ad23f20392f26350fec7afca229729c2ef9ef92b";
-const char *SHORT_VERSION = "1.6.0";
+const int COUNT_NEW_COMMITS = 27;
+const char *BRANCH = "pre_release_1.6.1";
+const char *COMMIT_HASH = "38012fab34faa50d5020959b68eba77ac485b508";
+const char *SHORT_VERSION = "1.6.1";
const char *FULL_VERSION =
- "1.5.0-NONE-NONE-23-pre_release_1.6.0-ad23f20392f26350fec7afca229729c2ef9ef92b";
-const char *BUILD_DATE = "Tue Aug 16 00:35:48 UTC 2022";
+ "1.6.0-NONE-NONE-27-pre_release_1.6.1-38012fab34faa50d5020959b68eba77ac485b508";
+const char *BUILD_DATE = "Thu Sep 22 18:05:21 UTC 2022";
} // namespace version
} // namespace sdk
OPENTELEMETRY_END_NAMESPACE
diff --git a/sdk/test/metrics/attributes_hashmap_benchmark.cc b/sdk/test/metrics/attributes_hashmap_benchmark.cc
index 2ebf03175a..92035809e0 100644
--- a/sdk/test/metrics/attributes_hashmap_benchmark.cc
+++ b/sdk/test/metrics/attributes_hashmap_benchmark.cc
@@ -25,14 +25,17 @@ void BM_AttributseHashMap(benchmark::State &state)
std::vector attributes = {{{"k1", "v1"}, {"k2", "v2"}},
{{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}}};
- auto work = [&attributes, &hash_map](const size_t i) {
+ std::mutex m;
+
+ auto work = [&attributes, &hash_map, &m](const size_t i) {
std::function()> create_default_aggregation =
[]() -> std::unique_ptr {
return std::unique_ptr(new DropAggregation);
};
-
+ m.lock();
hash_map.GetOrSetDefault(attributes[i % 2], create_default_aggregation)->Aggregate(1l);
benchmark::DoNotOptimize(hash_map.Has(attributes[i % 2]));
+ m.unlock();
};
while (state.KeepRunning())
{
diff --git a/third_party_release b/third_party_release
index 2ae3f75bab..c1801018b4 100644
--- a/third_party_release
+++ b/third_party_release
@@ -20,4 +20,4 @@ ms-gsl=v3.1.0-67-g6f45293
nlohmann-json=v3.10.5
opentelemetry-proto=v0.19.0
prometheus-cpp=v1.0.0
-vcpkg=2022.04.12
+vcpkg=2022.08.15
diff --git a/tools/vcpkg b/tools/vcpkg
index 5568f110b5..acc3bcf76b 160000
--- a/tools/vcpkg
+++ b/tools/vcpkg
@@ -1 +1 @@
-Subproject commit 5568f110b509a9fd90711978a7cb76bae75bb092
+Subproject commit acc3bcf76b84ae5041c86ab55fe138ae7b8255c7