- 
                Notifications
    
You must be signed in to change notification settings  - Fork 913
 
Resource in AutoConfiguredOpenTelemetrySdk object is configured from the 'resource' YAML node #7418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
            robsunday
  wants to merge
  11
  commits into
  open-telemetry:main
from
robsunday:fbc-create-resource-from-model
  
      
      
   
      
    
  
     Closed
                    Changes from 4 commits
      Commits
    
    
            Show all changes
          
          
            11 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      db4e2e0
              
                Resource set in the AutoConfiguredOpenTelemetrySdk object is now conf…
              
              
                robsunday d45b6a8
              
                Reverting some unnecessary changes.
              
              
                robsunday 99826d3
              
                UT fix
              
              
                robsunday a23d196
              
                spotless
              
              
                robsunday 6defc6d
              
                UT added
              
              
                robsunday 0e684c0
              
                Merge branch 'main' into fbc-create-resource-from-model
              
              
                robsunday 14f0b08
              
                UT added
              
              
                robsunday f451e45
              
                Merge branch 'open-telemetry:main' into fbc-create-resource-from-model
              
              
                robsunday 593ffb0
              
                Merge branch 'main' into fbc-create-resource-from-model
              
              
                robsunday a0be1ff
              
                Fix after merge
              
              
                robsunday 08fe64e
              
                Merge branch 'main' into fbc-create-resource-from-model
              
              
                robsunday File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or 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 hidden or 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 hidden or 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.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that we are calling
ResourceFactorytwice, but the alternative is forDeclarativeConfiguration#createto return a tuple ofOpenTelemetrySdkandResourcesuch that the resource is accessible, which isn't great either.I actually want to get rid of the incubating API to access the autoconfigured resource. Its come up in a variety of conversations (including this comment), but the TL;DR is:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning tuple from
DeclarativeConfiguration#createwould actually require updates ofOpenTelemetryConfigurationFactory#create. This would also require some additional classes and maybe reane ofOpenTelemetryConfigurationFactory.I think instantiating resource twice is good enough solution.
Regarding the change you mentioned:
Do you plan to get rid of the
resourceproperty andgetResourcemetod fromAutoConfiguredOpenTelemetrySdkclass?If yes, then it may cause lots of issues in some vendor's code. We use it in our code in few places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but why? I'm still searching for a compelling reason vendors do this. Every instance I've seen so far has been dubious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @robsunday you may be interested in this proposal and conversation: https://github.com/open-telemetry/opentelemetry-specification/pull/4565/files#r2193326632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The agent is using the resource as well: https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-java-instrumentation%20ConfiguredResourceAttributesHolder&type=code