-   Notifications  
You must be signed in to change notification settings  - Fork 46
 
Extract span tags from triggering event #101
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
   Merged  
     Merged  
 Changes from 1 commit
 Commits 
  Show all changes 
  26 commits   Select commit Hold shift + click to select a range 
 2f051a6  add trigger event span tags 
  DylanLovesCoffee d6fbf3e  add tests and sample events 
  DylanLovesCoffee ce92c3f  Merge branch 'master' into dylan/trigger-tags 
  DylanLovesCoffee 64fb4ec  update snapshots 
  DylanLovesCoffee 080f007  lint 
  DylanLovesCoffee 1d611c0  implement feedback 
  DylanLovesCoffee d83ee4e  refactor adding tags 
  DylanLovesCoffee b840c3d  black 
  DylanLovesCoffee d731561  include alb for http tags 
  DylanLovesCoffee 15c4610  add s3 test 
  DylanLovesCoffee ec51ccd  nits and add CN and Gov arn regions 
  DylanLovesCoffee f275936  always add trigger tags to xray subseg 
  DylanLovesCoffee 9cfaedc  implement feedback 
  DylanLovesCoffee 1965908  handle Lambda response status code 
  DylanLovesCoffee e680aff  renaming for specificity 
  DylanLovesCoffee c0bc254  carry response status_code to xray 
  DylanLovesCoffee eaa952d  cleanup 
  DylanLovesCoffee 195a6aa  fix merge conflicts 
  DylanLovesCoffee 369bdfc  add xray dummy subsegment for trigger tags at end of invocation 
  DylanLovesCoffee 79140cf  rename trigger tag and update snapshots 
  DylanLovesCoffee a02c289  lint EOF extra line 
  DylanLovesCoffee a9bbf0c  update with feedback 
  DylanLovesCoffee 5375952  Merge branch 'main' into dylan/trigger-tags 
  DylanLovesCoffee 0e71a7e  update snapshots 
  DylanLovesCoffee 20b4945  fix 
  DylanLovesCoffee 3190475  fix my fix 
  DylanLovesCoffee 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
 always add trigger tags to xray subseg 
 - Loading branch information
 
   commit f2759361c6ba71243c9dcdfebf6838e4c72eb4b9  
 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   
     | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|      |  @@ -19,6 +19,7 @@ | |
| from datadog_lambda.tracing import ( | ||
| extract_dd_trace_context, | ||
| create_dd_metadata_subsegment, | ||
| create_dd_root_span_metadata_subsegment, | ||
| inject_correlation_ids, | ||
| dd_tracing_enabled, | ||
| set_correlation_ids, | ||
|      |  @@ -123,12 +124,14 @@ def _before(self, event, context): | |
|   |  ||
| set_cold_start() | ||
| submit_invocations_metric(context) | ||
| # Extract trigger tags | ||
| # Extract trigger tags and add them to a subsegment if found | ||
    DylanLovesCoffee marked this conversation as resolved.    Outdated   Show resolved Hide resolved  |  ||
| trigger_tags = extract_trigger_tags(event, context) | ||
| if trigger_tags: | ||
| create_dd_root_span_metadata_subsegment(trigger_tags) | ||
    |  ||
| # Extract Datadog trace context and source from incoming requests | ||
| dd_context, trace_context_source = extract_dd_trace_context(event) | ||
| if trace_context_source == TraceContextSource.EVENT: | ||
| create_dd_metadata_subsegment(dd_context, trigger_tags) | ||
| create_dd_metadata_subsegment(dd_context) | ||
|   |  ||
| self.span = None | ||
| if dd_tracing_enabled: | ||
|      |  ||
   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   
            2 changes: 1 addition & 1 deletion  2   tests/integration/snapshots/logs/async-metrics_python27_with_plugin.log          
     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   
            2 changes: 1 addition & 1 deletion  2   tests/integration/snapshots/logs/async-metrics_python36_with_plugin.log          
     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   
            2 changes: 1 addition & 1 deletion  2   tests/integration/snapshots/logs/async-metrics_python37_with_plugin.log          
     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.    
 
Uh oh!
There was an error while loading. Please reload this page.