genai-otel-instrument 0.1.1.dev0__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 genai-otel-instrument might be problematic. Click here for more details.

Files changed (44) hide show
  1. genai_otel/__init__.py +129 -0
  2. genai_otel/__version__.py +34 -0
  3. genai_otel/auto_instrument.py +413 -0
  4. genai_otel/cli.py +92 -0
  5. genai_otel/config.py +187 -0
  6. genai_otel/cost_calculator.py +276 -0
  7. genai_otel/exceptions.py +17 -0
  8. genai_otel/gpu_metrics.py +240 -0
  9. genai_otel/instrumentors/__init__.py +47 -0
  10. genai_otel/instrumentors/anthropic_instrumentor.py +134 -0
  11. genai_otel/instrumentors/anyscale_instrumentor.py +27 -0
  12. genai_otel/instrumentors/aws_bedrock_instrumentor.py +94 -0
  13. genai_otel/instrumentors/azure_openai_instrumentor.py +69 -0
  14. genai_otel/instrumentors/base.py +528 -0
  15. genai_otel/instrumentors/cohere_instrumentor.py +76 -0
  16. genai_otel/instrumentors/google_ai_instrumentor.py +87 -0
  17. genai_otel/instrumentors/groq_instrumentor.py +106 -0
  18. genai_otel/instrumentors/huggingface_instrumentor.py +97 -0
  19. genai_otel/instrumentors/langchain_instrumentor.py +75 -0
  20. genai_otel/instrumentors/llamaindex_instrumentor.py +36 -0
  21. genai_otel/instrumentors/mistralai_instrumentor.py +119 -0
  22. genai_otel/instrumentors/ollama_instrumentor.py +83 -0
  23. genai_otel/instrumentors/openai_instrumentor.py +241 -0
  24. genai_otel/instrumentors/replicate_instrumentor.py +42 -0
  25. genai_otel/instrumentors/togetherai_instrumentor.py +42 -0
  26. genai_otel/instrumentors/vertexai_instrumentor.py +42 -0
  27. genai_otel/llm_pricing.json +589 -0
  28. genai_otel/logging_config.py +45 -0
  29. genai_otel/mcp_instrumentors/__init__.py +14 -0
  30. genai_otel/mcp_instrumentors/api_instrumentor.py +144 -0
  31. genai_otel/mcp_instrumentors/base.py +105 -0
  32. genai_otel/mcp_instrumentors/database_instrumentor.py +336 -0
  33. genai_otel/mcp_instrumentors/kafka_instrumentor.py +31 -0
  34. genai_otel/mcp_instrumentors/manager.py +139 -0
  35. genai_otel/mcp_instrumentors/redis_instrumentor.py +31 -0
  36. genai_otel/mcp_instrumentors/vector_db_instrumentor.py +265 -0
  37. genai_otel/metrics.py +148 -0
  38. genai_otel/py.typed +2 -0
  39. genai_otel_instrument-0.1.1.dev0.dist-info/METADATA +463 -0
  40. genai_otel_instrument-0.1.1.dev0.dist-info/RECORD +44 -0
  41. genai_otel_instrument-0.1.1.dev0.dist-info/WHEEL +5 -0
  42. genai_otel_instrument-0.1.1.dev0.dist-info/entry_points.txt +2 -0
  43. genai_otel_instrument-0.1.1.dev0.dist-info/licenses/LICENSE +201 -0
  44. genai_otel_instrument-0.1.1.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,589 @@
1
+ {
2
+ "embeddings": {
3
+ "text-embedding-ada-002": 0.0001,
4
+ "text-embedding-3-small": 0.00002,
5
+ "text-embedding-3-large": 0.00013,
6
+ "ada": 0.0001,
7
+ "ada-v2": 0.00010,
8
+ "text-ada-001": 0.0001,
9
+ "azure_text-embedding-ada-002": 0.0001,
10
+ "azure_text-embedding-3-small": 0.00002,
11
+ "azure_text-embedding-3-large": 0.00013,
12
+ "azure_ada": 0.0001,
13
+ "azure_ada-v2": 0.00010,
14
+ "azure_text-ada-001": 0.0001,
15
+ "embed-english-v3.0": 0.0001,
16
+ "embed-multilingual-v3.0": 0.0001,
17
+ "embed-english-light-v3.0": 0.0001,
18
+ "embed-multilingual-light-v3.0": 0.0001,
19
+ "embed-english-v2.0": 0.0001,
20
+ "embed-english-light-v2.0": 0.0001,
21
+ "embed-multilingual-v2.0": 0.0001,
22
+ "mistral-embed": 0.0001,
23
+ "amazon.titan-embed-text-v1": 0.0001,
24
+ "amazon.titan-embed-text-v2": 0.00002,
25
+ "textembedding-gecko": 0.0001,
26
+ "textembedding-gecko@001": 0.0001,
27
+ "textembedding-gecko@002": 0.0001,
28
+ "textembedding-gecko@003": 0.0001
29
+ },
30
+ "images": {
31
+ "dall-e-3": {
32
+ "standard": {
33
+ "1024x1024": 0.040,
34
+ "1024x1792": 0.020,
35
+ "1792x1024": 0.080
36
+ },
37
+ "hd": {
38
+ "1024x1024": 0.080,
39
+ "1024x1792": 0.120,
40
+ "1792x1024": 0.120
41
+ }
42
+ },
43
+ "azure_dall-e-3": {
44
+ "standard": {
45
+ "1024x1024": 0.040,
46
+ "1024x1792": 0.020,
47
+ "1792x1024": 0.080
48
+ },
49
+ "hd": {
50
+ "1024x1024": 0.080,
51
+ "1024x1792": 0.120,
52
+ "1792x1024": 0.120
53
+ }
54
+ },
55
+ "dall-e-2": {
56
+ "standard": {
57
+ "1024x1024": 0.020,
58
+ "512x512": 0.018,
59
+ "256x256": 0.016
60
+ }
61
+ },
62
+ "black-forest-labs/FLUX.1-dev": {
63
+ "standard": {
64
+ "1000000": 0.025
65
+ }
66
+ },
67
+ "black-forest-labs/FLUX.1-canny": {
68
+ "standard": {
69
+ "1000000": 0.025
70
+ }
71
+ },
72
+ "black-forest-labs/FLUX.1-depth": {
73
+ "standard": {
74
+ "1000000": 0.025
75
+ }
76
+ },
77
+ "black-forest-labs/FLUX.1-redux": {
78
+ "standard": {
79
+ "1000000": 0.025
80
+ }
81
+ },
82
+ "black-forest-labs/FLUX.1-schnell": {
83
+ "standard": {
84
+ "1000000": 0.0027
85
+ }
86
+ },
87
+ "black-forest-labs/FLUX.1-pro": {
88
+ "standard": {
89
+ "1000000": 0.04
90
+ }
91
+ },
92
+ "black-forest-labs/FLUX.1.1-pro": {
93
+ "standard": {
94
+ "1000000": 0.05
95
+ }
96
+ },
97
+ "stabilityai/stable-diffusion-xl-base-1.0": {
98
+ "standard": {
99
+ "512X512": 0.001,
100
+ "1024x1024": 0.01
101
+ }
102
+ },
103
+ "amazon.titan-image-generator-v1": {
104
+ "standard": {
105
+ "512x512": 0.008,
106
+ "1024x1024": 0.01
107
+ },
108
+ "premium": {
109
+ "512x512": 0.01,
110
+ "1024x1024": 0.012
111
+ }
112
+ }
113
+ },
114
+ "audio": {
115
+ "tts-1" : 0.015,
116
+ "tts-1-hd": 0.030,
117
+ "eleven_multilingual_v2": 0.24,
118
+ "eleven_multilingual_v1": 0.24,
119
+ "eleven_monolingual_v1": 0.24,
120
+ "eleven_english_v1": 0.24,
121
+ "eleven_turbo_v2": 0.24,
122
+ "eleven_english_sts_v2": 0.24,
123
+ "eleven_multilingual_sts_v2": 0.24,
124
+ "best": 0.00010277777,
125
+ "nano": 0.00003333333
126
+ },
127
+ "chat": {
128
+ "gpt-4.1-nano-2025-04-14": {
129
+ "promptPrice": 0.0001,
130
+ "completionPrice": 0.0004
131
+ },
132
+ "gpt-4.1-nano": {
133
+ "promptPrice": 0.0001,
134
+ "completionPrice": 0.0004
135
+ },
136
+ "gpt-4.1-mini-2025-04-14": {
137
+ "promptPrice": 0.0004,
138
+ "completionPrice": 0.0016
139
+ },
140
+ "gpt-4.1-mini": {
141
+ "promptPrice": 0.0004,
142
+ "completionPrice": 0.0016
143
+ },
144
+ "gpt-4.1-2025-04-14": {
145
+ "promptPrice": 0.002,
146
+ "completionPrice": 0.008
147
+ },
148
+ "gpt-4.1": {
149
+ "promptPrice": 0.002,
150
+ "completionPrice": 0.008
151
+ },
152
+ "gpt-4o": {
153
+ "promptPrice": 0.0005,
154
+ "completionPrice": 0.0015
155
+ },
156
+ "gpt-4o-2024-08-06": {
157
+ "promptPrice": 0.0025,
158
+ "completionPrice": 0.010
159
+ },
160
+ "gpt-4o-2024-05-13": {
161
+ "promptPrice": 0.005,
162
+ "completionPrice": 0.015
163
+ },
164
+ "gpt-4o-mini": {
165
+ "promptPrice": 0.00015,
166
+ "completionPrice": 0.0006
167
+ },
168
+ "gpt-4o-mini-2024-07-18": {
169
+ "promptPrice": 0.00015,
170
+ "completionPrice": 0.0006
171
+ },
172
+ "o1-mini": {
173
+ "promptPrice": 0.003,
174
+ "completionPrice": 0.012
175
+ },
176
+ "o1-mini-2024-09-12": {
177
+ "promptPrice": 0.003,
178
+ "completionPrice": 0.012
179
+ },
180
+ "o1-preview": {
181
+ "promptPrice": 0.015,
182
+ "completionPrice": 0.06
183
+ },
184
+ "o1-preview-2024-09-12": {
185
+ "promptPrice": 0.015,
186
+ "completionPrice": 0.06
187
+ },
188
+ "gpt-3.5-turbo": {
189
+ "promptPrice": 0.0005,
190
+ "completionPrice": 0.0015
191
+ },
192
+ "gpt-3.5-turbo-0125": {
193
+ "promptPrice": 0.0005,
194
+ "completionPrice": 0.0015
195
+ },
196
+ "azure_gpt-35-turbo": {
197
+ "promptPrice": 0.0005,
198
+ "completionPrice": 0.0015
199
+ },
200
+ "azure_gpt-35-turbo-16k": {
201
+ "promptPrice": 0.0005,
202
+ "completionPrice": 0.0015
203
+ },
204
+ "azure_gpt-35-turbo-instruct": {
205
+ "promptPrice": 0.0015,
206
+ "completionPrice": 0.0020
207
+ },
208
+ "gpt-4": {
209
+ "promptPrice": 0.03,
210
+ "completionPrice": 0.06
211
+ },
212
+ "gpt-4-turbo": {
213
+ "promptPrice": 0.01,
214
+ "completionPrice": 0.03
215
+ },
216
+ "gpt-4-32k": {
217
+ "promptPrice": 0.06,
218
+ "completionPrice": 0.12
219
+ },
220
+ "gpt-4-1106-preview": {
221
+ "promptPrice": 0.01,
222
+ "completionPrice": 0.03
223
+ },
224
+ "gpt-4-0125-preview": {
225
+ "promptPrice": 0.01,
226
+ "completionPrice": 0.03
227
+ },
228
+ "gpt-4-preview": {
229
+ "promptPrice": 0.01,
230
+ "completionPrice": 0.03
231
+ },
232
+ "gpt-4-1106-vision-preview": {
233
+ "promptPrice": 0.01,
234
+ "completionPrice": 0.03
235
+ },
236
+ "gpt-4-vision-preview": {
237
+ "promptPrice": 0.01,
238
+ "completionPrice": 0.03
239
+ },
240
+ "azure_gpt-4": {
241
+ "promptPrice": 0.03,
242
+ "completionPrice": 0.06
243
+ },
244
+ "azure_gpt-4-32k": {
245
+ "promptPrice": 0.06,
246
+ "completionPrice": 0.12
247
+ },
248
+ "claude-3-opus-20240229": {
249
+ "promptPrice": 0.015,
250
+ "completionPrice": 0.075
251
+ },
252
+ "claude-3-sonnet-20240229": {
253
+ "promptPrice": 0.003,
254
+ "completionPrice": 0.015
255
+ },
256
+ "claude-3-haiku-20240307": {
257
+ "promptPrice": 0.00025,
258
+ "completionPrice": 0.00125
259
+ },
260
+ "command": {
261
+ "promptPrice": 0.001,
262
+ "completionPrice": 0.002
263
+ },
264
+ "command-nightly": {
265
+ "promptPrice": 0.001,
266
+ "completionPrice": 0.002
267
+ },
268
+ "command-light": {
269
+ "promptPrice": 0.0003,
270
+ "completionPrice": 0.0006
271
+ },
272
+ "command-light-nightly": {
273
+ "promptPrice": 0.0003,
274
+ "completionPrice": 0.0006
275
+ },
276
+ "open-mistral-7b": {
277
+ "promptPrice": 0.00025,
278
+ "completionPrice": 0.00025
279
+ },
280
+ "open-mixtral-8x7b": {
281
+ "promptPrice": 0.0007,
282
+ "completionPrice": 0.0007
283
+ },
284
+ "mistral-small-latest": {
285
+ "promptPrice": 0.002,
286
+ "completionPrice": 0.006
287
+ },
288
+ "mistral-medium-latest": {
289
+ "promptPrice": 0.0027,
290
+ "completionPrice": 0.0081
291
+ },
292
+ "mistral-large-latest": {
293
+ "promptPrice": 0.008,
294
+ "completionPrice": 0.024
295
+ },
296
+ "amazon.titan-text-express-v1": {
297
+ "promptPrice": 0.0008,
298
+ "completionPrice": 0.0016
299
+ },
300
+ "amazon.titan-text-lite-v1": {
301
+ "promptPrice": 0.0003,
302
+ "completionPrice": 0.0004
303
+ },
304
+ "mistral.mistral-7b-instruct-v0:2": {
305
+ "promptPrice": 0.00015,
306
+ "completionPrice": 0.0002
307
+ },
308
+ "mistral.mixtral-8x7b-instruct-v0:1": {
309
+ "promptPrice": 0.00045,
310
+ "completionPrice": 0.0007
311
+ },
312
+ "mistral.mistral-large-2402-v1:0": {
313
+ "promptPrice": 0.008,
314
+ "completionPrice": 0.024
315
+ },
316
+ "anthropic.claude-3-haiku-20240307-v1:0": {
317
+ "promptPrice": 0.00025,
318
+ "completionPrice": 0.00125
319
+ },
320
+ "anthropic.claude-v2": {
321
+ "promptPrice": 0.008,
322
+ "completionPrice": 0.024
323
+ },
324
+ "anthropic.claude-3-sonnet-20240229-v1:0": {
325
+ "promptPrice": 0.003,
326
+ "completionPrice": 0.015
327
+ },
328
+ "anthropic.claude-3-opus-20240229-v1:0": {
329
+ "promptPrice": 0.015,
330
+ "completionPrice": 0.075
331
+ },
332
+ "meta.llama3-8b-instruct-v1:0": {
333
+ "promptPrice": 0.0004,
334
+ "completionPrice": 0.0006
335
+ },
336
+ "meta.llama3-70b-instruct-v1:0": {
337
+ "promptPrice": 0.00265,
338
+ "completionPrice": 0.0035
339
+ },
340
+ "meta.llama2-13b-chat-v1": {
341
+ "promptPrice": 0.00075,
342
+ "completionPrice": 0.001
343
+ },
344
+ "meta.llama2-70b-chat-v1": {
345
+ "promptPrice": 0.00195,
346
+ "completionPrice": 0.00256
347
+ },
348
+ "cohere.command-text-v14": {
349
+ "promptPrice": 0.0015,
350
+ "completionPrice": 0.0020
351
+ },
352
+ "cohere.command-light-text-v14": {
353
+ "promptPrice": 0.0003,
354
+ "completionPrice": 0.0006
355
+ },
356
+ "ai21.j2-mid-v1": {
357
+ "promptPrice": 0.0125,
358
+ "completionPrice": 0.0125
359
+ },
360
+ "ai21.j2-ultra-v1": {
361
+ "promptPrice": 0.0188,
362
+ "completionPrice": 0.0188
363
+ },
364
+ "gemini-1.0-pro": {
365
+ "promptPrice": 0.0005,
366
+ "completionPrice": 0.0015
367
+ },
368
+ "gemini-1.5-flash": {
369
+ "promptPrice": 0.000075,
370
+ "completionPrice": 0.0003
371
+ },
372
+ "gemini-1.5-pro": {
373
+ "promptPrice": 0.00125,
374
+ "completionPrice": 0.005
375
+ },
376
+ "gemini-1.0-pro-002": {
377
+ "promptPrice": 0.0005,
378
+ "completionPrice": 0.0015
379
+ },
380
+ "gemini-1.0-pro-001": {
381
+ "promptPrice": 0.0005,
382
+ "completionPrice": 0.0015
383
+ },
384
+ "gemini-1.5-pro-preview-0409": {
385
+ "promptPrice": 0.005,
386
+ "completionPrice": 0.015
387
+ },
388
+ "gemini-1.5-pro-preview-0514": {
389
+ "promptPrice": 0.005,
390
+ "completionPrice": 0.015
391
+ },
392
+ "gemini-1.5-flash-preview-0514": {
393
+ "promptPrice": 0.0005,
394
+ "completionPrice": 0.0015
395
+ },
396
+ "gemini-2.0-flash": {
397
+ "promptPrice": 0.0001,
398
+ "completionPrice": 0.0004
399
+ },
400
+ "gemini-2.0-flash-lite": {
401
+ "promptPrice": 0.000075,
402
+ "completionPrice": 0.0003
403
+ },
404
+ "gemini-2.5-flash": {
405
+ "promptPrice": 0.0003,
406
+ "completionPrice": 0.0025
407
+ },
408
+ "gemini-2.5-flash-preview": {
409
+ "promptPrice": 0.0003,
410
+ "completionPrice": 0.0025
411
+ },
412
+ "gemini-2.5-flash-lite": {
413
+ "promptPrice": 0.0001,
414
+ "completionPrice": 0.0004
415
+ },
416
+ "gemini-2.5-flash-lite-preview": {
417
+ "promptPrice": 0.0001,
418
+ "completionPrice": 0.0004
419
+ },
420
+ "gemini-2.5-pro": {
421
+ "promptPrice": 0.00125,
422
+ "completionPrice": 0.01
423
+ },
424
+ "text-bison": {
425
+ "promptPrice": 0.001,
426
+ "completionPrice": 0.002
427
+ },
428
+ "text-bison@002": {
429
+ "promptPrice": 0.001,
430
+ "completionPrice": 0.002
431
+ },
432
+ "text-bison-32k": {
433
+ "promptPrice": 0.001,
434
+ "completionPrice": 0.002
435
+ },
436
+ "text-bison-32k@002": {
437
+ "promptPrice": 0.001,
438
+ "completionPrice": 0.002
439
+ },
440
+ "text-unicorn": {
441
+ "promptPrice": 0.01,
442
+ "completionPrice": 0.03
443
+ },
444
+ "text-unicorn@001": {
445
+ "promptPrice": 0.01,
446
+ "completionPrice": 0.03
447
+ },
448
+ "chat-bison": {
449
+ "promptPrice": 0.001,
450
+ "completionPrice": 0.002
451
+ },
452
+ "chat-bison@002": {
453
+ "promptPrice": 0.001,
454
+ "completionPrice": 0.002
455
+ },
456
+ "chat-bison-32k": {
457
+ "promptPrice": 0.001,
458
+ "completionPrice": 0.002
459
+ },
460
+ "chat-bison-32k@002": {
461
+ "promptPrice": 0.001,
462
+ "completionPrice": 0.002
463
+ },
464
+ "llama3-8b-8192": {
465
+ "promptPrice": 0.00005,
466
+ "completionPrice": 0.0001
467
+ },
468
+ "llama3-70b-8192": {
469
+ "promptPrice": 0.00059,
470
+ "completionPrice": 0.00079
471
+ },
472
+ "mixtral-8x7b-32768": {
473
+ "promptPrice": 0.00024,
474
+ "completionPrice": 0.00024
475
+ },
476
+ "gemma-7b-it": {
477
+ "promptPrice": 0.0001,
478
+ "completionPrice": 0.0001
479
+ },
480
+ "reka-core": {
481
+ "promptPrice": 0.002,
482
+ "completionPrice": 0.002
483
+ },
484
+ "reka-core-20240415": {
485
+ "promptPrice": 0.002,
486
+ "completionPrice": 0.002
487
+ },
488
+ "reka-core-20240501": {
489
+ "promptPrice": 0.002,
490
+ "completionPrice": 0.002
491
+ },
492
+ "reka-flash": {
493
+ "promptPrice": 0.0002,
494
+ "completionPrice": 0.0008
495
+ },
496
+ "reka-flash-20240226": {
497
+ "promptPrice": 0.0002,
498
+ "completionPrice": 0.0008
499
+ },
500
+ "reka-edge": {
501
+ "promptPrice": 0.0001,
502
+ "completionPrice": 0.0001
503
+ },
504
+ "reka-edge-20240208": {
505
+ "promptPrice": 0.0001,
506
+ "completionPrice": 0.0001
507
+ },
508
+ "reka-spark": {
509
+ "promptPrice": 0.00005,
510
+ "completionPrice": 0.00005
511
+ },
512
+ "grok-beta": {
513
+ "promptPrice": 0.0005,
514
+ "completionPrice": 0.0015
515
+ },
516
+ "grok-vision-beta": {
517
+ "promptPrice": 0.0005,
518
+ "completionPrice": 0.0015
519
+ },
520
+ "jamba-1.5-mini": {
521
+ "promptPrice": 0.0002,
522
+ "completionPrice": 0.0004
523
+ },
524
+ "jamba-1.5-large": {
525
+ "promptPrice": 0.002,
526
+ "completionPrice": 0.008
527
+ },
528
+ "meta-llama/Llama-3.3-70B-Instruct-Turbo": {
529
+ "promptPrice": 0.00088,
530
+ "completionPrice": 0.00088
531
+ },
532
+ "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo-vLLM-json":{
533
+ "promptPrice": 0.00088,
534
+ "completionPrice": 0.00088
535
+ },
536
+ "meta-llama/Meta-Llama-3.1-405B-Instruct-Lite-Pro-lora":{
537
+ "promptPrice": 0.00088,
538
+ "completionPrice": 0.00088
539
+ },
540
+ "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo":{
541
+ "promptPrice": 0.00088,
542
+ "completionPrice": 0.00088
543
+ },
544
+ "Qwen/QwQ-32B-Preview":{
545
+ "promptPrice": 0.0012,
546
+ "completionPrice": 0.0012
547
+ },
548
+ "codellama/CodeLlama-34b-Instruct-hf":{
549
+ "promptPrice": 0.0008,
550
+ "completionPrice":0.0008
551
+ },
552
+ "databricks/dbrx-instruct":{
553
+ "promptPrice": 0.0012,
554
+ "completionPrice": 0.0012
555
+ },
556
+ "deepseek-ai/deepseek-llm-67b-chat":{
557
+ "promptPrice": 0.0009,
558
+ "completionPrice": 0.0009
559
+ },
560
+ "google/gemma-2b-it":{
561
+ "promptPrice": 0.0001,
562
+ "completionPrice": 0.0001
563
+ },
564
+ "google/gemma-2-27b-it":{
565
+ "promptPrice": 0.0008,
566
+ "completionPrice": 0.0008
567
+ },
568
+ "google/gemma-2-9b-it":{
569
+ "promptPrice": 0.0003,
570
+ "completionPrice": 0.0003
571
+ },
572
+ "Gryphe/MythoMax-L2-13b-Lite":{
573
+ "promptPrice": 0.0003,
574
+ "completionPrice": 0.0003
575
+ },
576
+ "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF":{
577
+ "promptPrice": 0.0088,
578
+ "completionPrice": 0.0088
579
+ },
580
+ "deepseek-chat":{
581
+ "promptPrice": 0.00014,
582
+ "completionPrice": 0.00028
583
+ },
584
+ "deepseek-reasoner":{
585
+ "promptPrice": 0.00055,
586
+ "completionPrice": 0.00219
587
+ }
588
+ }
589
+ }
@@ -0,0 +1,45 @@
1
+ """Centralized logging configuration"""
2
+
3
+ import logging
4
+ import os
5
+ import sys
6
+ from logging.handlers import RotatingFileHandler
7
+ from typing import Optional
8
+
9
+
10
+ def setup_logging(
11
+ level: Optional[str] = None, log_dir: str = "logs", log_file_name: str = "genai_otel.log"
12
+ ):
13
+ """Configure logging for the library with configurable log level via environment variable
14
+ and log rotation.
15
+ """
16
+ # Determine log level from environment variable or default to INFO
17
+ env_log_level = os.environ.get("GENAI_OTEL_LOG_LEVEL")
18
+ log_level_str = level or env_log_level or "INFO"
19
+ log_level = getattr(logging, log_level_str.upper(), logging.INFO)
20
+
21
+ # Create logs directory if it doesn't exist
22
+ os.makedirs(log_dir, exist_ok=True)
23
+ log_file_path = os.path.join(log_dir, log_file_name)
24
+
25
+ # Setup handlers
26
+ handlers = [logging.StreamHandler(sys.stdout)]
27
+
28
+ # Add rotating file handler
29
+ file_handler = RotatingFileHandler(log_file_path, maxBytes=10 * 1024 * 1024, backupCount=10)
30
+ handlers.append(file_handler)
31
+
32
+ # Set library logger
33
+ logger = logging.getLogger("genai_otel")
34
+ logger.setLevel(log_level)
35
+
36
+ # Clear existing handlers to prevent duplicates in case of multiple calls
37
+ if logger.handlers:
38
+ for handler in logger.handlers:
39
+ handler.close()
40
+ logger.handlers = []
41
+
42
+ for handler in handlers:
43
+ logger.addHandler(handler)
44
+
45
+ return logger
@@ -0,0 +1,14 @@
1
+ """Module for OpenTelemetry instrumentors for Model Context Protocol (MCP) tools.
2
+
3
+ This package contains individual instrumentor classes for various MCP tools,
4
+ including databases, caching layers, message queues, vector databases, and
5
+ generic API clients, enabling automatic tracing and metric collection of their operations.
6
+ """
7
+
8
+ # pylint: disable=R0801
9
+ import httpx
10
+
11
+ from .base import BaseMCPInstrumentor
12
+ from .manager import MCPInstrumentorManager
13
+
14
+ __all__ = ["BaseMCPInstrumentor", "MCPInstrumentorManager"]