-
Notifications
You must be signed in to change notification settings - Fork 16
feat(bottlecap): add runtime tag
#464
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,12 @@ use crate::{ | |
| span_inferrer::SpanInferrer, tag_span_from_value, | ||
| }, | ||
| metrics::enhanced::lambda::{EnhancedMetricData, Lambda as EnhancedMetrics}, | ||
| proc::{self, CPUData, NetworkData}, | ||
| tags::provider, | ||
| proc::{ | ||
| self, | ||
| constants::{ETC_PATH, PROC_PATH}, | ||
| CPUData, NetworkData, | ||
| }, | ||
| tags::{lambda::tags::resolve_runtime_from_proc, provider}, | ||
| telemetry::events::{ReportMetrics, Status}, | ||
| traces::{ | ||
| context::SpanContext, | ||
|
|
@@ -63,6 +67,7 @@ pub struct Processor { | |
| aws_config: AwsConfig, | ||
| // Flag to determine if a tracer was detected | ||
| tracer_detected: bool, | ||
| runtime: Option<String>, | ||
| config: Arc<config::Config>, | ||
| } | ||
|
|
||
|
|
@@ -91,6 +96,7 @@ impl Processor { | |
| enhanced_metrics: EnhancedMetrics::new(metrics_aggregator, Arc::clone(&config)), | ||
| aws_config: aws_config.clone(), | ||
| tracer_detected: false, | ||
| runtime: None, | ||
| config: Arc::clone(&config), | ||
| } | ||
| } | ||
|
|
@@ -166,6 +172,11 @@ impl Processor { | |
| } else { | ||
| cold_start = true; | ||
| } | ||
|
|
||
| // Resolve runtime only once | ||
| let runtime = resolve_runtime_from_proc(PROC_PATH, ETC_PATH); | ||
| self.enhanced_metrics.set_runtime_tag(&runtime); | ||
| self.runtime = Some(runtime); | ||
| } | ||
|
|
||
| if proactive_initialization { | ||
|
|
@@ -174,6 +185,13 @@ impl Processor { | |
| proactive_initialization.to_string(), | ||
| ); | ||
| } | ||
|
|
||
| if let Some(runtime) = &self.runtime { | ||
| self.span | ||
| .meta | ||
| .insert(String::from("runtime"), runtime.to_string()); | ||
| } | ||
|
Comment on lines
+188
to
+193
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if we actually need this, it looks like previous versions have the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do need it |
||
|
|
||
| self.span | ||
| .meta | ||
| .insert(String::from("cold_start"), cold_start.to_string()); | ||
|
|
||
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 is definitely needed tho