runtimeconditions-observability 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ # Code generated by runtimeconditions-binding-emitter 0.1.0 from model 4be77a5ea83ff14ba2cb09e6200bf2d599d96cbc91233036edc85a0813d2bddc; DO NOT EDIT.
2
+ from __future__ import annotations
3
+
4
+ from .bindings import (
5
+ Declaration,
6
+ OtlpExport,
7
+ PrometheusScrape,
8
+ RcObservabilityField,
9
+ Scheme,
10
+ Signals,
11
+ SignalsItem,
12
+ Transport,
13
+ rc_observability,
14
+ )
15
+
16
+ __all__ = [
17
+ "Declaration",
18
+ "OtlpExport",
19
+ "PrometheusScrape",
20
+ "RcObservabilityField",
21
+ "Scheme",
22
+ "Signals",
23
+ "SignalsItem",
24
+ "Transport",
25
+ "rc_observability",
26
+ ]
@@ -0,0 +1,175 @@
1
+ # Code generated by runtimeconditions-binding-emitter 0.1.0 from model 4be77a5ea83ff14ba2cb09e6200bf2d599d96cbc91233036edc85a0813d2bddc; DO NOT EDIT.
2
+ """Runtime Conditions defined by
3
+ https://runtimeconditions.io/extensions/rc/observability/0.2.0/runtimeconditions.extension.yaml.
4
+
5
+ Use this extension to say how the platform can see what your workload is doing: its
6
+ traces, metrics and logs.
7
+
8
+ There are two ways, and each one is an interface type:
9
+
10
+ - otlp_export: your workload sends its traces, metrics or logs to a receiver, using
11
+ OpenTelemetry (OTLP). The platform gives it a receiver to send to. -
12
+ prometheus_scrape: your workload shows its metrics on a web address, and a
13
+ Prometheus server reads them from time to time. The platform sets up the reading.
14
+
15
+ If your workload does both, add one Condition for each.
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from dataclasses import dataclass
21
+ from enum import StrEnum
22
+ from typing import Protocol, Sequence, TypeAlias
23
+
24
+
25
+ @dataclass(frozen=True, kw_only=True)
26
+ class Declaration:
27
+ pass
28
+
29
+
30
+ class RcObservabilityField(Protocol):
31
+ def rc_marker_c6a9829b134fb5ef(self) -> None: ...
32
+
33
+
34
+ @dataclass(frozen=True, kw_only=True)
35
+ class OtlpExport:
36
+ """Your workload sends telemetry to an OpenTelemetry (OTLP) receiver.
37
+
38
+ Example: a workload that sends its traces, metrics and logs with OpenTelemetry
39
+ over HTTP.
40
+
41
+ ```yaml
42
+ kind: rc.observability
43
+ interface:
44
+ type: otlp_export
45
+ signals: [traces, metrics, logs]
46
+ transport: http/protobuf
47
+ ```
48
+ """
49
+
50
+ signals: Signals
51
+ """The kinds of telemetry that your workload sends, such as traces, metrics and
52
+ logs.
53
+
54
+ At least one of traces, metrics and logs, each one once.
55
+ """
56
+ transport: Transport
57
+ """How your workload sends the telemetry. The receiver must accept this way.
58
+
59
+ grpc, http/protobuf or http/json. The receiver must accept it.
60
+ """
61
+
62
+ def rc_marker_c6a9829b134fb5ef(self) -> None:
63
+ return None
64
+
65
+
66
+ @dataclass(frozen=True, kw_only=True)
67
+ class PrometheusScrape:
68
+ """Your workload shows metrics that a Prometheus server can read.
69
+
70
+ Example: a workload that shows its metrics over HTTP, on port 9090, at the path
71
+ /metrics.
72
+
73
+ ```yaml
74
+ kind: rc.observability
75
+ interface:
76
+ type: prometheus_scrape
77
+ port: 9090
78
+ path: /metrics
79
+ scheme: http
80
+ ```
81
+ """
82
+
83
+ path: str
84
+ """The web path where your workload shows its metrics, such as /metrics.
85
+
86
+ The web path. It must start with /.
87
+ """
88
+ port: int
89
+ """The TCP port where your workload shows its metrics.
90
+
91
+ A TCP port, from 1 to 65535.
92
+ """
93
+ scheme: Scheme
94
+ """Whether Prometheus reads the metrics over http or https.
95
+
96
+ http or https.
97
+ """
98
+
99
+ def rc_marker_c6a9829b134fb5ef(self) -> None:
100
+ return None
101
+
102
+
103
+ class Scheme(StrEnum):
104
+ """Whether Prometheus reads the metrics over http or https.
105
+
106
+ http or https.
107
+ """
108
+
109
+ HTTP = "http"
110
+ """Read the metrics over plain HTTP."""
111
+ HTTPS = "https"
112
+ """Read the metrics over HTTPS."""
113
+
114
+
115
+ Signals: TypeAlias = "Sequence[SignalsItem]"
116
+ """The kinds of telemetry that your workload sends, such as traces, metrics and logs.
117
+
118
+ At least one of traces, metrics and logs, each one once.
119
+ """
120
+
121
+
122
+ class SignalsItem(StrEnum):
123
+ LOGS = "logs"
124
+ """Logs, which are the lines of text that your workload writes about what it does."""
125
+ METRICS = "metrics"
126
+ """Metrics, which are numbers measured over time, such as the number of requests."""
127
+ TRACES = "traces"
128
+ """Traces, which show how one request moves through your services."""
129
+
130
+
131
+ class Transport(StrEnum):
132
+ """How your workload sends the telemetry. The receiver must accept this way.
133
+
134
+ grpc, http/protobuf or http/json. The receiver must accept it.
135
+ """
136
+
137
+ GRPC = "grpc"
138
+ """OTLP over gRPC, with the data in Protocol Buffers."""
139
+ HTTP_JSON = "http/json"
140
+ """OTLP over HTTP, with the data in JSON."""
141
+ HTTP_PROTOBUF = "http/protobuf"
142
+ """OTLP over HTTP, with the data in Protocol Buffers."""
143
+
144
+
145
+ def rc_observability(*fields: RcObservabilityField) -> Declaration:
146
+ """Declare a rc.observability Condition.
147
+
148
+ Your workload sends telemetry to the platform, or shows telemetry that the
149
+ platform must collect.
150
+
151
+ Example: a workload that sends its traces and logs with OpenTelemetry over gRPC.
152
+
153
+ ```python
154
+ rc_observability(
155
+ OtlpExport(
156
+ signals=[SignalsItem.TRACES, SignalsItem.LOGS],
157
+ transport=Transport.GRPC,
158
+ ),
159
+ )
160
+ ```
161
+ """
162
+ return Declaration()
163
+
164
+
165
+ __all__ = [
166
+ "Declaration",
167
+ "OtlpExport",
168
+ "PrometheusScrape",
169
+ "RcObservabilityField",
170
+ "Scheme",
171
+ "Signals",
172
+ "SignalsItem",
173
+ "Transport",
174
+ "rc_observability",
175
+ ]
File without changes