Skip to content

Commit

Permalink
Update Semantic Conventions to version 1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tidal committed Jun 23, 2022
1 parent 0dd00cf commit 7e6837d
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare(strict_types=1);

namespace {{ namespace }};

class {{ class }}AttributeValues
interface {{ class }}AttributeValues
{
/**
* The URL of the OpenTelemetry schema for these keys and values.
Expand Down
2 changes: 1 addition & 1 deletion script/semantic-conventions/templates/Attributes.php.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare(strict_types=1);

namespace {{ namespace }};

class {{ class }}Attributes
interface {{ class }}Attributes
{
/**
* The URL of the OpenTelemetry schema for these keys and values.
Expand Down
6 changes: 3 additions & 3 deletions src/SemConv/ResourceAttributeValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

namespace OpenTelemetry\SemConv;

class ResourceAttributeValues
interface ResourceAttributeValues
{
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.9.0';
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.12.0';
/**
* @see ResourceAttributes::CLOUD_PROVIDER Alibaba Cloud
*/
Expand Down Expand Up @@ -238,7 +238,7 @@ class ResourceAttributeValues
public const OS_TYPE_AIX = 'aix';

/**
* @see ResourceAttributes::OS_TYPE Oracle Solaris
* @see ResourceAttributes::OS_TYPE SunOS, Oracle Solaris
*/
public const OS_TYPE_SOLARIS = 'solaris';

Expand Down
74 changes: 60 additions & 14 deletions src/SemConv/ResourceAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,44 @@

namespace OpenTelemetry\SemConv;

class ResourceAttributes
interface ResourceAttributes
{
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.9.0';
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.12.0';

/**
* Array of brand name and version separated by a space.
*
* This value is intended to be taken from the UA client hints API (navigator.userAgentData.brands).
*
* @example Not A;Brand 99
* @example Chromium 99
* @example Chrome 99
*/
public const BROWSER_BRANDS = 'browser.brands';

/**
* The platform on which the browser is running.
*
* This value is intended to be taken from the UA client hints API (navigator.userAgentData.platform). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent.
* The list of possible values is defined in the W3C User-Agent Client Hints specification. Note that some (but not all) of these values can overlap with values in the os.type and os.name attributes. However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
*
* @example Windows
* @example macOS
* @example Android
*/
public const BROWSER_PLATFORM = 'browser.platform';

/**
* Full user-agent string provided by the browser.
*
* The user-agent value SHOULD be provided only from browsers that do not have a mechanism to retrieve brands and platform individually from the User-Agent Client Hints API. To retrieve the value, the legacy `navigator.userAgent` API can be used.
*
* @example Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36
*/
public const BROWSER_USER_AGENT = 'browser.user_agent';

/**
* Name of the cloud provider.
Expand Down Expand Up @@ -222,29 +254,43 @@ class ResourceAttributes
/**
* The name of the single function that this runtime instance executes.
*
* This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the `code.namespace`/`code.function` span attributes).
* This is the name of the function as configured/deployed on the FaaS
* platform and is usually different from the name of the callback
* function (which may be stored in the
* `code.namespace`/`code.function`
* span attributes).For some cloud providers, the above definition is ambiguous. The following
* definition of function name MUST be used for this attribute
* (and consequently the span name) for the listed cloud providers/products:<ul>
* <li><strong>Azure:</strong> The full name `<FUNCAPP>/<FUNC>`, i.e., function app name
* followed by a forward slash followed by the function name (this form
* can also be seen in the resource JSON for the function).
* This means that a span attribute MUST be used, as an Azure function
* app can host multiple functions that would usually share
* a TracerProvider (see also the `faas.id` attribute).</li>
* </ul>
*
* @example my-function
* @example myazurefunctionapp/some-function-name
*/
public const FAAS_NAME = 'faas.name';

/**
* The unique ID of the single function that this runtime instance executes.
*
* Depending on the cloud provider, use:<ul>
* <li><strong>AWS Lambda:</strong> The function ARN.</li>
* </ul>
* On some cloud providers, it may not be possible to determine the full ID at startup,
* so consider setting `faas.id` as a span attribute instead.The exact value to use for `faas.id` depends on the cloud provider:<ul>
* <li><strong>AWS Lambda:</strong> The function ARN.
* Take care not to use the &quot;invoked ARN&quot; directly but replace any
* alias suffix with the resolved function version, as the same runtime instance may be invokable with multiple
* different aliases.<ul>
* alias suffix
* with the resolved function version, as the same runtime instance may be invokable with
* multiple different aliases.</li>
* <li><strong>GCP:</strong> The URI of the resource</li>
* <li><strong>Azure:</strong> The Fully Qualified Resource ID.</li>
* <li><strong>Azure:</strong> The Fully Qualified Resource ID of the invoked function,
* <em>not</em> the function app, having the form
* `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
* This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
* a TracerProvider.</li>
* </ul>
* On some providers, it may not be possible to determine the full ID at startup,
* which is why this field cannot be made required. For example, on AWS the account ID
* part of the ARN is not available without calling another AWS API
* which may be deemed too slow for a short-running lambda function.
* As an alternative, consider setting `faas.id` as a span attribute instead.
*
* @example arn:aws:lambda:us-west-2:123456789012:function:my-function
*/
Expand Down
35 changes: 30 additions & 5 deletions src/SemConv/TraceAttributeValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

namespace OpenTelemetry\SemConv;

class TraceAttributeValues
interface TraceAttributeValues
{
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.9.0';
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.12.0';
/**
* @see TraceAttributes::OPENTRACING_REF_TYPE The parent Span depends on the child Span in some capacity
*/
Expand Down Expand Up @@ -390,20 +390,25 @@ class TraceAttributeValues
public const FAAS_DOCUMENT_OPERATION_DELETE = 'delete';

/**
* @see TraceAttributes::HTTP_FLAVOR HTTP 1.0
* @see TraceAttributes::HTTP_FLAVOR HTTP/1.0
*/
public const HTTP_FLAVOR_HTTP_1_0 = '1.0';

/**
* @see TraceAttributes::HTTP_FLAVOR HTTP 1.1
* @see TraceAttributes::HTTP_FLAVOR HTTP/1.1
*/
public const HTTP_FLAVOR_HTTP_1_1 = '1.1';

/**
* @see TraceAttributes::HTTP_FLAVOR HTTP 2
* @see TraceAttributes::HTTP_FLAVOR HTTP/2
*/
public const HTTP_FLAVOR_HTTP_2_0 = '2.0';

/**
* @see TraceAttributes::HTTP_FLAVOR HTTP/3
*/
public const HTTP_FLAVOR_HTTP_3_0 = '3.0';

/**
* @see TraceAttributes::HTTP_FLAVOR SPDY protocol
*/
Expand Down Expand Up @@ -579,6 +584,26 @@ class TraceAttributeValues
*/
public const FAAS_INVOKED_PROVIDER_TENCENT_CLOUD = 'tencent_cloud';

/**
* @see TraceAttributes::RPC_SYSTEM gRPC
*/
public const RPC_SYSTEM_GRPC = 'grpc';

/**
* @see TraceAttributes::RPC_SYSTEM Java RMI
*/
public const RPC_SYSTEM_JAVA_RMI = 'java_rmi';

/**
* @see TraceAttributes::RPC_SYSTEM .NET WCF
*/
public const RPC_SYSTEM_DOTNET_WCF = 'dotnet_wcf';

/**
* @see TraceAttributes::RPC_SYSTEM Apache Dubbo
*/
public const RPC_SYSTEM_APACHE_DUBBO = 'apache_dubbo';

/**
* @see TraceAttributes::MESSAGING_OPERATION receive
*/
Expand Down
52 changes: 50 additions & 2 deletions src/SemConv/TraceAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

namespace OpenTelemetry\SemConv;

class TraceAttributes
interface TraceAttributes
{
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.9.0';
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.12.0';

/**
* The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).
Expand All @@ -22,6 +22,45 @@ class TraceAttributes
*/
public const AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn';

/**
* The event_id uniquely identifies the event.
*
* @example 123e4567-e89b-12d3-a456-426614174000
* @example 0001
*/
public const CLOUDEVENTS_EVENT_ID = 'cloudevents.event_id';

/**
* The source identifies the context in which an event happened.
*
* @example https://github.com/cloudevents
* @example /cloudevents/spec/pull/123
* @example my-service
*/
public const CLOUDEVENTS_EVENT_SOURCE = 'cloudevents.event_source';

/**
* The version of the CloudEvents specification which the event uses.
*
* @example 1.0
*/
public const CLOUDEVENTS_EVENT_SPEC_VERSION = 'cloudevents.event_spec_version';

/**
* The event_type contains a value describing the type of event related to the originating occurrence.
*
* @example com.github.pull_request.opened
* @example com.example.object.deleted.v2
*/
public const CLOUDEVENTS_EVENT_TYPE = 'cloudevents.event_type';

/**
* The subject of the event in the context of the event producer (identified by source).
*
* @example mynewfile.jpg
*/
public const CLOUDEVENTS_EVENT_SUBJECT = 'cloudevents.event_subject';

/**
* Parent-child Reference type.
*
Expand Down Expand Up @@ -91,6 +130,8 @@ class TraceAttributes
/**
* Remote hostname or similar, see note below.
*
* `net.peer.name` SHOULD NOT be set if capturing it would require an extra DNS lookup.
*
* @example example.com
*/
public const NET_PEER_NAME = 'net.peer.name';
Expand Down Expand Up @@ -378,6 +419,13 @@ class TraceAttributes
*/
public const HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed';

/**
* The ordinal number of request re-sending attempt.
*
* @example 3
*/
public const 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 ( `net.host.name` should be used instead).
*
Expand Down
2 changes: 1 addition & 1 deletion src/SemConv/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"autoload": {
"psr-4": {
"OpenTelemetry\\SemConv\\": ""
"OpenTelemetry\\SemConv\\": "."
}
}
}

0 comments on commit 7e6837d

Please sign in to comment.