build(deps): bump opentelemetry crates to 0.27 (#6774)

This commit is contained in:
Sanchith Hegde
2024-12-10 16:35:34 +05:30
committed by GitHub
parent a52828296a
commit 47a3d2b2ab
86 changed files with 739 additions and 1086 deletions

View File

@ -63,7 +63,7 @@ impl AwsKmsClient {
// Logging using `Debug` representation of the error as the `Display`
// representation does not hold sufficient information.
logger::error!(aws_kms_sdk_error=?error, "Failed to AWS KMS decrypt data");
metrics::AWS_KMS_DECRYPTION_FAILURES.add(&metrics::CONTEXT, 1, &[]);
metrics::AWS_KMS_DECRYPTION_FAILURES.add(1, &[]);
})
.change_context(AwsKmsError::DecryptionFailed)?;
@ -75,7 +75,7 @@ impl AwsKmsClient {
})?;
let time_taken = start.elapsed();
metrics::AWS_KMS_DECRYPT_TIME.record(&metrics::CONTEXT, time_taken.as_secs_f64(), &[]);
metrics::AWS_KMS_DECRYPT_TIME.record(time_taken.as_secs_f64(), &[]);
Ok(output)
}
@ -99,7 +99,7 @@ impl AwsKmsClient {
// Logging using `Debug` representation of the error as the `Display`
// representation does not hold sufficient information.
logger::error!(aws_kms_sdk_error=?error, "Failed to AWS KMS encrypt data");
metrics::AWS_KMS_ENCRYPTION_FAILURES.add(&metrics::CONTEXT, 1, &[]);
metrics::AWS_KMS_ENCRYPTION_FAILURES.add(1, &[]);
})
.change_context(AwsKmsError::EncryptionFailed)?;
@ -108,7 +108,7 @@ impl AwsKmsClient {
.ok_or(AwsKmsError::MissingCiphertextEncryptionOutput)
.map(|blob| consts::BASE64_ENGINE.encode(blob.into_inner()))?;
let time_taken = start.elapsed();
metrics::AWS_KMS_ENCRYPT_TIME.record(&metrics::CONTEXT, time_taken.as_secs_f64(), &[]);
metrics::AWS_KMS_ENCRYPT_TIME.record(time_taken.as_secs_f64(), &[]);
Ok(output)
}

View File

@ -30,9 +30,8 @@ pub mod consts {
/// Metrics for interactions with external systems.
#[cfg(feature = "aws_kms")]
pub mod metrics {
use router_env::{counter_metric, global_meter, histogram_metric, metrics_context};
use router_env::{counter_metric, global_meter, histogram_metric_f64};
metrics_context!(CONTEXT);
global_meter!(GLOBAL_METER, "EXTERNAL_SERVICES");
#[cfg(feature = "aws_kms")]
@ -41,7 +40,7 @@ pub mod metrics {
counter_metric!(AWS_KMS_ENCRYPTION_FAILURES, GLOBAL_METER); // No. of AWS KMS Encryption failures
#[cfg(feature = "aws_kms")]
histogram_metric!(AWS_KMS_DECRYPT_TIME, GLOBAL_METER); // Histogram for AWS KMS decryption time (in sec)
histogram_metric_f64!(AWS_KMS_DECRYPT_TIME, GLOBAL_METER); // Histogram for AWS KMS decryption time (in sec)
#[cfg(feature = "aws_kms")]
histogram_metric!(AWS_KMS_ENCRYPT_TIME, GLOBAL_METER); // Histogram for AWS KMS encryption time (in sec)
histogram_metric_f64!(AWS_KMS_ENCRYPT_TIME, GLOBAL_METER); // Histogram for AWS KMS encryption time (in sec)
}