Skip to content
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
52 changes: 52 additions & 0 deletions api/include/opentelemetry/semconv/incubating/app_attributes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

/*
* DO NOT EDIT, this is an Auto-generated file from:
* buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
*/

#pragma once

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

OPENTELEMETRY_BEGIN_NAMESPACE
namespace semconv
{
namespace app
{

/**
* A unique identifier representing the installation of an application on a specific device
* <p>
* Its value SHOULD persist across launches of the same application installation, including through
* application upgrades. It SHOULD change if the application is uninstalled or if all applications
* of the vendor are uninstalled. Additionally, users might be able to reset this value (e.g. by
* clearing application data). If an app is installed multiple times on the same device (e.g. in
* different accounts on Android), each @code app.installation.id @endcode SHOULD have a different
* value. If multiple OpenTelemetry SDKs are used within the same application, they SHOULD use the
* same value for @code app.installation.id @endcode. Hardware IDs (e.g. serial number, IMEI, MAC
* address) MUST NOT be used as the @code app.installation.id @endcode. <p> For iOS, this value
* SHOULD be equal to the <a
* href="https://developer.apple.com/documentation/uikit/uidevice/identifierforvendor">vendor
* identifier</a>. <p> For Android, examples of @code app.installation.id @endcode implementations
* include: <ul> <li><a
* href="https://firebase.google.com/docs/projects/manage-installations">Firebase Installation
* ID</a>.</li> <li>A globally unique UUID which is persisted across sessions in your
* application.</li> <li><a href="https://developer.android.com/identity/app-set-id">App set
* ID</a>.</li> <li><a
* href="https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID">@code
* Settings.getString(Settings.Secure.ANDROID_ID) @endcode</a>.</li>
* </ul>
* <p>
* More information about Android identifier best practices can be found <a
* href="https://developer.android.com/training/articles/user-data-ids">here</a>.
*/
static constexpr const char *kAppInstallationId = "app.installation.id";

} // namespace app
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeFunction = "code.func
* <li>Java method: @code com.example.MyHttpService.serveRequest @endcode</li>
* <li>Java anonymous class method: @code com.mycompany.Main$1.myMethod @endcode</li>
* <li>Java lambda method: @code com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod
* @endcode</li> <li>PHP function: `GuzzleHttp\Client::transfer</li> <li>Go function: @code
* github.com/my/repo/pkg.foo.func5 @endcode</li> <li>Elixir: @code OpenTelemetry.Ctx.new
* @endcode</li> <li>PHP function: @code GuzzleHttp\Client::transfer @endcode</li> <li>Go function:
* @code github.com/my/repo/pkg.foo.func5 @endcode</li> <li>Elixir: @code OpenTelemetry.Ctx.new
* @endcode</li> <li>Erlang: @code opentelemetry_ctx:new @endcode</li> <li>Rust: @code
* playground::my_module::my_cool_func @endcode</li> <li>C function: @code fopen @endcode</li>
* </ul>
Expand Down
48 changes: 48 additions & 0 deletions api/include/opentelemetry/semconv/incubating/cpython_attributes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

/*
* DO NOT EDIT, this is an Auto-generated file from:
* buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
*/

#pragma once

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

OPENTELEMETRY_BEGIN_NAMESPACE
namespace semconv
{
namespace cpython
{

/**
* Value of the garbage collector collection generation.
*/
static constexpr const char *kCpythonGcGeneration = "cpython.gc.generation";

namespace CpythonGcGenerationValues
{
/**
* Generation 0
*/
static constexpr int kGeneration0 = 0;

/**
* Generation 1
*/
static constexpr int kGeneration1 = 1;

/**
* Generation 2
*/
static constexpr int kGeneration2 = 2;

} // namespace CpythonGcGenerationValues

} // namespace cpython
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
154 changes: 154 additions & 0 deletions api/include/opentelemetry/semconv/incubating/cpython_metrics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

/*
* DO NOT EDIT, this is an Auto-generated file from:
* buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2
*/

#pragma once

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

OPENTELEMETRY_BEGIN_NAMESPACE
namespace semconv
{
namespace cpython
{

/**
* The total number of objects collected inside a generation since interpreter start.
* <p>
* This metric reports data from <a
* href="https://docs.python.org/3/library/gc.html#gc.get_stats">@code gc.stats() @endcode</a>. <p>
* counter
*/
static constexpr const char *kMetricCpythonGcCollectedObjects = "cpython.gc.collected_objects";
static constexpr const char *descrMetricCpythonGcCollectedObjects =
"The total number of objects collected inside a generation since interpreter start.";
static constexpr const char *unitMetricCpythonGcCollectedObjects = "{object}";

static inline nostd::unique_ptr<metrics::Counter<uint64_t>>
CreateSyncInt64MetricCpythonGcCollectedObjects(metrics::Meter *meter)
{
return meter->CreateUInt64Counter(kMetricCpythonGcCollectedObjects,
descrMetricCpythonGcCollectedObjects,
unitMetricCpythonGcCollectedObjects);
}

static inline nostd::unique_ptr<metrics::Counter<double>>
CreateSyncDoubleMetricCpythonGcCollectedObjects(metrics::Meter *meter)
{
return meter->CreateDoubleCounter(kMetricCpythonGcCollectedObjects,
descrMetricCpythonGcCollectedObjects,
unitMetricCpythonGcCollectedObjects);
}

static inline nostd::shared_ptr<metrics::ObservableInstrument>
CreateAsyncInt64MetricCpythonGcCollectedObjects(metrics::Meter *meter)
{
return meter->CreateInt64ObservableCounter(kMetricCpythonGcCollectedObjects,
descrMetricCpythonGcCollectedObjects,
unitMetricCpythonGcCollectedObjects);
}

static inline nostd::shared_ptr<metrics::ObservableInstrument>
CreateAsyncDoubleMetricCpythonGcCollectedObjects(metrics::Meter *meter)
{
return meter->CreateDoubleObservableCounter(kMetricCpythonGcCollectedObjects,
descrMetricCpythonGcCollectedObjects,
unitMetricCpythonGcCollectedObjects);
}

/**
* The number of times a generation was collected since interpreter start.
* <p>
* This metric reports data from <a
* href="https://docs.python.org/3/library/gc.html#gc.get_stats">@code gc.stats() @endcode</a>. <p>
* counter
*/
static constexpr const char *kMetricCpythonGcCollections = "cpython.gc.collections";
static constexpr const char *descrMetricCpythonGcCollections =
"The number of times a generation was collected since interpreter start.";
static constexpr const char *unitMetricCpythonGcCollections = "{collection}";

static inline nostd::unique_ptr<metrics::Counter<uint64_t>>
CreateSyncInt64MetricCpythonGcCollections(metrics::Meter *meter)
{
return meter->CreateUInt64Counter(kMetricCpythonGcCollections, descrMetricCpythonGcCollections,
unitMetricCpythonGcCollections);
}

static inline nostd::unique_ptr<metrics::Counter<double>>
CreateSyncDoubleMetricCpythonGcCollections(metrics::Meter *meter)
{
return meter->CreateDoubleCounter(kMetricCpythonGcCollections, descrMetricCpythonGcCollections,
unitMetricCpythonGcCollections);
}

static inline nostd::shared_ptr<metrics::ObservableInstrument>
CreateAsyncInt64MetricCpythonGcCollections(metrics::Meter *meter)
{
return meter->CreateInt64ObservableCounter(
kMetricCpythonGcCollections, descrMetricCpythonGcCollections, unitMetricCpythonGcCollections);
}

static inline nostd::shared_ptr<metrics::ObservableInstrument>
CreateAsyncDoubleMetricCpythonGcCollections(metrics::Meter *meter)
{
return meter->CreateDoubleObservableCounter(
kMetricCpythonGcCollections, descrMetricCpythonGcCollections, unitMetricCpythonGcCollections);
}

/**
* The total number of objects which were found to be uncollectable inside a generation since
* interpreter start. <p> This metric reports data from <a
* href="https://docs.python.org/3/library/gc.html#gc.get_stats">@code gc.stats() @endcode</a>. <p>
* counter
*/
static constexpr const char *kMetricCpythonGcUncollectableObjects =
"cpython.gc.uncollectable_objects";
static constexpr const char *descrMetricCpythonGcUncollectableObjects =
"The total number of objects which were found to be uncollectable inside a generation since "
"interpreter start.";
static constexpr const char *unitMetricCpythonGcUncollectableObjects = "{object}";

static inline nostd::unique_ptr<metrics::Counter<uint64_t>>
CreateSyncInt64MetricCpythonGcUncollectableObjects(metrics::Meter *meter)
{
return meter->CreateUInt64Counter(kMetricCpythonGcUncollectableObjects,
descrMetricCpythonGcUncollectableObjects,
unitMetricCpythonGcUncollectableObjects);
}

static inline nostd::unique_ptr<metrics::Counter<double>>
CreateSyncDoubleMetricCpythonGcUncollectableObjects(metrics::Meter *meter)
{
return meter->CreateDoubleCounter(kMetricCpythonGcUncollectableObjects,
descrMetricCpythonGcUncollectableObjects,
unitMetricCpythonGcUncollectableObjects);
}

static inline nostd::shared_ptr<metrics::ObservableInstrument>
CreateAsyncInt64MetricCpythonGcUncollectableObjects(metrics::Meter *meter)
{
return meter->CreateInt64ObservableCounter(kMetricCpythonGcUncollectableObjects,
descrMetricCpythonGcUncollectableObjects,
unitMetricCpythonGcUncollectableObjects);
}

static inline nostd::shared_ptr<metrics::ObservableInstrument>
CreateAsyncDoubleMetricCpythonGcUncollectableObjects(metrics::Meter *meter)
{
return meter->CreateDoubleObservableCounter(kMetricCpythonGcUncollectableObjects,
descrMetricCpythonGcUncollectableObjects,
unitMetricCpythonGcUncollectableObjects);
}

} // namespace cpython
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
21 changes: 19 additions & 2 deletions api/include/opentelemetry/semconv/incubating/db_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size";
* The operation name SHOULD NOT be extracted from @code db.query.text @endcode,
* when the database system supports cross-table queries in non-batch operations.
* <p>
* If spaces can occur in the operation name, multiple consecutive spaces
* SHOULD be normalized to a single space.
* <p>
* For batch operations, if the individual operations are known to have the same operation name
* then that operation name SHOULD be used prepended by @code BATCH @endcode,
* otherwise @code db.operation.name @endcode SHOULD be @code BATCH @endcode or some other database
Expand All @@ -357,6 +360,7 @@ static constexpr const char *kDbOperationName = "db.operation.name";
* index. If @code db.query.text @endcode is also captured, then @code db.operation.parameter.<key>
* @endcode SHOULD match up with the parameterized placeholders present in @code db.query.text
* @endcode.
* @code db.operation.parameter.<key> @endcode SHOULD NOT be captured on batch operations.
*/
static constexpr const char *kDbOperationParameter = "db.operation.parameter";

Expand Down Expand Up @@ -422,10 +426,12 @@ static constexpr const char *kDbResponseReturnedRows = "db.response.returned_row
static constexpr const char *kDbResponseStatusCode = "db.response.status_code";

/**
* Deprecated, use @code db.collection.name @endcode instead.
* Deprecated, use @code db.collection.name @endcode instead, but only if not extracting the value
* from @code db.query.text @endcode.
*
* @deprecated
* {"note": "Replaced by @code db.collection.name @endcode.", "reason": "uncategorized"}
* {"note": "Replaced by @code db.collection.name @endcode, but only if not extracting the value
* from @code db.query.text @endcode.", "reason": "uncategorized"}
*/
OPENTELEMETRY_DEPRECATED static constexpr const char *kDbSqlTable = "db.sql.table";

Expand All @@ -437,6 +443,17 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbSqlTable = "db.sql.tabl
*/
OPENTELEMETRY_DEPRECATED static constexpr const char *kDbStatement = "db.statement";

/**
* The name of a stored procedure within the database.
* <p>
* It is RECOMMENDED to capture the value as provided by the application
* without attempting to do any case normalization.
* <p>
* For batch operations, if the individual operations are known to have the same
* stored procedure name then that stored procedure name SHOULD be used.
*/
static constexpr const char *kDbStoredProcedureName = "db.stored_procedure.name";

/**
* Deprecated, use @code db.system.name @endcode instead.
*
Expand Down
29 changes: 18 additions & 11 deletions api/include/opentelemetry/semconv/incubating/device_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ namespace device
/**
* A unique identifier representing the device
* <p>
* The device identifier MUST only be defined using the values outlined below. This value is not an
* advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value
* MUST be equal to the <a
* href="https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor">vendor
* identifier</a>. On Android (Java or Kotlin), this value MUST be equal to the Firebase
* Installation ID or a globally unique UUID which is persisted across sessions in your application.
* More information can be found <a
* href="https://developer.android.com/training/articles/user-data-ids">here</a> on best practices
* and exact implementation details. Caution should be taken when storing personal data or anything
* which can identify a user. GDPR and data protection laws may apply, ensure you do your own due
* diligence.
* Its value SHOULD be identical for all apps on a device and it SHOULD NOT change if an app is
* uninstalled and re-installed. However, it might be resettable by the user for all apps on a
* device. Hardware IDs (e.g. vendor-specific serial number, IMEI or MAC address) MAY be used as
* values. <p> More information about Android identifier best practices can be found <a
* href="https://developer.android.com/training/articles/user-data-ids">here</a>. <blockquote>
* [!WARNING]
* <p>
* This attribute may contain sensitive (PII) information. Caution should be taken when storing
* personal data or anything which can identify a user. GDPR and data protection laws may apply,
* ensure you do your own due diligence.
* <p>
* Due to these reasons, this identifier is not recommended for consumer applications and will
* likely result in rejection from both Google Play and App Store. However, it may be appropriate
* for specific enterprise scenarios, such as kiosk devices or enterprise-managed devices, with
* appropriate compliance clearance. Any instrumentation providing this identifier MUST implement it
* as an opt-in feature. <p> See <a
* href="/docs/attributes-registry/app.md#app-installation-id">@code app.installation.id
* @endcode</a> for a more privacy-preserving alternative.</blockquote>
*/
static constexpr const char *kDeviceId = "device.id";

Expand Down
12 changes: 12 additions & 0 deletions api/include/opentelemetry/semconv/incubating/error_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ namespace semconv
namespace error
{

/**
* A message providing more detail about an error in human-readable form.
* <p>
* @code error.message @endcode should provide additional context and detail about an error.
* It is NOT RECOMMENDED to duplicate the value of @code error.type @endcode in @code error.message
* @endcode. It is also NOT RECOMMENDED to duplicate the value of @code exception.message @endcode
* in @code error.message @endcode. <p>
* @code error.message @endcode is NOT RECOMMENDED for metrics or spans due to its unbounded
* cardinality and overlap with span status.
*/
static constexpr const char *kErrorMessage = "error.message";

/**
* Describes a class of error the operation ended with.
* <p>
Expand Down
Loading
Loading