Skip to content

Commit 7d1bb68

Browse files
committed
add schemas version checks
1 parent 6fddf17 commit 7d1bb68

File tree

76 files changed

+1274
-566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1274
-566
lines changed

opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");

opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,12 +32,11 @@
3332
3433
If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
3534
it's RECOMMENDED to:
36-
* Use a domain-specific attribute
37-
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
38-
"""
3935
36+
* Use a domain-specific attribute
37+
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
38+
"""
4039

4140
class ErrorTypeValues(Enum):
4241
OTHER = "_OTHER"
4342
"""A fallback error value to be used when the instrumentation doesn't define a custom value."""
44-

opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py renamed to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,7 +29,6 @@
3029
Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived.
3130
"""
3231

33-
3432
class AndroidStateValues(Enum):
3533
CREATED = "created"
3634
"""Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time."""
@@ -40,4 +38,3 @@ class AndroidStateValues(Enum):
4038

4139
FOREGROUND = "foreground"
4240
"""Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states."""
43-
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# pylint: disable=too-many-lines
16+
17+
from enum import Enum
18+
19+
20+
ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result"
21+
"""
22+
ASP.NET Core exception middleware handling result.
23+
"""
24+
25+
26+
ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type"
27+
"""
28+
Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception.
29+
"""
30+
31+
32+
ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy"
33+
"""
34+
Rate limiting policy name.
35+
"""
36+
37+
38+
ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result"
39+
"""
40+
Rate-limiting result, shows whether the lease was acquired or contains a rejection reason.
41+
"""
42+
43+
44+
ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled"
45+
"""
46+
Flag indicating if request was handled by the application pipeline.
47+
"""
48+
49+
50+
ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback"
51+
"""
52+
A value that indicates whether the matched route is a fallback route.
53+
"""
54+
55+
56+
ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status"
57+
"""
58+
Match result - success or failure.
59+
"""
60+
61+
class AspnetcoreDiagnosticsExceptionResultValues(Enum):
62+
HANDLED = "handled"
63+
"""Exception was handled by the exception handling middleware."""
64+
65+
UNHANDLED = "unhandled"
66+
"""Exception was not handled by the exception handling middleware."""
67+
68+
SKIPPED = "skipped"
69+
"""Exception handling was skipped because the response had started."""
70+
71+
ABORTED = "aborted"
72+
"""Exception handling didn't run because the request was aborted."""
73+
class AspnetcoreRateLimitingResultValues(Enum):
74+
ACQUIRED = "acquired"
75+
"""Lease was acquired."""
76+
77+
ENDPOINT_LIMITER = "endpoint_limiter"
78+
"""Lease request was rejected by the endpoint limiter."""
79+
80+
GLOBAL_LIMITER = "global_limiter"
81+
"""Lease request was rejected by the global limiter."""
82+
83+
REQUEST_CANCELED = "request_canceled"
84+
"""Lease request was canceled."""
85+
class AspnetcoreRoutingMatchStatusValues(Enum):
86+
SUCCESS = "success"
87+
"""Match succeeded."""
88+
89+
FAILURE = "failure"
90+
"""Match failed."""
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Copyright The OpenTelemetry Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from opentelemetry.metrics import (
16+
Counter,
17+
Histogram,
18+
Meter,
19+
UpDownCounter,
20+
ObservableGauge,
21+
)
22+
from typing import Callable, Sequence
23+
24+
class AspnetcoreMetrics:
25+
26+
"""
27+
Number of exceptions caught by exception handling middleware
28+
"""
29+
@staticmethod
30+
def create_aspnetcore_diagnostics_exceptions(meter: Meter) -> Counter:
31+
return meter.create_counter(
32+
name="aspnetcore.diagnostics.exceptions",
33+
description="Number of exceptions caught by exception handling middleware.",
34+
unit="{exception}",
35+
)
36+
37+
38+
"""
39+
Number of requests that are currently active on the server that hold a rate limiting lease
40+
"""
41+
@staticmethod
42+
def create_aspnetcore_rate_limiting_active_request_leases(meter: Meter) -> UpDownCounter:
43+
return meter.create_up_down_counter(
44+
name="aspnetcore.rate_limiting.active_request_leases",
45+
description="Number of requests that are currently active on the server that hold a rate limiting lease.",
46+
unit="{request}",
47+
)
48+
49+
50+
"""
51+
Number of requests that are currently queued, waiting to acquire a rate limiting lease
52+
"""
53+
@staticmethod
54+
def create_aspnetcore_rate_limiting_queued_requests(meter: Meter) -> UpDownCounter:
55+
return meter.create_up_down_counter(
56+
name="aspnetcore.rate_limiting.queued_requests",
57+
description="Number of requests that are currently queued, waiting to acquire a rate limiting lease.",
58+
unit="{request}",
59+
)
60+
61+
62+
"""
63+
The time the request spent in a queue waiting to acquire a rate limiting lease
64+
"""
65+
@staticmethod
66+
def create_aspnetcore_rate_limiting_request_time_in_queue(meter: Meter) -> Histogram:
67+
return meter.create_histogram(
68+
name="aspnetcore.rate_limiting.request.time_in_queue",
69+
description="The time the request spent in a queue waiting to acquire a rate limiting lease.",
70+
unit="s",
71+
)
72+
73+
74+
"""
75+
The duration of rate limiting lease held by requests on the server
76+
"""
77+
@staticmethod
78+
def create_aspnetcore_rate_limiting_request_lease_duration(meter: Meter) -> Histogram:
79+
return meter.create_histogram(
80+
name="aspnetcore.rate_limiting.request_lease.duration",
81+
description="The duration of rate limiting lease held by requests on the server.",
82+
unit="s",
83+
)
84+
85+
86+
"""
87+
Number of requests that tried to acquire a rate limiting lease
88+
"""
89+
@staticmethod
90+
def create_aspnetcore_rate_limiting_requests(meter: Meter) -> Counter:
91+
return meter.create_counter(
92+
name="aspnetcore.rate_limiting.requests",
93+
description="Number of requests that tried to acquire a rate limiting lease.",
94+
unit="{request}",
95+
)
96+
97+
98+
"""
99+
Number of requests that were attempted to be matched to an endpoint
100+
"""
101+
@staticmethod
102+
def create_aspnetcore_routing_match_attempts(meter: Meter) -> Counter:
103+
return meter.create_counter(
104+
name="aspnetcore.routing.match_attempts",
105+
description="Number of requests that were attempted to be matched to an endpoint.",
106+
unit="{match_attempt}",
107+
)

opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py renamed to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -307,11 +306,9 @@
307306
- [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html).
308307
"""
309308

310-
311309
class AwsEcsLaunchtypeValues(Enum):
312310
EC2 = "ec2"
313311
"""ec2."""
314312

315313
FARGATE = "fargate"
316314
"""fargate."""
317-

opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py renamed to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");

opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py renamed to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +72,6 @@
7372
a TracerProvider.
7473
"""
7574

76-
7775
class CloudPlatformValues(Enum):
7876
ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"
7977
"""Alibaba Cloud Elastic Compute Service."""
@@ -155,8 +153,6 @@ class CloudPlatformValues(Enum):
155153

156154
TENCENT_CLOUD_SCF = "tencent_cloud_scf"
157155
"""Tencent Cloud Serverless Cloud Function (SCF)."""
158-
159-
160156
class CloudProviderValues(Enum):
161157
ALIBABA_CLOUD = "alibaba_cloud"
162158
"""Alibaba Cloud."""
@@ -178,4 +174,3 @@ class CloudProviderValues(Enum):
178174

179175
TENCENT_CLOUD = "tencent_cloud"
180176
"""Tencent Cloud."""
181-

opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py renamed to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");

opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py renamed to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright The OpenTelemetry Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -45,3 +44,9 @@
4544
The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.
4645
"""
4746

47+
48+
CODE_STACKTRACE = "code.stacktrace"
49+
"""
50+
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.
51+
"""
52+

0 commit comments

Comments
 (0)