Use weaver to generate latest semconv 1.27 (#4690)
Co-authored-by: Trent Mick <trentm@gmail.com> Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
This commit is contained in:
parent
38f6689480
commit
01cea7caeb
|
@ -13,6 +13,9 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
|
|||
### :rocket: (Enhancement)
|
||||
|
||||
* feat: include instrumentation scope info in console span and log record exporters [#4848](https://github.com/open-telemetry/opentelemetry-js/pull/4848) @blumamir
|
||||
* feat(semconv): update semantic conventions to 1.27 (from 1.7.0) [#4690](https://github.com/open-telemetry/opentelemetry-js/pull/4690) @dyladan
|
||||
* Exported names have changed to `ATTR_{name}` for attributes (e.g. `ATTR_HTTP_REQUEST_METHOD`), `{name}_VALUE_{value}` for enumeration values (e.g. `HTTP_REQUEST_METHOD_VALUE_POST`), and `METRIC_{name}` for metrics. Exported names from previous versions are deprecated.
|
||||
* Import `@opentelemetry/semantic-conventions` for *stable* semantic conventions. Import `@opentelemetry/semantic-conventions/incubating` for all semantic conventions, stable and unstable.
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
|
|
|
@ -11,14 +11,51 @@ Semantic Convention constants for use with the OpenTelemetry SDK/APIs. [This doc
|
|||
npm install --save @opentelemetry/semantic-conventions
|
||||
```
|
||||
|
||||
## Import Structure
|
||||
|
||||
This package has 2 separate exports.
|
||||
The main export (`@opentelemetry/semantic-conventions`) includes only stable semantic conventions.
|
||||
It is subject to the restrictions of semantic versioning 2.0.
|
||||
The `/incubating` export (`@opentelemetry/semantic-conventions/incubating`) contains all stable and unstable semantic conventions.
|
||||
It is _NOT_ subject to the restrictions of semantic versioning and _MAY_ contain breaking changes in minor releases.
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
|
||||
### Stable SemConv
|
||||
|
||||
const span = tracer.startSpan().startSpan(spanName, spanOptions)
|
||||
```ts
|
||||
import {
|
||||
ATTR_NETWORK_PEER_ADDRESS,
|
||||
ATTR_NETWORK_PEER_PORT,
|
||||
ATTR_NETWORK_PROTOCOL_NAME,
|
||||
ATTR_NETWORK_PROTOCOL_VERSION,
|
||||
NETWORK_TRANSPORT_VALUE_TCP,
|
||||
} from '@opentelemetry/semantic-conventions';
|
||||
|
||||
const span = tracer.startSpan(spanName, spanOptions)
|
||||
.setAttributes({
|
||||
[SemanticAttributes.NET_PEER_NAME]: 'localhost',
|
||||
[ATTR_NETWORK_PEER_ADDRESS]: 'localhost',
|
||||
[ATTR_NETWORK_PEER_PORT]: 8080,
|
||||
[ATTR_NETWORK_PROTOCOL_NAME]: 'http',
|
||||
[ATTR_NETWORK_PROTOCOL_VERSION]: '1.1',
|
||||
[ATTR_NETWORK_TRANSPORT]: NETWORK_TRANSPORT_VALUE_TCP,
|
||||
});
|
||||
```
|
||||
|
||||
### Unstable SemConv
|
||||
|
||||
```ts
|
||||
import {
|
||||
ATTR_PROCESS_COMMAND,
|
||||
ATTR_PROCESS_COMMAND_ARGS,
|
||||
ATTR_PROCESS_COMMAND_LINE,
|
||||
} from '@opentelemetry/semantic-conventions/incubating';
|
||||
|
||||
const span = tracer.startSpan(spanName, spanOptions)
|
||||
.setAttributes({
|
||||
[ATTR_PROCESS_COMMAND]: 'cat',
|
||||
[ATTR_PROCESS_COMMAND_ARGS]: ['file1', 'file2'],
|
||||
[ATTR_CONTAINER_COMMAND_LINE]: 'cat file1 file2',
|
||||
});
|
||||
```
|
||||
|
||||
|
|
|
@ -6,13 +6,35 @@
|
|||
"module": "build/esm/index.js",
|
||||
"esnext": "build/esnext/index.js",
|
||||
"types": "build/src/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"module": "./build/esm/index.js",
|
||||
"esnext": "./build/esnext/index.js",
|
||||
"types": "./build/src/index.d.ts",
|
||||
"default": "./build/src/index.js"
|
||||
},
|
||||
"./incubating": {
|
||||
"module": "./build/esm/index-incubating.js",
|
||||
"esnext": "./build/esnext/index-incubating.js",
|
||||
"types": "./build/src/index-incubating.d.ts",
|
||||
"default": "./build/src/index-incubating.js"
|
||||
}
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./build/src/index.d.ts"
|
||||
],
|
||||
"incubating": [
|
||||
"./build/src/index-incubating.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"repository": "open-telemetry/opentelemetry-js",
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run compile",
|
||||
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
||||
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"lint:fix": "eslint . --ext .ts --fix",
|
||||
"version": "node ../../scripts/version-update.js",
|
||||
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
||||
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Incubating export also contains stable constants in order to maintain
|
||||
// backward compatibility between minor version releases
|
||||
export * from './stable_attributes';
|
||||
export * from './stable_metrics';
|
||||
export * from './experimental_attributes';
|
||||
export * from './experimental_metrics';
|
|
@ -14,5 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Deprecated. These are kept around for compatibility purposes
|
||||
export * from './trace';
|
||||
export * from './resource';
|
||||
|
||||
// Use these instead
|
||||
export * from './stable_attributes';
|
||||
export * from './stable_metrics';
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,866 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Rate-limiting result, shows whether the lease was acquired or contains a rejection reason
|
||||
*
|
||||
* @example acquired
|
||||
*
|
||||
* @example request_canceled
|
||||
*/
|
||||
export const ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result' as const;
|
||||
|
||||
/**
|
||||
* Enum value "acquired" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired" as const;
|
||||
|
||||
/**
|
||||
* Enum value "endpoint_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter" as const;
|
||||
|
||||
/**
|
||||
* Enum value "global_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter" as const;
|
||||
|
||||
/**
|
||||
* Enum value "request_canceled" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled" as const;
|
||||
|
||||
/**
|
||||
* The language of the telemetry SDK.
|
||||
*/
|
||||
export const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language' as const;
|
||||
|
||||
/**
|
||||
* Enum value "cpp" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp" as const;
|
||||
|
||||
/**
|
||||
* Enum value "dotnet" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet" as const;
|
||||
|
||||
/**
|
||||
* Enum value "erlang" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang" as const;
|
||||
|
||||
/**
|
||||
* Enum value "go" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go" as const;
|
||||
|
||||
/**
|
||||
* Enum value "java" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java" as const;
|
||||
|
||||
/**
|
||||
* Enum value "nodejs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs" as const;
|
||||
|
||||
/**
|
||||
* Enum value "php" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php" as const;
|
||||
|
||||
/**
|
||||
* Enum value "python" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python" as const;
|
||||
|
||||
/**
|
||||
* Enum value "ruby" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby" as const;
|
||||
|
||||
/**
|
||||
* Enum value "rust" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust" as const;
|
||||
|
||||
/**
|
||||
* Enum value "swift" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift" as const;
|
||||
|
||||
/**
|
||||
* Enum value "webjs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
|
||||
*/
|
||||
export const TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs" as const;
|
||||
|
||||
/**
|
||||
* The name of the telemetry SDK as defined above.
|
||||
*
|
||||
* @example opentelemetry
|
||||
*
|
||||
* @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`.
|
||||
* If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the
|
||||
* `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point
|
||||
* or another suitable identifier depending on the language.
|
||||
* The identifier `opentelemetry` is reserved and **MUST** **NOT** be used in this case.
|
||||
* All custom identifiers **SHOULD** be stable across different versions of an implementation.
|
||||
*/
|
||||
export const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name' as const;
|
||||
|
||||
/**
|
||||
* The version string of the telemetry SDK.
|
||||
*
|
||||
* @example 1.2.3
|
||||
*/
|
||||
export const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version' as const;
|
||||
|
||||
/**
|
||||
* Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception.
|
||||
*
|
||||
* @example Contoso.MyHandler
|
||||
*/
|
||||
export const ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type' as const;
|
||||
|
||||
/**
|
||||
* ASP.NET Core exception middleware handling result
|
||||
*
|
||||
* @example handled
|
||||
*
|
||||
* @example unhandled
|
||||
*/
|
||||
export const ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result' as const;
|
||||
|
||||
/**
|
||||
* Enum value "aborted" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted" as const;
|
||||
|
||||
/**
|
||||
* Enum value "handled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled" as const;
|
||||
|
||||
/**
|
||||
* Enum value "skipped" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped" as const;
|
||||
|
||||
/**
|
||||
* Enum value "unhandled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.
|
||||
*/
|
||||
export const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled" as const;
|
||||
|
||||
/**
|
||||
* Rate limiting policy name.
|
||||
*
|
||||
* @example fixed
|
||||
*
|
||||
* @example sliding
|
||||
*
|
||||
* @example token
|
||||
*/
|
||||
export const ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy' as const;
|
||||
|
||||
/**
|
||||
* Flag indicating if request was handled by the application pipeline.
|
||||
*
|
||||
* @example true
|
||||
*/
|
||||
export const ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled' as const;
|
||||
|
||||
/**
|
||||
* A value that indicates whether the matched route is a fallback route.
|
||||
*
|
||||
* @example true
|
||||
*/
|
||||
export const ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback' as const;
|
||||
|
||||
/**
|
||||
* Match result - success or failure
|
||||
*
|
||||
* @example success
|
||||
*
|
||||
* @example failure
|
||||
*/
|
||||
export const ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status' as const;
|
||||
|
||||
/**
|
||||
* Enum value "failure" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.
|
||||
*/
|
||||
export const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure" as const;
|
||||
|
||||
/**
|
||||
* Enum value "success" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.
|
||||
*/
|
||||
export const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success" as const;
|
||||
|
||||
/**
|
||||
* Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
|
||||
*
|
||||
* @example client.example.com
|
||||
*
|
||||
* @example 10.1.2.80
|
||||
*
|
||||
* @example /tmp/my.sock
|
||||
*
|
||||
* @note When observed from the server side, and when communicating through an intermediary, `client.address` **SHOULD** represent the client address behind any intermediaries, for example proxies, if it's available.
|
||||
*/
|
||||
export const ATTR_CLIENT_ADDRESS = 'client.address' as const;
|
||||
|
||||
/**
|
||||
* Client port number.
|
||||
*
|
||||
* @example 65123
|
||||
*
|
||||
* @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries, for example proxies, if it's available.
|
||||
*/
|
||||
export const ATTR_CLIENT_PORT = 'client.port' as const;
|
||||
|
||||
/**
|
||||
* Describes a class of error the operation ended with.
|
||||
*
|
||||
* @example timeout
|
||||
*
|
||||
* @example java.net.UnknownHostException
|
||||
*
|
||||
* @example server_certificate_invalid
|
||||
*
|
||||
* @example 500
|
||||
*
|
||||
* @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.
|
||||
*
|
||||
* When `error.type` is set to a type (e.g., an exception type), its
|
||||
* canonical class name identifying the type within the artifact **SHOULD** be used.
|
||||
*
|
||||
* Instrumentations **SHOULD** document the list of errors they report.
|
||||
*
|
||||
* The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
|
||||
* Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
|
||||
* should be prepared for `error.type` to have high cardinality at query time when no
|
||||
* additional filters are applied.
|
||||
*
|
||||
* If the operation has completed successfully, instrumentations **SHOULD** **NOT** set `error.type`.
|
||||
*
|
||||
* If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
|
||||
* it's RECOMMENDED to:
|
||||
*
|
||||
* * Use a domain-specific attribute
|
||||
* * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
|
||||
*/
|
||||
export const ATTR_ERROR_TYPE = 'error.type' as const;
|
||||
|
||||
/**
|
||||
* Enum value "_OTHER" for attribute {@link ATTR_ERROR_TYPE}.
|
||||
*/
|
||||
export const ERROR_TYPE_VALUE_OTHER = "_OTHER" as const;
|
||||
|
||||
/**
|
||||
* **SHOULD** be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.
|
||||
*
|
||||
* @note An exception is considered to have escaped (or left) the scope of a span,
|
||||
* if that span is ended while the exception is still logically "in flight".
|
||||
* This may be actually "in flight" in some languages (e.g. if the exception
|
||||
* is passed to a Context manager's `__exit__` method in Python) but will
|
||||
* usually be caught at the point of recording the exception in most languages.
|
||||
*
|
||||
* It is usually not possible to determine at the point where an exception is thrown
|
||||
* whether it will escape the scope of a span.
|
||||
* However, it is trivial to know that an exception
|
||||
* will escape, if one checks for an active exception just before ending the span,
|
||||
* as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception).
|
||||
*
|
||||
* It follows that an exception may still escape the scope of the span
|
||||
* even if the `exception.escaped` attribute was not set or set to false,
|
||||
* since the event might have been recorded at a time where it was not
|
||||
* clear whether the exception will escape.
|
||||
*/
|
||||
export const ATTR_EXCEPTION_ESCAPED = 'exception.escaped' as const;
|
||||
|
||||
/**
|
||||
* The exception message.
|
||||
*
|
||||
* @example Division by zero
|
||||
*
|
||||
* @example Can't convert 'int' object to str implicitly
|
||||
*/
|
||||
export const ATTR_EXCEPTION_MESSAGE = 'exception.message' as const;
|
||||
|
||||
/**
|
||||
* A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.
|
||||
*
|
||||
* @example "Exception in thread \"main\" java.lang.RuntimeException: Test exception\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)"
|
||||
*/
|
||||
export const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace' as const;
|
||||
|
||||
/**
|
||||
* The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.
|
||||
*
|
||||
* @example java.net.ConnectException
|
||||
*
|
||||
* @example OSError
|
||||
*/
|
||||
export const ATTR_EXCEPTION_TYPE = 'exception.type' as const;
|
||||
|
||||
/**
|
||||
* HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.
|
||||
*
|
||||
* @example http.request.header.content-type=["application/json"]
|
||||
*
|
||||
* @example http.request.header.x-forwarded-for=["1.2.3.4", "1.2.3.5"]
|
||||
*
|
||||
* @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.
|
||||
* The `User-Agent` header is already captured in the `user_agent.original` attribute. Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.
|
||||
* The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.
|
||||
*/
|
||||
export const ATTR_HTTP_REQUEST_HEADER = (key: string) => `http.request.header.${key}`;
|
||||
|
||||
/**
|
||||
* HTTP request method.
|
||||
*
|
||||
* @example GET
|
||||
*
|
||||
* @example POST
|
||||
*
|
||||
* @example HEAD
|
||||
*
|
||||
* @note HTTP request method value **SHOULD** be "known" to the instrumentation.
|
||||
* By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
|
||||
* and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
|
||||
*
|
||||
* If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`.
|
||||
*
|
||||
* If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override
|
||||
* the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named
|
||||
* OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods
|
||||
* (this list **MUST** be a full override of the default known method, it is not a list of known methods in addition to the defaults).
|
||||
*
|
||||
* HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly.
|
||||
* Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent.
|
||||
* Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value.
|
||||
*/
|
||||
export const ATTR_HTTP_REQUEST_METHOD = 'http.request.method' as const;
|
||||
|
||||
/**
|
||||
* Enum value "_OTHER" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER" as const;
|
||||
|
||||
/**
|
||||
* Enum value "CONNECT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT" as const;
|
||||
|
||||
/**
|
||||
* Enum value "DELETE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE" as const;
|
||||
|
||||
/**
|
||||
* Enum value "GET" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_GET = "GET" as const;
|
||||
|
||||
/**
|
||||
* Enum value "HEAD" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD" as const;
|
||||
|
||||
/**
|
||||
* Enum value "OPTIONS" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS" as const;
|
||||
|
||||
/**
|
||||
* Enum value "PATCH" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH" as const;
|
||||
|
||||
/**
|
||||
* Enum value "POST" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_POST = "POST" as const;
|
||||
|
||||
/**
|
||||
* Enum value "PUT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_PUT = "PUT" as const;
|
||||
|
||||
/**
|
||||
* Enum value "TRACE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.
|
||||
*/
|
||||
export const HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE" as const;
|
||||
|
||||
/**
|
||||
* Original HTTP method sent by the client in the request line.
|
||||
*
|
||||
* @example GeT
|
||||
*
|
||||
* @example ACL
|
||||
*
|
||||
* @example foo
|
||||
*/
|
||||
export const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original' as const;
|
||||
|
||||
/**
|
||||
* The ordinal number of request resending attempt (for any reason, including redirects).
|
||||
*
|
||||
* @example 3
|
||||
*
|
||||
* @note The resend count **SHOULD** be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).
|
||||
*/
|
||||
export const ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count' as const;
|
||||
|
||||
/**
|
||||
* HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.
|
||||
*
|
||||
* @example http.response.header.content-type=["application/json"]
|
||||
*
|
||||
* @example http.response.header.my-custom-header=["abc", "def"]
|
||||
*
|
||||
* @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.
|
||||
* Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.
|
||||
* The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.
|
||||
*/
|
||||
export const ATTR_HTTP_RESPONSE_HEADER = (key: string) => `http.response.header.${key}`;
|
||||
|
||||
/**
|
||||
* [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
|
||||
*
|
||||
* @example 200
|
||||
*/
|
||||
export const ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code' as const;
|
||||
|
||||
/**
|
||||
* The matched route, that is, the path template in the format used by the respective server framework.
|
||||
*
|
||||
* @example /users/:userID?
|
||||
*
|
||||
* @example {controller}/{action}/{id?}
|
||||
*
|
||||
* @note 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.
|
||||
* SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.
|
||||
*/
|
||||
export const ATTR_HTTP_ROUTE = 'http.route' as const;
|
||||
|
||||
/**
|
||||
* Name of the garbage collector action.
|
||||
*
|
||||
* @example end of minor GC
|
||||
*
|
||||
* @example end of major GC
|
||||
*
|
||||
* @note Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).
|
||||
*/
|
||||
export const ATTR_JVM_GC_ACTION = 'jvm.gc.action' as const;
|
||||
|
||||
/**
|
||||
* Name of the garbage collector.
|
||||
*
|
||||
* @example G1 Young Generation
|
||||
*
|
||||
* @example G1 Old Generation
|
||||
*
|
||||
* @note Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).
|
||||
*/
|
||||
export const ATTR_JVM_GC_NAME = 'jvm.gc.name' as const;
|
||||
|
||||
/**
|
||||
* Name of the memory pool.
|
||||
*
|
||||
* @example G1 Old Gen
|
||||
*
|
||||
* @example G1 Eden space
|
||||
*
|
||||
* @example G1 Survivor Space
|
||||
*
|
||||
* @note Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
|
||||
*/
|
||||
export const ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name' as const;
|
||||
|
||||
/**
|
||||
* The type of memory.
|
||||
*
|
||||
* @example heap
|
||||
*
|
||||
* @example non_heap
|
||||
*/
|
||||
export const ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type' as const;
|
||||
|
||||
/**
|
||||
* Enum value "heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}.
|
||||
*/
|
||||
export const JVM_MEMORY_TYPE_VALUE_HEAP = "heap" as const;
|
||||
|
||||
/**
|
||||
* Enum value "non_heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}.
|
||||
*/
|
||||
export const JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap" as const;
|
||||
|
||||
/**
|
||||
* Whether the thread is daemon or not.
|
||||
*/
|
||||
export const ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon' as const;
|
||||
|
||||
/**
|
||||
* State of the thread.
|
||||
*
|
||||
* @example runnable
|
||||
*
|
||||
* @example blocked
|
||||
*/
|
||||
export const ATTR_JVM_THREAD_STATE = 'jvm.thread.state' as const;
|
||||
|
||||
/**
|
||||
* Enum value "blocked" for attribute {@link ATTR_JVM_THREAD_STATE}.
|
||||
*/
|
||||
export const JVM_THREAD_STATE_VALUE_BLOCKED = "blocked" as const;
|
||||
|
||||
/**
|
||||
* Enum value "new" for attribute {@link ATTR_JVM_THREAD_STATE}.
|
||||
*/
|
||||
export const JVM_THREAD_STATE_VALUE_NEW = "new" as const;
|
||||
|
||||
/**
|
||||
* Enum value "runnable" for attribute {@link ATTR_JVM_THREAD_STATE}.
|
||||
*/
|
||||
export const JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable" as const;
|
||||
|
||||
/**
|
||||
* Enum value "terminated" for attribute {@link ATTR_JVM_THREAD_STATE}.
|
||||
*/
|
||||
export const JVM_THREAD_STATE_VALUE_TERMINATED = "terminated" as const;
|
||||
|
||||
/**
|
||||
* Enum value "timed_waiting" for attribute {@link ATTR_JVM_THREAD_STATE}.
|
||||
*/
|
||||
export const JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting" as const;
|
||||
|
||||
/**
|
||||
* Enum value "waiting" for attribute {@link ATTR_JVM_THREAD_STATE}.
|
||||
*/
|
||||
export const JVM_THREAD_STATE_VALUE_WAITING = "waiting" as const;
|
||||
|
||||
/**
|
||||
* Local address of the network connection - IP address or Unix domain socket name.
|
||||
*
|
||||
* @example 10.1.2.80
|
||||
*
|
||||
* @example /tmp/my.sock
|
||||
*/
|
||||
export const ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address' as const;
|
||||
|
||||
/**
|
||||
* Local port number of the network connection.
|
||||
*
|
||||
* @example 65123
|
||||
*/
|
||||
export const ATTR_NETWORK_LOCAL_PORT = 'network.local.port' as const;
|
||||
|
||||
/**
|
||||
* Peer address of the network connection - IP address or Unix domain socket name.
|
||||
*
|
||||
* @example 10.1.2.80
|
||||
*
|
||||
* @example /tmp/my.sock
|
||||
*/
|
||||
export const ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address' as const;
|
||||
|
||||
/**
|
||||
* Peer port number of the network connection.
|
||||
*
|
||||
* @example 65123
|
||||
*/
|
||||
export const ATTR_NETWORK_PEER_PORT = 'network.peer.port' as const;
|
||||
|
||||
/**
|
||||
* [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.
|
||||
*
|
||||
* @example amqp
|
||||
*
|
||||
* @example http
|
||||
*
|
||||
* @example mqtt
|
||||
*
|
||||
* @note The value **SHOULD** be normalized to lowercase.
|
||||
*/
|
||||
export const ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name' as const;
|
||||
|
||||
/**
|
||||
* The actual version of the protocol used for network communication.
|
||||
*
|
||||
* @example 1.1
|
||||
*
|
||||
* @example 2
|
||||
*
|
||||
* @note If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute **SHOULD** be set to the negotiated version. If the actual protocol version is not known, this attribute **SHOULD** **NOT** be set.
|
||||
*/
|
||||
export const ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version' as const;
|
||||
|
||||
/**
|
||||
* [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).
|
||||
*
|
||||
* @example tcp
|
||||
*
|
||||
* @example udp
|
||||
*
|
||||
* @note The value **SHOULD** be normalized to lowercase.
|
||||
*
|
||||
* Consider always setting the transport when setting a port number, since
|
||||
* a port number is ambiguous without knowing the transport. For example
|
||||
* different processes could be listening on TCP port 12345 and UDP port 12345.
|
||||
*/
|
||||
export const ATTR_NETWORK_TRANSPORT = 'network.transport' as const;
|
||||
|
||||
/**
|
||||
* Enum value "pipe" for attribute {@link ATTR_NETWORK_TRANSPORT}.
|
||||
*/
|
||||
export const NETWORK_TRANSPORT_VALUE_PIPE = "pipe" as const;
|
||||
|
||||
/**
|
||||
* Enum value "quic" for attribute {@link ATTR_NETWORK_TRANSPORT}.
|
||||
*/
|
||||
export const NETWORK_TRANSPORT_VALUE_QUIC = "quic" as const;
|
||||
|
||||
/**
|
||||
* Enum value "tcp" for attribute {@link ATTR_NETWORK_TRANSPORT}.
|
||||
*/
|
||||
export const NETWORK_TRANSPORT_VALUE_TCP = "tcp" as const;
|
||||
|
||||
/**
|
||||
* Enum value "udp" for attribute {@link ATTR_NETWORK_TRANSPORT}.
|
||||
*/
|
||||
export const NETWORK_TRANSPORT_VALUE_UDP = "udp" as const;
|
||||
|
||||
/**
|
||||
* Enum value "unix" for attribute {@link ATTR_NETWORK_TRANSPORT}.
|
||||
*/
|
||||
export const NETWORK_TRANSPORT_VALUE_UNIX = "unix" as const;
|
||||
|
||||
/**
|
||||
* [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.
|
||||
*
|
||||
* @example ipv4
|
||||
*
|
||||
* @example ipv6
|
||||
*
|
||||
* @note The value **SHOULD** be normalized to lowercase.
|
||||
*/
|
||||
export const ATTR_NETWORK_TYPE = 'network.type' as const;
|
||||
|
||||
/**
|
||||
* Enum value "ipv4" for attribute {@link ATTR_NETWORK_TYPE}.
|
||||
*/
|
||||
export const NETWORK_TYPE_VALUE_IPV4 = "ipv4" as const;
|
||||
|
||||
/**
|
||||
* Enum value "ipv6" for attribute {@link ATTR_NETWORK_TYPE}.
|
||||
*/
|
||||
export const NETWORK_TYPE_VALUE_IPV6 = "ipv6" as const;
|
||||
|
||||
/**
|
||||
* The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).
|
||||
*
|
||||
* @example io.opentelemetry.contrib.mongodb
|
||||
*/
|
||||
export const ATTR_OTEL_SCOPE_NAME = 'otel.scope.name' as const;
|
||||
|
||||
/**
|
||||
* The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
|
||||
*
|
||||
* @example 1.0.0
|
||||
*/
|
||||
export const ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version' as const;
|
||||
|
||||
/**
|
||||
* Name of the code, either "OK" or "ERROR". **MUST** **NOT** be set if the status code is UNSET.
|
||||
*/
|
||||
export const ATTR_OTEL_STATUS_CODE = 'otel.status_code' as const;
|
||||
|
||||
/**
|
||||
* Enum value "ERROR" for attribute {@link ATTR_OTEL_STATUS_CODE}.
|
||||
*/
|
||||
export const OTEL_STATUS_CODE_VALUE_ERROR = "ERROR" as const;
|
||||
|
||||
/**
|
||||
* Enum value "OK" for attribute {@link ATTR_OTEL_STATUS_CODE}.
|
||||
*/
|
||||
export const OTEL_STATUS_CODE_VALUE_OK = "OK" as const;
|
||||
|
||||
/**
|
||||
* Description of the Status if it has a value, otherwise not set.
|
||||
*
|
||||
* @example resource not found
|
||||
*/
|
||||
export const ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description' as const;
|
||||
|
||||
/**
|
||||
* Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
|
||||
*
|
||||
* @example example.com
|
||||
*
|
||||
* @example 10.1.2.80
|
||||
*
|
||||
* @example /tmp/my.sock
|
||||
*
|
||||
* @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.
|
||||
*/
|
||||
export const ATTR_SERVER_ADDRESS = 'server.address' as const;
|
||||
|
||||
/**
|
||||
* Server port number.
|
||||
*
|
||||
* @example 80
|
||||
*
|
||||
* @example 8080
|
||||
*
|
||||
* @example 443
|
||||
*
|
||||
* @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.
|
||||
*/
|
||||
export const ATTR_SERVER_PORT = 'server.port' as const;
|
||||
|
||||
/**
|
||||
* Logical name of the service.
|
||||
*
|
||||
* @example shoppingcart
|
||||
*
|
||||
* @note MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value **MUST** be set to `unknown_service`.
|
||||
*/
|
||||
export const ATTR_SERVICE_NAME = 'service.name' as const;
|
||||
|
||||
/**
|
||||
* The version string of the service API or implementation. The format is not defined by these conventions.
|
||||
*
|
||||
* @example 2.0.0
|
||||
*
|
||||
* @example a01dbef8a
|
||||
*/
|
||||
export const ATTR_SERVICE_VERSION = 'service.version' as const;
|
||||
|
||||
/**
|
||||
* SignalR HTTP connection closure status.
|
||||
*
|
||||
* @example app_shutdown
|
||||
*
|
||||
* @example timeout
|
||||
*/
|
||||
export const ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status' as const;
|
||||
|
||||
/**
|
||||
* Enum value "app_shutdown" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.
|
||||
*/
|
||||
export const SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown" as const;
|
||||
|
||||
/**
|
||||
* Enum value "normal_closure" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.
|
||||
*/
|
||||
export const SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure" as const;
|
||||
|
||||
/**
|
||||
* Enum value "timeout" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.
|
||||
*/
|
||||
export const SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout" as const;
|
||||
|
||||
/**
|
||||
* [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)
|
||||
*
|
||||
* @example web_sockets
|
||||
*
|
||||
* @example long_polling
|
||||
*/
|
||||
export const ATTR_SIGNALR_TRANSPORT = 'signalr.transport' as const;
|
||||
|
||||
/**
|
||||
* Enum value "long_polling" for attribute {@link ATTR_SIGNALR_TRANSPORT}.
|
||||
*/
|
||||
export const SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling" as const;
|
||||
|
||||
/**
|
||||
* Enum value "server_sent_events" for attribute {@link ATTR_SIGNALR_TRANSPORT}.
|
||||
*/
|
||||
export const SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events" as const;
|
||||
|
||||
/**
|
||||
* Enum value "web_sockets" for attribute {@link ATTR_SIGNALR_TRANSPORT}.
|
||||
*/
|
||||
export const SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets" as const;
|
||||
|
||||
/**
|
||||
* The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
|
||||
*
|
||||
* @example SemConv
|
||||
*/
|
||||
export const ATTR_URL_FRAGMENT = 'url.fragment' as const;
|
||||
|
||||
/**
|
||||
* Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
|
||||
*
|
||||
* @example https://www.foo.bar/search?q=OpenTelemetry#SemConv
|
||||
*
|
||||
* @example //localhost
|
||||
*
|
||||
* @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless.
|
||||
* `url.full` **MUST** **NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`.
|
||||
* `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it.
|
||||
*/
|
||||
export const ATTR_URL_FULL = 'url.full' as const;
|
||||
|
||||
/**
|
||||
* The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
|
||||
*
|
||||
* @example /search
|
||||
*
|
||||
* @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it.
|
||||
*/
|
||||
export const ATTR_URL_PATH = 'url.path' as const;
|
||||
|
||||
/**
|
||||
* The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
|
||||
*
|
||||
* @example q=OpenTelemetry
|
||||
*
|
||||
* @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it.
|
||||
*/
|
||||
export const ATTR_URL_QUERY = 'url.query' as const;
|
||||
|
||||
/**
|
||||
* The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.
|
||||
*
|
||||
* @example https
|
||||
*
|
||||
* @example ftp
|
||||
*
|
||||
* @example telnet
|
||||
*/
|
||||
export const ATTR_URL_SCHEME = 'url.scheme' as const;
|
||||
|
||||
/**
|
||||
* Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.
|
||||
*
|
||||
* @example CERN-LineMode/2.15 libwww/2.17b3
|
||||
*
|
||||
* @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1
|
||||
*
|
||||
* @example YourApp/1.0.0 grpc-java-okhttp/1.27.2
|
||||
*/
|
||||
export const ATTR_USER_AGENT_ORIGINAL = 'user_agent.original' as const;
|
||||
|
|
@ -0,0 +1,219 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Number of exceptions caught by exception handling middleware.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Diagnostics`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = 'aspnetcore.diagnostics.exceptions' as const;
|
||||
|
||||
/**
|
||||
* Number of requests that are currently active on the server that hold a rate limiting lease.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = 'aspnetcore.rate_limiting.active_request_leases' as const;
|
||||
|
||||
/**
|
||||
* Number of requests that are currently queued, waiting to acquire a rate limiting lease.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = 'aspnetcore.rate_limiting.queued_requests' as const;
|
||||
|
||||
/**
|
||||
* The time the request spent in a queue waiting to acquire a rate limiting lease.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = 'aspnetcore.rate_limiting.request.time_in_queue' as const;
|
||||
|
||||
/**
|
||||
* The duration of rate limiting lease held by requests on the server.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = 'aspnetcore.rate_limiting.request_lease.duration' as const;
|
||||
|
||||
/**
|
||||
* Number of requests that tried to acquire a rate limiting lease.
|
||||
*
|
||||
* @note Requests could be:
|
||||
*
|
||||
* * Rejected by global or endpoint rate limiting policies
|
||||
* * Canceled while waiting for the lease.
|
||||
*
|
||||
* Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = 'aspnetcore.rate_limiting.requests' as const;
|
||||
|
||||
/**
|
||||
* Number of requests that were attempted to be matched to an endpoint.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Routing`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = 'aspnetcore.routing.match_attempts' as const;
|
||||
|
||||
/**
|
||||
* Duration of HTTP client requests.
|
||||
*/
|
||||
export const METRIC_HTTP_CLIENT_REQUEST_DURATION = 'http.client.request.duration' as const;
|
||||
|
||||
/**
|
||||
* Duration of HTTP server requests.
|
||||
*/
|
||||
export const METRIC_HTTP_SERVER_REQUEST_DURATION = 'http.server.request.duration' as const;
|
||||
|
||||
/**
|
||||
* Number of classes currently loaded.
|
||||
*/
|
||||
export const METRIC_JVM_CLASS_COUNT = 'jvm.class.count' as const;
|
||||
|
||||
/**
|
||||
* Number of classes loaded since JVM start.
|
||||
*/
|
||||
export const METRIC_JVM_CLASS_LOADED = 'jvm.class.loaded' as const;
|
||||
|
||||
/**
|
||||
* Number of classes unloaded since JVM start.
|
||||
*/
|
||||
export const METRIC_JVM_CLASS_UNLOADED = 'jvm.class.unloaded' as const;
|
||||
|
||||
/**
|
||||
* Number of processors available to the Java virtual machine.
|
||||
*/
|
||||
export const METRIC_JVM_CPU_COUNT = 'jvm.cpu.count' as const;
|
||||
|
||||
/**
|
||||
* Recent CPU utilization for the process as reported by the JVM.
|
||||
*
|
||||
* @note The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()).
|
||||
*/
|
||||
export const METRIC_JVM_CPU_RECENT_UTILIZATION = 'jvm.cpu.recent_utilization' as const;
|
||||
|
||||
/**
|
||||
* CPU time used by the process as reported by the JVM.
|
||||
*/
|
||||
export const METRIC_JVM_CPU_TIME = 'jvm.cpu.time' as const;
|
||||
|
||||
/**
|
||||
* Duration of JVM garbage collection actions.
|
||||
*/
|
||||
export const METRIC_JVM_GC_DURATION = 'jvm.gc.duration' as const;
|
||||
|
||||
/**
|
||||
* Measure of memory committed.
|
||||
*/
|
||||
export const METRIC_JVM_MEMORY_COMMITTED = 'jvm.memory.committed' as const;
|
||||
|
||||
/**
|
||||
* Measure of max obtainable memory.
|
||||
*/
|
||||
export const METRIC_JVM_MEMORY_LIMIT = 'jvm.memory.limit' as const;
|
||||
|
||||
/**
|
||||
* Measure of memory used.
|
||||
*/
|
||||
export const METRIC_JVM_MEMORY_USED = 'jvm.memory.used' as const;
|
||||
|
||||
/**
|
||||
* Measure of memory used, as measured after the most recent garbage collection event on this pool.
|
||||
*/
|
||||
export const METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = 'jvm.memory.used_after_last_gc' as const;
|
||||
|
||||
/**
|
||||
* Number of executing platform threads.
|
||||
*/
|
||||
export const METRIC_JVM_THREAD_COUNT = 'jvm.thread.count' as const;
|
||||
|
||||
/**
|
||||
* Number of connections that are currently active on the server.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_ACTIVE_CONNECTIONS = 'kestrel.active_connections' as const;
|
||||
|
||||
/**
|
||||
* Number of TLS handshakes that are currently in progress on the server.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = 'kestrel.active_tls_handshakes' as const;
|
||||
|
||||
/**
|
||||
* The duration of connections on the server.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_CONNECTION_DURATION = 'kestrel.connection.duration' as const;
|
||||
|
||||
/**
|
||||
* Number of connections that are currently queued and are waiting to start.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_QUEUED_CONNECTIONS = 'kestrel.queued_connections' as const;
|
||||
|
||||
/**
|
||||
* Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_QUEUED_REQUESTS = 'kestrel.queued_requests' as const;
|
||||
|
||||
/**
|
||||
* Number of connections rejected by the server.
|
||||
*
|
||||
* @note Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`.
|
||||
* Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_REJECTED_CONNECTIONS = 'kestrel.rejected_connections' as const;
|
||||
|
||||
/**
|
||||
* The duration of TLS handshakes on the server.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_TLS_HANDSHAKE_DURATION = 'kestrel.tls_handshake.duration' as const;
|
||||
|
||||
/**
|
||||
* Number of connections that are currently upgraded (WebSockets). .
|
||||
*
|
||||
* @note The counter only tracks HTTP/1.1 connections.
|
||||
*
|
||||
* Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_KESTREL_UPGRADED_CONNECTIONS = 'kestrel.upgraded_connections' as const;
|
||||
|
||||
/**
|
||||
* Number of connections that are currently active on the server.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = 'signalr.server.active_connections' as const;
|
||||
|
||||
/**
|
||||
* The duration of connections on the server.
|
||||
*
|
||||
* @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0
|
||||
*/
|
||||
export const METRIC_SIGNALR_SERVER_CONNECTION_DURATION = 'signalr.server.connection.duration' as const;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +1,2 @@
|
|||
opentelemetry-specification/
|
||||
semantic-conventions/
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
ROOT_DIR="${SCRIPT_DIR}/../../"
|
||||
|
||||
# freeze the spec version to make SpanAttributess generation reproducible
|
||||
SPEC_VERSION=v1.7.0
|
||||
SPEC_VERSION=v1.27.0
|
||||
GENERATOR_VERSION=0.8.0
|
||||
|
||||
# When running on windows and your are getting references to ";C" (like Telemetry;C)
|
||||
|
@ -13,45 +15,27 @@ GENERATOR_VERSION=0.8.0
|
|||
|
||||
cd ${SCRIPT_DIR}
|
||||
|
||||
rm -rf opentelemetry-specification || true
|
||||
mkdir opentelemetry-specification
|
||||
cd opentelemetry-specification
|
||||
rm -rf semantic-conventions || true
|
||||
mkdir semantic-conventions
|
||||
cd semantic-conventions
|
||||
|
||||
git init
|
||||
git remote add origin https://github.com/open-telemetry/opentelemetry-specification.git
|
||||
git fetch origin "$SPEC_VERSION" --depth=1
|
||||
git remote add origin https://github.com/open-telemetry/semantic-conventions.git
|
||||
git fetch origin "${SPEC_VERSION}" --depth=1
|
||||
git reset --hard FETCH_HEAD
|
||||
cd ${SCRIPT_DIR}
|
||||
|
||||
docker run --rm \
|
||||
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/trace:/source \
|
||||
-v ${SCRIPT_DIR}/templates:/templates \
|
||||
-v ${ROOT_DIR}/packages/opentelemetry-semantic-conventions/src/trace/:/output \
|
||||
otel/semconvgen:${GENERATOR_VERSION} \
|
||||
-f /source \
|
||||
code \
|
||||
--template /templates/SemanticAttributes.ts.j2 \
|
||||
--output /output/SemanticAttributes.ts \
|
||||
-Dclass=SemanticAttributes \
|
||||
-Dcls_prefix=SEMATTRS
|
||||
docker run --rm --platform linux/amd64 \
|
||||
-v ${SCRIPT_DIR}/semantic-conventions/model:/source \
|
||||
-v ${SCRIPT_DIR}/templates:/weaver/templates \
|
||||
-v ${ROOT_DIR}/packages/opentelemetry-semantic-conventions/src/:/output \
|
||||
otel/weaver:$GENERATOR_VERSION \
|
||||
registry generate \
|
||||
--registry=/source \
|
||||
--templates=/weaver/templates \
|
||||
stable \
|
||||
/output/
|
||||
|
||||
docker run --rm \
|
||||
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/resource:/source \
|
||||
-v ${SCRIPT_DIR}/templates:/templates \
|
||||
-v ${ROOT_DIR}/packages/opentelemetry-semantic-conventions/src/resource/:/output \
|
||||
otel/semconvgen:${GENERATOR_VERSION} \
|
||||
-f /source \
|
||||
code \
|
||||
--template /templates/SemanticAttributes.ts.j2 \
|
||||
--output /output/SemanticResourceAttributes.ts \
|
||||
-Dclass=SemanticResourceAttributes \
|
||||
-Dcls_prefix=SEMRESATTRS
|
||||
|
||||
# Run the automatic linting fixing task to ensure it will pass eslint
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
npm run lint:fix:changed
|
||||
|
||||
# Run the size checks for the generated files
|
||||
# Ensure semconv compiles
|
||||
cd "${ROOT_DIR}/packages/opentelemetry-semantic-conventions"
|
||||
npm run size-check
|
||||
npm run compile
|
||||
|
|
|
@ -1,201 +0,0 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createConstMap } from '../internal/utils';
|
||||
|
||||
{%- macro print_value(type, value) -%}
|
||||
{{ "'" if type == "string"}}{{value}}{{ "'" if type == "string"}}
|
||||
{%- endmacro %}
|
||||
{%- macro upFirst(text) -%}
|
||||
{{ text[0]|upper}}{{text[1:] }}
|
||||
{%- endmacro %}
|
||||
{%- macro lowerFirst(text) -%}
|
||||
{{ text[0]|lower}}{{text[1:] }}
|
||||
{%- endmacro %}
|
||||
{%- macro normalizeName(value) -%}
|
||||
{{ value.replace('.', '_') | upper }}
|
||||
{%- endmacro %}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/{{template}}
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// Constant values for {{class}}
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Temporary local constants to assign to the individual exports and the namespaced version
|
||||
// Required to avoid the namespace exports using the unminifiable export names for some package types
|
||||
{%- for attribute in attributes if attribute.is_local and not attribute.ref %}
|
||||
const TMP_{{attribute.fqn | to_const_name}} = {{ print_value ("string", attribute.fqn) }};
|
||||
{%- endfor %}
|
||||
|
||||
{%- for attribute in attributes if attribute.is_local and not attribute.ref %}
|
||||
|
||||
/**
|
||||
* {% filter escape %}{{attribute.brief | to_doc_brief}}.{% endfilter %}
|
||||
{%- if attribute.note %}
|
||||
*
|
||||
* Note: {% filter escape %}{{attribute.note | to_doc_brief}}.{% endfilter %}
|
||||
{%- endif %}
|
||||
{%- if attribute.deprecated %}
|
||||
*
|
||||
* @deprecated {{attribute.deprecated | to_doc_brief}}.
|
||||
{%- endif %}
|
||||
*/
|
||||
export const {{cls_prefix}}_{{attribute.fqn | to_const_name}} = TMP_{{attribute.fqn | to_const_name}};
|
||||
|
||||
{%- endfor %}
|
||||
|
||||
/**
|
||||
* Definition of available values for {{class}}
|
||||
* This type is used for backward compatibility, you should use the individual exported
|
||||
* constants {{class}}_XXXXX rather than the exported constant map. As any single reference
|
||||
* to a constant map value will result in all strings being included into your bundle.
|
||||
* @deprecated Use the {{cls_prefix}}_XXXXX constants rather than the {{class}}.XXXXX for bundle minification.
|
||||
*/
|
||||
export type {{class}} = {
|
||||
{%- for attribute in attributes if attribute.is_local and not attribute.ref %}
|
||||
|
||||
/**
|
||||
* {% filter escape %}{{attribute.brief | to_doc_brief}}.{% endfilter %}
|
||||
{%- if attribute.note %}
|
||||
*
|
||||
* Note: {% filter escape %}{{attribute.note | to_doc_brief}}.{% endfilter %}
|
||||
{%- endif %}
|
||||
{%- if attribute.deprecated %}
|
||||
*
|
||||
* @deprecated {{attribute.deprecated | to_doc_brief}}.
|
||||
{%- endif %}
|
||||
*/
|
||||
{{attribute.fqn | to_const_name}}: '{{attribute.fqn}}',
|
||||
{%- endfor %}
|
||||
};
|
||||
|
||||
/**
|
||||
* Create exported Value Map for {{class}} values
|
||||
* @deprecated Use the {{cls_prefix}}_XXXXX constants rather than the {{class}}.XXXXX for bundle minification
|
||||
*/
|
||||
export const {{class}}:{{class}} = /*#__PURE__*/createConstMap<{{class}}>([
|
||||
{%- for attribute in attributes if attribute.is_local and not attribute.ref %}
|
||||
TMP_{{attribute.fqn | to_const_name}},
|
||||
{%- endfor %}
|
||||
]);
|
||||
|
||||
{%- for attribute in attributes if attribute.is_local and not attribute.ref %}
|
||||
{%- if attribute.is_enum %}
|
||||
{%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" %}
|
||||
{%- set type = attribute.attr_type.enum_type %}
|
||||
|
||||
{%- if attribute.attr_type.members is defined and attribute.attr_type.members|length > 0 %}
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------
|
||||
* Constant values for {{class_name}} enum definition
|
||||
*
|
||||
* {% filter escape %}{{attribute.brief | to_doc_brief}}.{% endfilter %}
|
||||
{%- if attribute.note %}
|
||||
*
|
||||
* Note: {% filter escape %}{{attribute.note | to_doc_brief}}.{% endfilter %}
|
||||
{%- endif %}
|
||||
{%- if attribute.deprecated %}
|
||||
*
|
||||
* @deprecated {{attribute.deprecated | to_doc_brief}}.
|
||||
{%- endif %}
|
||||
* ---------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
// Temporary local constants to assign to the individual exports and the namespaced version
|
||||
// Required to avoid the namespace exports using the unminifiable export names for some package types
|
||||
{%- for member in attribute.attr_type.members if attribute.is_local and not attribute.ref %}
|
||||
const TMP_{{class_name|upper}}_{{ member.member_id | to_const_name }} = {{ print_value(type, member.value) }};
|
||||
{%- endfor %}
|
||||
|
||||
{%- for member in attribute.attr_type.members if attribute.is_local and not attribute.ref %}
|
||||
|
||||
/**
|
||||
* {% filter escape %}{{attribute.brief | to_doc_brief}}.{% endfilter %}
|
||||
{%- if attribute.note %}
|
||||
*
|
||||
* Note: {% filter escape %}{{attribute.note | to_doc_brief}}.{% endfilter %}
|
||||
{%- endif %}
|
||||
{%- if attribute.deprecated %}
|
||||
*
|
||||
* @deprecated {{attribute.deprecated | to_doc_brief}}.
|
||||
{%- endif %}
|
||||
*/
|
||||
export const {{class_name|upper}}_{{ member.member_id | to_const_name }} = TMP_{{class_name|upper}}_{{ member.member_id | to_const_name }};
|
||||
|
||||
{%- endfor %}
|
||||
|
||||
/**
|
||||
* Identifies the Values for {{class_name}} enum definition
|
||||
*
|
||||
* {% filter escape %}{{attribute.brief | to_doc_brief}}.{% endfilter %}
|
||||
{%- if attribute.note %}
|
||||
*
|
||||
* Note: {% filter escape %}{{attribute.note | to_doc_brief}}.{% endfilter %}
|
||||
{%- endif %}
|
||||
{%- if attribute.deprecated %}
|
||||
*
|
||||
* @deprecated {{attribute.deprecated | to_doc_brief}}. Use the {{class_name | upper}}_XXXXX constants rather than the {{class_name}}.XXXXX for bundle minification.
|
||||
{%- else %}
|
||||
* @deprecated Use the {{class_name | upper}}_XXXXX constants rather than the {{class_name}}.XXXXX for bundle minification.
|
||||
{%- endif %}
|
||||
*/
|
||||
export type {{class_name}} = {
|
||||
{%- for member in attribute.attr_type.members if attribute.is_local and not attribute.ref %}
|
||||
|
||||
/** {% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %} */
|
||||
{{ member.member_id | to_const_name }}: {{ print_value(type, member.value) }},
|
||||
{%- endfor %}
|
||||
}
|
||||
|
||||
{%- set enumMap = namespace(useCreateConst = false) %}
|
||||
{%- if type == "string" %}
|
||||
{%- set enumMap.useCreateConst = true %}
|
||||
{%- for member in attribute.attr_type.members if attribute.is_local and not attribute.ref %}
|
||||
{%- if (member.member_id | to_const_name) != ( member.value | to_const_name) %}
|
||||
{%- set enumMap.useCreateConst = false %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
/**
|
||||
* The constant map of values for {{class_name}}.
|
||||
* @deprecated Use the {{class_name | upper}}_XXXXX constants rather than the {{class_name}}.XXXXX for bundle minification.
|
||||
*/
|
||||
{%- if enumMap.useCreateConst == true %}
|
||||
export const {{class_name}}:{{class_name}} = /*#__PURE__*/createConstMap<{{class_name}}>([
|
||||
{%- for member in attribute.attr_type.members if attribute.is_local and not attribute.ref %}
|
||||
{%- if (member.member_id | to_const_name) == ( member.value | to_const_name) %}
|
||||
TMP_{{class_name|upper}}_{{ member.member_id | to_const_name }},
|
||||
{%- else %}
|
||||
{#- Cause some invalid content to be generated to force a build error #}
|
||||
!! Invalid mapping for {{class_name}}.{{ member.member_id }}:{{ member.value }}. The value is not a valid string.
|
||||
{{ member.member_id | to_const_name }}: TMP_{{class_name|upper}}_{{ member.member_id | to_const_name }},
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
]);
|
||||
{%- else %}
|
||||
export const {{class_name}}:{{class_name}} = {
|
||||
{%- for member in attribute.attr_type.members if attribute.is_local and not attribute.ref %}
|
||||
{{ member.member_id | to_const_name }}: TMP_{{class_name|upper}}_{{ member.member_id | to_const_name }},
|
||||
{%- endfor %}
|
||||
};
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{%- endfor %}
|
|
@ -0,0 +1,43 @@
|
|||
{{- template.set_file_name(ctx.stability ~ "_attributes.ts") }}
|
||||
{%- import 'docstring.ts.j2' as d %}
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
{% for attribute in ctx.attributes | attribute_sort %}
|
||||
{% if attribute.name not in params.excluded_attributes %}
|
||||
{{d.docstring(attribute, "attribute")}}
|
||||
{% if attribute.type is not template_type %}
|
||||
export const ATTR_{{ attribute.name | screaming_snake_case }} = '{{attribute.name}}' as const;
|
||||
|
||||
{% else %}
|
||||
export const ATTR_{{ attribute.name | screaming_snake_case }} = (key: string) => `{{attribute.name}}.${key}`;
|
||||
|
||||
{% endif %}
|
||||
{% if attribute.type is mapping %}
|
||||
{% for espec in attribute.type.members | sort(attribute='value') %}
|
||||
/**
|
||||
* Enum value {{ espec.value | print_member_value }} for attribute {@link ATTR_{{ attribute.name | screaming_snake_case }}}.
|
||||
*/
|
||||
export const {{ attribute.name | screaming_snake_case }}_VALUE_{{ espec.id | screaming_snake_case }} = {{ espec.value | print_member_value }} as const;
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
|
@ -0,0 +1,21 @@
|
|||
{% macro strong_reqs(string) -%}{{ string | replace(" MUST ", " **MUST** ") | replace(" MUST NOT ", " **MUST NOT** ") | replace(" SHOULD ", " **SHOULD** ") | replace(" SHOULD NOT ", " **SHOULD NOT** ") | replace(" MAY ", " **MAY** ") | replace(" NOT ", " **NOT** ") }}{% endmacro -%}
|
||||
|
||||
{% macro docstring(obj, type="value") -%}/**
|
||||
{{ strong_reqs(obj.brief | comment_with_prefix(" * ")) }}
|
||||
{% if obj.examples is sequence %}{% for example in obj.examples %}
|
||||
*
|
||||
* @example {{ example }}
|
||||
{% endfor %}{%elif obj.examples%}
|
||||
*
|
||||
* @example {{ obj.examples | print_member_value }}
|
||||
{% endif %}{% if obj.note %}
|
||||
*
|
||||
{{ ("@note " ~ strong_reqs(obj.note)) | comment_with_prefix(" * ") }}
|
||||
{% endif %}{% if (obj.stability) != "stable" %}
|
||||
*
|
||||
* @experimental This {{type}} is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
||||
{% endif %}{% if obj.deprecated %}
|
||||
*
|
||||
* @deprecated {{ strong_reqs(obj.deprecated) | comment_with_prefix(" * ") }}
|
||||
{% endif %}
|
||||
*/{% endmacro -%}
|
|
@ -0,0 +1,27 @@
|
|||
{{- template.set_file_name(ctx.stability ~ "_metrics.ts") }}
|
||||
{%- import 'docstring.ts.j2' as d %}
|
||||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
{% for metric in ctx.metrics | sort(attribute="metric_name") %}
|
||||
{{d.docstring(metric, "metric")}}
|
||||
export const METRIC_{{ metric.metric_name | screaming_snake_case }} = '{{metric.metric_name}}' as const;
|
||||
|
||||
{% endfor %}
|
|
@ -0,0 +1,54 @@
|
|||
params:
|
||||
excluded_attributes: ["messaging.client_id"]
|
||||
|
||||
templates:
|
||||
- pattern: attributes.ts.j2
|
||||
# Remove file name prefix when per-pattern params are available https://github.com/open-telemetry/weaver/issues/288
|
||||
filter: >
|
||||
semconv_attributes({
|
||||
"exclude_stability": ["experimental"]
|
||||
}) | {
|
||||
stability: "stable",
|
||||
attributes: .
|
||||
}
|
||||
application_mode: single
|
||||
- pattern: attributes.ts.j2
|
||||
filter: >
|
||||
semconv_attributes({
|
||||
"exclude_stability": ["stable"]
|
||||
}) | {
|
||||
stability: "experimental",
|
||||
attributes: .
|
||||
}
|
||||
application_mode: single
|
||||
- pattern: metrics.ts.j2
|
||||
filter: >
|
||||
semconv_metrics({
|
||||
"exclude_stability": ["experimental"]
|
||||
}) | {
|
||||
stability: "stable",
|
||||
metrics: .
|
||||
}
|
||||
application_mode: single
|
||||
- pattern: metrics.ts.j2
|
||||
filter: >
|
||||
semconv_metrics({
|
||||
"exclude_stability": ["stable"]
|
||||
}) | {
|
||||
stability: "experimental",
|
||||
metrics: .
|
||||
}
|
||||
application_mode: single
|
||||
|
||||
# Whitespace control settings to simplify the definition of templates
|
||||
whitespace_control:
|
||||
trim_blocks: true
|
||||
lstrip_blocks: true
|
||||
|
||||
text_maps:
|
||||
js_types:
|
||||
int: number
|
||||
double: number
|
||||
boolean: boolean
|
||||
string: string
|
||||
string[]: string[]
|
|
@ -1 +0,0 @@
|
|||
{"version":"4.4.4"}
|
Loading…
Reference in New Issue