otel-utils 0.1.11__py3-none-any.whl → 0.1.12__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.

Potentially problematic release.


This version of otel-utils might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: otel-utils
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: Utilidades simplificadas para instrumentación con OpenTelemetry
5
5
  License: Proprietary
6
6
  Author: Harold Portocarrero
@@ -38,31 +38,35 @@ A Python library designed to simplify application instrumentation using OpenTele
38
38
 
39
39
  ## Installation
40
40
 
41
- To install the library from the private repository:
42
-
43
41
  ```bash
44
- pip install git+ssh://git@github.com/your-organization/otel-utils.git
42
+ pip install otel-utils
45
43
  ```
46
44
 
47
- Or add this to your requirements.txt:
48
- ```bash
49
- git+ssh://git@github.com/your-organization/otel-utils.git@v0.1.0
50
- ```
45
+ ## Basic Usage
51
46
 
52
- # Basic Usage
53
- ## Initial Configuration
47
+ ### Initial Configuration
54
48
  ```python
55
49
  from otel_utils import OtelConfig, OtelConfigurator
56
50
 
57
51
  config = OtelConfig(
58
52
  service_name="my-service",
59
- environment="production"
53
+ environment="production",
54
+ otlp_endpoint="http://localhost:4318", # Optional
55
+ protocol="http", # "http" or "grpc", default "grpc"
56
+ trace_sample_rate=1.0, # Sampling rate, default 1.0
57
+ metric_export_interval_ms=30000, # Metrics export interval
58
+ log_level=logging.INFO, # Logging level
59
+ enable_console_logging=True, # Enable console logging
60
+ additional_resources={ # Optional additional resources
61
+ "deployment.region": "us-east-1",
62
+ "team.name": "backend"
63
+ }
60
64
  )
61
65
 
62
66
  OtelConfigurator(config)
63
67
  ```
64
68
 
65
- ## Tracing
69
+ ### Tracing
66
70
  ```python
67
71
  from otel_utils import Tracer
68
72
 
@@ -80,7 +84,7 @@ with tracer.create_span("my_operation") as span:
80
84
  # Your code here
81
85
  ```
82
86
 
83
- ## Metrics
87
+ ### Metrics
84
88
  ```python
85
89
  from otel_utils import Metrics
86
90
 
@@ -96,7 +100,7 @@ with metrics.measure_duration("request_duration"):
96
100
  pass
97
101
  ```
98
102
 
99
- ## Structured Logging
103
+ ### Structured Logging
100
104
  ```python
101
105
  from otel_utils import StructuredLogger
102
106
 
@@ -107,15 +111,15 @@ with logger.operation_context("process_order", order_id="123"):
107
111
  # Your code here
108
112
  ```
109
113
 
110
- # OpenTelemetry Collector Integration
114
+ ## OpenTelemetry Collector Integration
115
+
111
116
  This library is designed to work seamlessly with the OpenTelemetry Collector. Telemetry data is sent using the OTLP protocol, which is the OpenTelemetry standard.
117
+
118
+ ### Collector Configuration with HTTP
112
119
  ```yaml
113
- # collector configuration example
114
120
  receivers:
115
121
  otlp:
116
122
  protocols:
117
- grpc:
118
- endpoint: 0.0.0.0:4317
119
123
  http:
120
124
  endpoint: 0.0.0.0:4318
121
125
 
@@ -129,20 +133,40 @@ service:
129
133
  exporters: [your-exporter]
130
134
  ```
131
135
 
132
- # Best Practices
133
- ## Separation of Concerns
136
+ ### Collector Configuration with gRPC
137
+ ```yaml
138
+ receivers:
139
+ otlp:
140
+ protocols:
141
+ grpc:
142
+ endpoint: 0.0.0.0:4317
143
+
144
+ exporters:
145
+ # configure your exporters here
146
+
147
+ service:
148
+ pipelines:
149
+ traces:
150
+ receivers: [otlp]
151
+ exporters: [your-exporter]
152
+ ```
153
+
154
+ ## Best Practices
155
+
156
+ ### Separation of Concerns
134
157
  Keep instrumentation separate from business logic by creating domain-specific abstractions. Your business code should remain clean and focused on its primary responsibilities.
135
158
 
136
- ## Consistent Naming
159
+ ### Consistent Naming
137
160
  Use coherent naming conventions for spans, metrics, and logs across your services. This makes it easier to correlate and analyze telemetry data.
138
161
 
139
- ## Relevant Context
162
+ ### Relevant Context
140
163
  Include useful contextual information in spans and logs, but be mindful of sensitive data. Focus on information that aids debugging and monitoring.
141
164
 
142
- ## Appropriate Granularity
165
+ ### Appropriate Granularity
143
166
  Don't instrument everything. Focus on significant operations that provide value for monitoring and debugging. Consider the overhead and noise ratio when adding instrumentation.
144
167
 
145
- # Development
168
+ ## Development
169
+
146
170
  To set up the development environment:
147
171
 
148
172
  ```bash
@@ -157,11 +181,9 @@ pip install -e ".[dev]"
157
181
  pytest
158
182
  ```
159
183
 
160
- # Contributing
184
+ ## Contributing
185
+
161
186
  1. Create a feature branch (`git checkout -b feature/new-feature`)
162
187
  2. Commit your changes (`git commit -am 'Add new feature'`)
163
188
  3. Push to the branch (`git push origin feature/new-feature`)
164
189
  4. Create a Pull Request
165
-
166
- I hope this documentation helps you understand and effectively use the OpenTelemetry Utils library. Each section is designed to guide you through the essential aspects of instrumenting your applications while maintaining clean and maintainable code.
167
- Let me know if you need any clarification or have questions about specific features or use cases. We can explore any aspect of the library in more detail.
@@ -3,6 +3,6 @@ otel_utils/configurator.py,sha256=vQhEzt5L857re1mk_BBW8zjZ20458lvwDDe55cccSCE,62
3
3
  otel_utils/logging.py,sha256=ZsvZsjrRGoTLD1F035-Haq2hPuEeEYXYiAMU8B_aPXQ,3395
4
4
  otel_utils/metrics.py,sha256=XD-t9V3peZJs97hN2hR2rwJKrcCJHqx2cldNOTCpzoA,3664
5
5
  otel_utils/tracing.py,sha256=PtowQ7MvYld_xJlVAV4pBQuDBQIqPeP1FQPrzgZx9_Q,2625
6
- otel_utils-0.1.11.dist-info/METADATA,sha256=CQY0cN-lLsTWq-_AFoNp-Qt-o7HbNt4b22rAxtEWZWQ,5092
7
- otel_utils-0.1.11.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
8
- otel_utils-0.1.11.dist-info/RECORD,,
6
+ otel_utils-0.1.12.dist-info/METADATA,sha256=cz-ZR0Er6-KdxBHtulXNwAKdJ1FCn1bsV7J6vLkPOLw,5279
7
+ otel_utils-0.1.12.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
8
+ otel_utils-0.1.12.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.1
2
+ Generator: poetry-core 2.1.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any