-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#[cfg(any(feature = "aws", feature = "aws_dynamo"))] | ||
pub fn info_span_dynamo(dynamo_client: aws_sdk_dynamodb::model::DynamoClient, table_name: &str, operation: &str, method: &str) -> tracing::Span { | ||
{ | ||
// Spans will be sent to the configured OpenTelemetry exporter | ||
// use telemetry_rust::OpenTelemetrySpanExt; | ||
// region().await.unwrap() | ||
let config = dynamo_client.config(); | ||
if let Some(region) = config.region() { | ||
println!("config>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> {:?}", config); | ||
// let http_client = config.http_client().unwrap(); | ||
|
||
let span = tracing::info_span!( | ||
"aws_dynamo", | ||
dynamoDB = tracing::field::Empty, | ||
operation = tracing::field::Empty, | ||
tableName = tracing::field::Empty, | ||
method = tracing::field::Empty, | ||
service = tracing::field::Empty, | ||
cloud.region = tracing::field::Empty, | ||
http_client = tracing::field::Empty, | ||
// childSpan = tracing::field::Empty, | ||
); | ||
let _guard = span.enter(); | ||
span.record("dynamoDB", &"true"); | ||
span.record("operation", &operation); | ||
span.record("tableName", &table_name); | ||
span.record("method", &method); | ||
span.record("service", "AWS::DynamoDB"); | ||
span.record("cloud.region", region.as_ref() ); | ||
} | ||
// span.record("childSpan", dynamo_client.config().instrument(span!(tracing::Level::INFO, "aws_dynamo"))); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#[cfg(feature = "axum")] | ||
pub mod axum; | ||
#[cfg(feature = "aws")] | ||
pub mod aws; |