Skip to content

Commit

Permalink
feat: set service.instance.id on spans
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Oct 21, 2024
1 parent 5e7ca26 commit c2a52f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ fn get_otel_setup() -> Result<Option<(Tracer, opentelemetry_sdk::logs::LoggerPro
];

if let Some(execution_id) = get_otel_key("GRIT_EXECUTION_ID") {
resource_attrs.push(KeyValue::new("grit.execution.id", execution_id));
resource_attrs.push(KeyValue::new("grit.execution.id", execution_id.clone()));
// This is required by dash0 and other providers to treat each instance as a separate resource.
resource_attrs.push(KeyValue::new("service.instance.id", execution_id));
}

let resource = Resource::new(resource_attrs);
Expand Down

0 comments on commit c2a52f1

Please sign in to comment.