-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
1,274 additions
and
566 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...etry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# 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 | ||
# | ||
# http://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. | ||
|
||
# pylint: disable=too-many-lines | ||
|
||
from enum import Enum | ||
|
||
|
||
ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result" | ||
""" | ||
ASP.NET Core exception middleware handling result. | ||
""" | ||
|
||
|
||
ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type" | ||
""" | ||
Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | ||
""" | ||
|
||
|
||
ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy" | ||
""" | ||
Rate limiting policy name. | ||
""" | ||
|
||
|
||
ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result" | ||
""" | ||
Rate-limiting result, shows whether the lease was acquired or contains a rejection reason. | ||
""" | ||
|
||
|
||
ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled" | ||
""" | ||
Flag indicating if request was handled by the application pipeline. | ||
""" | ||
|
||
|
||
ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback" | ||
""" | ||
A value that indicates whether the matched route is a fallback route. | ||
""" | ||
|
||
|
||
ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status" | ||
""" | ||
Match result - success or failure. | ||
""" | ||
|
||
class AspnetcoreDiagnosticsExceptionResultValues(Enum): | ||
HANDLED = "handled" | ||
"""Exception was handled by the exception handling middleware.""" | ||
|
||
UNHANDLED = "unhandled" | ||
"""Exception was not handled by the exception handling middleware.""" | ||
|
||
SKIPPED = "skipped" | ||
"""Exception handling was skipped because the response had started.""" | ||
|
||
ABORTED = "aborted" | ||
"""Exception handling didn't run because the request was aborted.""" | ||
class AspnetcoreRateLimitingResultValues(Enum): | ||
ACQUIRED = "acquired" | ||
"""Lease was acquired.""" | ||
|
||
ENDPOINT_LIMITER = "endpoint_limiter" | ||
"""Lease request was rejected by the endpoint limiter.""" | ||
|
||
GLOBAL_LIMITER = "global_limiter" | ||
"""Lease request was rejected by the global limiter.""" | ||
|
||
REQUEST_CANCELED = "request_canceled" | ||
"""Lease request was canceled.""" | ||
class AspnetcoreRoutingMatchStatusValues(Enum): | ||
SUCCESS = "success" | ||
"""Match succeeded.""" | ||
|
||
FAILURE = "failure" | ||
"""Match failed.""" |
107 changes: 107 additions & 0 deletions
107
...lemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# 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 | ||
# | ||
# http://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. | ||
|
||
from opentelemetry.metrics import ( | ||
Counter, | ||
Histogram, | ||
Meter, | ||
UpDownCounter, | ||
ObservableGauge, | ||
) | ||
from typing import Callable, Sequence | ||
|
||
class AspnetcoreMetrics: | ||
|
||
""" | ||
Number of exceptions caught by exception handling middleware | ||
""" | ||
@staticmethod | ||
def create_aspnetcore_diagnostics_exceptions(meter: Meter) -> Counter: | ||
return meter.create_counter( | ||
name="aspnetcore.diagnostics.exceptions", | ||
description="Number of exceptions caught by exception handling middleware.", | ||
unit="{exception}", | ||
) | ||
|
||
|
||
""" | ||
Number of requests that are currently active on the server that hold a rate limiting lease | ||
""" | ||
@staticmethod | ||
def create_aspnetcore_rate_limiting_active_request_leases(meter: Meter) -> UpDownCounter: | ||
return meter.create_up_down_counter( | ||
name="aspnetcore.rate_limiting.active_request_leases", | ||
description="Number of requests that are currently active on the server that hold a rate limiting lease.", | ||
unit="{request}", | ||
) | ||
|
||
|
||
""" | ||
Number of requests that are currently queued, waiting to acquire a rate limiting lease | ||
""" | ||
@staticmethod | ||
def create_aspnetcore_rate_limiting_queued_requests(meter: Meter) -> UpDownCounter: | ||
return meter.create_up_down_counter( | ||
name="aspnetcore.rate_limiting.queued_requests", | ||
description="Number of requests that are currently queued, waiting to acquire a rate limiting lease.", | ||
unit="{request}", | ||
) | ||
|
||
|
||
""" | ||
The time the request spent in a queue waiting to acquire a rate limiting lease | ||
""" | ||
@staticmethod | ||
def create_aspnetcore_rate_limiting_request_time_in_queue(meter: Meter) -> Histogram: | ||
return meter.create_histogram( | ||
name="aspnetcore.rate_limiting.request.time_in_queue", | ||
description="The time the request spent in a queue waiting to acquire a rate limiting lease.", | ||
unit="s", | ||
) | ||
|
||
|
||
""" | ||
The duration of rate limiting lease held by requests on the server | ||
""" | ||
@staticmethod | ||
def create_aspnetcore_rate_limiting_request_lease_duration(meter: Meter) -> Histogram: | ||
return meter.create_histogram( | ||
name="aspnetcore.rate_limiting.request_lease.duration", | ||
description="The duration of rate limiting lease held by requests on the server.", | ||
unit="s", | ||
) | ||
|
||
|
||
""" | ||
Number of requests that tried to acquire a rate limiting lease | ||
""" | ||
@staticmethod | ||
def create_aspnetcore_rate_limiting_requests(meter: Meter) -> Counter: | ||
return meter.create_counter( | ||
name="aspnetcore.rate_limiting.requests", | ||
description="Number of requests that tried to acquire a rate limiting lease.", | ||
unit="{request}", | ||
) | ||
|
||
|
||
""" | ||
Number of requests that were attempted to be matched to an endpoint | ||
""" | ||
@staticmethod | ||
def create_aspnetcore_routing_match_attempts(meter: Meter) -> Counter: | ||
return meter.create_counter( | ||
name="aspnetcore.routing.match_attempts", | ||
description="Number of requests that were attempted to be matched to an endpoint.", | ||
unit="{match_attempt}", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...try/semconv/v1_23_1/browser_attributes.py → ...emconv/experimental/browser_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...semconv/v1_23_1/cloudevents_attributes.py → ...nv/experimental/cloudevents_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...y/semconv/v1_23_1/container_attributes.py → ...conv/experimental/container_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.