File tree Expand file tree Collapse file tree 7 files changed +42
-26
lines changed 
opentelemetry-instrumentation 
src/opentelemetry/instrumentation Expand file tree Collapse file tree 7 files changed +42
-26
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ requires = ["hatchling"]
33build-backend  = " hatchling.build" 
44
55[project ]
6- name  = " opentelemetry -distro" 
6+ name  = " tapm -distro" 
77dynamic  = [" version"  ]
8- description  = " OpenTelemetry  Python Distro" 
8+ description  = " TAPM  Python Distro" 
99readme  = " README.rst" 
1010license  = " Apache-2.0" 
1111requires-python  = " >=3.8" 
@@ -28,7 +28,7 @@ classifiers = [
2828]
2929dependencies  = [
3030  " opentelemetry-api ~= 1.12"  ,
31-   " opentelemetry -instrumentation == 0.55b0.dev "  ,
31+   " tapm -instrumentation == 0.55b2.post17 "  ,
3232  " opentelemetry-sdk ~= 1.13"  ,
3333]
3434
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and 
1313# limitations under the License. 
1414
15- __version__  =  "0.55b0.dev " 
15+ __version__  =  "0.55b0.post4 " 
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ requires = ["hatchling"]
33build-backend  = " hatchling.build" 
44
55[project ]
6- name  = " opentelemetry -instrumentation" 
6+ name  = " tapm -instrumentation" 
77dynamic  = [" version"  ]
88description  = " Instrumentation Tools & Auto Instrumentation for OpenTelemetry Python" 
99readme  = " README.rst" 
@@ -27,16 +27,16 @@ classifiers = [
2727]
2828dependencies  = [
2929  " opentelemetry-api ~= 1.4"  ,
30-   " opentelemetry-semantic-conventions ==  0.55b0.dev "  ,
30+   " opentelemetry-semantic-conventions >=  0.55b0"  ,
3131  " wrapt >= 1.0.0, < 2.0.0"  ,
3232  " packaging >= 18.0"  ,
3333]
3434
3535[project .scripts ]
36- opentelemetry -bootstrap  = " opentelemetry.instrumentation.bootstrap:run" 
37- opentelemetry -instrument  = " opentelemetry.instrumentation.auto_instrumentation:run" 
36+ tapm -bootstrap  = " opentelemetry.instrumentation.bootstrap:run" 
37+ tapm -instrument  = " opentelemetry.instrumentation.auto_instrumentation:run" 
3838
39- [project .entry-points .opentelemetry_environment_variables ]
39+ [project .entry-points .tapm_environment_variables ]
4040instrumentation  = " opentelemetry.instrumentation.environment_variables" 
4141
4242[project .urls ]
Original file line number Diff line number Diff line change @@ -52,21 +52,25 @@ def run() -> None:
5252    )
5353
5454    argument_otel_environment_variable  =  {}
55- 
56-     for  entry_point  in  entry_points (
57-         group = "opentelemetry_environment_variables" 
58-     ):
59-         environment_variable_module  =  entry_point .load ()
60- 
61-         for  attribute  in  dir (environment_variable_module ):
62-             if  attribute .startswith ("OTEL_" ):
63-                 argument  =  sub (r"OTEL_(PYTHON_)?" , "" , attribute ).lower ()
64- 
65-                 parser .add_argument (
66-                     f"--{ argument }  " ,
67-                     required = False ,
68-                 )
69-                 argument_otel_environment_variable [argument ] =  attribute 
55+     seen_arguments  =  set ()  # 跟踪已添加的参数以避免重复 
56+ 
57+     # 加载两个 entry point 组以保持兼容性 
58+     for  group_name  in  ["opentelemetry_environment_variables" , "tapm_environment_variables" ]:
59+         for  entry_point  in  entry_points (group = group_name ):
60+             environment_variable_module  =  entry_point .load ()
61+ 
62+             for  attribute  in  dir (environment_variable_module ):
63+                 if  attribute .startswith ("OTEL_" ):
64+                     argument  =  sub (r"OTEL_(PYTHON_)?" , "" , attribute ).lower ()
65+ 
66+                     # 检查参数是否已经添加过,避免重复 
67+                     if  argument  not  in   seen_arguments :
68+                         parser .add_argument (
69+                             f"--{ argument }  " ,
70+                             required = False ,
71+                         )
72+                         argument_otel_environment_variable [argument ] =  attribute 
73+                         seen_arguments .add (argument )
7074
7175    parser .add_argument (
7276        "--version" ,
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def _is_installed(req):
105105    except  PackageNotFoundError :
106106        return  False 
107107
108-     if  not  req .specifier . filter ( dist_version ) :
108+     if  dist_version   not  in   req .specifier :
109109        logger .warning (
110110            "instrumentation for package %s is available" 
111111            " but version %s is installed. Skipping." ,
Original file line number Diff line number Diff line change 1616# RUN `python scripts/generate_instrumentation_bootstrap.py` TO REGENERATE. 
1717
1818libraries  =  [
19+     {
20+         "library" : "langchain>=0.0.346" ,
21+         "instrumentation" : "tapm-instrumentation-langchain==0.40.7a3" ,
22+     },
23+     {
24+         "library" : "langchain-core>0.1.0" ,
25+         "instrumentation" : "tapm-instrumentation-langchain==0.40.7a3" ,
26+     },
27+     {
28+         "library" : "ollama>=0.2.0,<1" ,
29+         "instrumentation" : "tapm-instrumentation-ollama==0.40.7a3" ,
30+     },
1931    {
2032        "library" : "openai >= 1.26.0" ,
2133        "instrumentation" : "opentelemetry-instrumentation-openai-v2" ,
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and 
1313# limitations under the License. 
1414
15- __version__  =  "0.55b0.dev " 
15+ __version__  =  "0.55b2.post17 " 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments