This is an automated email from the ASF dual-hosted git repository.
oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new c2b55b6a8de0 CAMEL-23387: camel-telemetry - Add span decorators for
AWS STS, IAM, Secrets Manager, Parameter Store, Security Hub and Config (#23077)
c2b55b6a8de0 is described below
commit c2b55b6a8de065d1a596274f946a8297c3bbab44
Author: Andrea Cosentino <[email protected]>
AuthorDate: Fri May 8 10:28:06 2026 +0200
CAMEL-23387: camel-telemetry - Add span decorators for AWS STS, IAM,
Secrets Manager, Parameter Store, Security Hub and Config (#23077)
Fourth batch of AWS span decorators for camel-telemetry, covering the
Security & Identity group: STS, IAM, Secrets Manager, Parameter Store,
Security Hub and Config. All six are producer-only management APIs and
extend AbstractSpanDecorator, registered alphabetically in
META-INF/services. Tag selection follows two rules: never emit values
that may contain secrets (SSM SecureString values, Secrets Manager
secret values, IAM policy documents, STS temporary credentials,
Config conformance-pack template bodies) and prefer the request target
(secretId, parameterName, roleName, findingId, ...) over response
ARNs/IDs and bulk response payloads. Header constants are mirrored
from each component's *Constants interface to avoid hard module
dependencies, matching the convention from #23038, #23040 and #23045.
After review, dropped userName from IAM to avoid surfacing IAM
principal names to observability backends.
CAMEL-23387 stays open; remaining AWS components (AI/ML, Compute) will
land in subsequent PRs.
---
.../decorators/AwsConfigSpanDecorator.java | 73 ++++++++++++++++++++++
.../telemetry/decorators/AwsIamSpanDecorator.java | 73 ++++++++++++++++++++++
.../decorators/AwsParameterStoreSpanDecorator.java | 66 +++++++++++++++++++
.../decorators/AwsSecretsManagerSpanDecorator.java | 66 +++++++++++++++++++
.../decorators/AwsSecurityHubSpanDecorator.java | 66 +++++++++++++++++++
.../telemetry/decorators/AwsStsSpanDecorator.java | 73 ++++++++++++++++++++++
.../org.apache.camel.telemetry.SpanDecorator | 6 ++
.../decorators/AwsConfigSpanDecoratorTest.java | 63 +++++++++++++++++++
.../decorators/AwsIamSpanDecoratorTest.java | 61 ++++++++++++++++++
.../AwsParameterStoreSpanDecoratorTest.java | 60 ++++++++++++++++++
.../AwsSecretsManagerSpanDecoratorTest.java | 58 +++++++++++++++++
.../AwsSecurityHubSpanDecoratorTest.java | 58 +++++++++++++++++
.../decorators/AwsStsSpanDecoratorTest.java | 61 ++++++++++++++++++
13 files changed, 784 insertions(+)
diff --git
a/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsConfigSpanDecorator.java
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsConfigSpanDecorator.java
new file mode 100644
index 000000000000..9caac7c4bce1
--- /dev/null
+++
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsConfigSpanDecorator.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.telemetry.Span;
+
+public class AwsConfigSpanDecorator extends AbstractSpanDecorator {
+
+ static final String CONFIG_OPERATION = "operation";
+ static final String CONFIG_RULE_NAME = "ruleName";
+ static final String CONFIG_RULE_SOURCE_IDENTIFIER = "ruleSourceIdentifier";
+ static final String CONFIG_CONFORMANCE_PACK_NAME = "conformancePackName";
+
+ /**
+ * Constants copied from {@link
org.apache.camel.component.aws.config.AWSConfigConstants}
+ */
+ static final String OPERATION = "CamelAwsConfigOperation";
+ static final String RULE_NAME = "CamelAwsConfigRuleName";
+ static final String RULE_SOURCE_IDENTIFIER =
"CamelAwsConfigRuleSourceIdentifier";
+ static final String CONFORMANCE_PACK_NAME = "CamelAwsConformancePackName";
+
+ @Override
+ public String getComponent() {
+ return "aws-config";
+ }
+
+ @Override
+ public String getComponentClassName() {
+ return "org.apache.camel.component.aws.config.AWSConfigComponent";
+ }
+
+ @Override
+ public void beforeTracingEvent(Span span, Exchange exchange, Endpoint
endpoint) {
+ super.beforeTracingEvent(span, exchange, endpoint);
+
+ String operation = exchange.getIn().getHeader(OPERATION, String.class);
+ if (operation != null) {
+ span.setTag(CONFIG_OPERATION, operation);
+ }
+
+ String ruleName = exchange.getIn().getHeader(RULE_NAME, String.class);
+ if (ruleName != null) {
+ span.setTag(CONFIG_RULE_NAME, ruleName);
+ }
+
+ String ruleSourceIdentifier =
exchange.getIn().getHeader(RULE_SOURCE_IDENTIFIER, String.class);
+ if (ruleSourceIdentifier != null) {
+ span.setTag(CONFIG_RULE_SOURCE_IDENTIFIER, ruleSourceIdentifier);
+ }
+
+ String conformancePackName =
exchange.getIn().getHeader(CONFORMANCE_PACK_NAME, String.class);
+ if (conformancePackName != null) {
+ span.setTag(CONFIG_CONFORMANCE_PACK_NAME, conformancePackName);
+ }
+ }
+
+}
diff --git
a/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsIamSpanDecorator.java
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsIamSpanDecorator.java
new file mode 100644
index 000000000000..788a280cb610
--- /dev/null
+++
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsIamSpanDecorator.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.telemetry.Span;
+
+public class AwsIamSpanDecorator extends AbstractSpanDecorator {
+
+ static final String IAM_OPERATION = "operation";
+ static final String IAM_GROUP_NAME = "groupName";
+ static final String IAM_ROLE_NAME = "roleName";
+ static final String IAM_POLICY_NAME = "policyName";
+
+ /**
+ * Constants copied from {@link
org.apache.camel.component.aws2.iam.IAM2Constants}
+ */
+ static final String OPERATION = "CamelAwsIAMOperation";
+ static final String GROUP_NAME = "CamelAwsIAMGroupName";
+ static final String ROLE_NAME = "CamelAwsIAMRoleName";
+ static final String POLICY_NAME = "CamelAwsIAMPolicyName";
+
+ @Override
+ public String getComponent() {
+ return "aws2-iam";
+ }
+
+ @Override
+ public String getComponentClassName() {
+ return "org.apache.camel.component.aws2.iam.IAM2Component";
+ }
+
+ @Override
+ public void beforeTracingEvent(Span span, Exchange exchange, Endpoint
endpoint) {
+ super.beforeTracingEvent(span, exchange, endpoint);
+
+ String operation = exchange.getIn().getHeader(OPERATION, String.class);
+ if (operation != null) {
+ span.setTag(IAM_OPERATION, operation);
+ }
+
+ String groupName = exchange.getIn().getHeader(GROUP_NAME,
String.class);
+ if (groupName != null) {
+ span.setTag(IAM_GROUP_NAME, groupName);
+ }
+
+ String roleName = exchange.getIn().getHeader(ROLE_NAME, String.class);
+ if (roleName != null) {
+ span.setTag(IAM_ROLE_NAME, roleName);
+ }
+
+ String policyName = exchange.getIn().getHeader(POLICY_NAME,
String.class);
+ if (policyName != null) {
+ span.setTag(IAM_POLICY_NAME, policyName);
+ }
+ }
+
+}
diff --git
a/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsParameterStoreSpanDecorator.java
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsParameterStoreSpanDecorator.java
new file mode 100644
index 000000000000..cd0ed31f364c
--- /dev/null
+++
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsParameterStoreSpanDecorator.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.telemetry.Span;
+
+public class AwsParameterStoreSpanDecorator extends AbstractSpanDecorator {
+
+ static final String PARAMETER_STORE_OPERATION = "operation";
+ static final String PARAMETER_STORE_NAME = "parameterName";
+ static final String PARAMETER_STORE_PATH = "parameterPath";
+
+ /**
+ * Constants copied from {@link
org.apache.camel.component.aws.parameterstore.ParameterStoreConstants}
+ */
+ static final String OPERATION = "CamelAwsParameterStoreOperation";
+ static final String PARAMETER_NAME = "CamelAwsParameterStoreName";
+ static final String PARAMETER_PATH = "CamelAwsParameterStorePath";
+
+ @Override
+ public String getComponent() {
+ return "aws-parameter-store";
+ }
+
+ @Override
+ public String getComponentClassName() {
+ return
"org.apache.camel.component.aws.parameterstore.ParameterStoreComponent";
+ }
+
+ @Override
+ public void beforeTracingEvent(Span span, Exchange exchange, Endpoint
endpoint) {
+ super.beforeTracingEvent(span, exchange, endpoint);
+
+ String operation = exchange.getIn().getHeader(OPERATION, String.class);
+ if (operation != null) {
+ span.setTag(PARAMETER_STORE_OPERATION, operation);
+ }
+
+ String parameterName = exchange.getIn().getHeader(PARAMETER_NAME,
String.class);
+ if (parameterName != null) {
+ span.setTag(PARAMETER_STORE_NAME, parameterName);
+ }
+
+ String parameterPath = exchange.getIn().getHeader(PARAMETER_PATH,
String.class);
+ if (parameterPath != null) {
+ span.setTag(PARAMETER_STORE_PATH, parameterPath);
+ }
+ }
+
+}
diff --git
a/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsSecretsManagerSpanDecorator.java
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsSecretsManagerSpanDecorator.java
new file mode 100644
index 000000000000..4c64f65ed567
--- /dev/null
+++
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsSecretsManagerSpanDecorator.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.telemetry.Span;
+
+public class AwsSecretsManagerSpanDecorator extends AbstractSpanDecorator {
+
+ static final String SECRETS_MANAGER_OPERATION = "operation";
+ static final String SECRETS_MANAGER_SECRET_ID = "secretId";
+ static final String SECRETS_MANAGER_SECRET_NAME = "secretName";
+
+ /**
+ * Constants copied from {@link
org.apache.camel.component.aws.secretsmanager.SecretsManagerConstants}
+ */
+ static final String OPERATION = "CamelAwsSecretsManagerOperation";
+ static final String SECRET_ID = "CamelAwsSecretsManagerSecretId";
+ static final String SECRET_NAME = "CamelAwsSecretsManagerSecretName";
+
+ @Override
+ public String getComponent() {
+ return "aws-secrets-manager";
+ }
+
+ @Override
+ public String getComponentClassName() {
+ return
"org.apache.camel.component.aws.secretsmanager.SecretsManagerComponent";
+ }
+
+ @Override
+ public void beforeTracingEvent(Span span, Exchange exchange, Endpoint
endpoint) {
+ super.beforeTracingEvent(span, exchange, endpoint);
+
+ String operation = exchange.getIn().getHeader(OPERATION, String.class);
+ if (operation != null) {
+ span.setTag(SECRETS_MANAGER_OPERATION, operation);
+ }
+
+ String secretId = exchange.getIn().getHeader(SECRET_ID, String.class);
+ if (secretId != null) {
+ span.setTag(SECRETS_MANAGER_SECRET_ID, secretId);
+ }
+
+ String secretName = exchange.getIn().getHeader(SECRET_NAME,
String.class);
+ if (secretName != null) {
+ span.setTag(SECRETS_MANAGER_SECRET_NAME, secretName);
+ }
+ }
+
+}
diff --git
a/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsSecurityHubSpanDecorator.java
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsSecurityHubSpanDecorator.java
new file mode 100644
index 000000000000..65452883e17b
--- /dev/null
+++
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsSecurityHubSpanDecorator.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.telemetry.Span;
+
+public class AwsSecurityHubSpanDecorator extends AbstractSpanDecorator {
+
+ static final String SECURITY_HUB_OPERATION = "operation";
+ static final String SECURITY_HUB_FINDING_ID = "findingId";
+ static final String SECURITY_HUB_PRODUCT_ARN = "productArn";
+
+ /**
+ * Constants copied from {@link
org.apache.camel.component.aws.securityhub.SecurityHubConstants}
+ */
+ static final String OPERATION = "CamelAwsSecurityHubOperation";
+ static final String FINDING_ID = "CamelAwsSecurityHubFindingId";
+ static final String PRODUCT_ARN = "CamelAwsSecurityHubProductArn";
+
+ @Override
+ public String getComponent() {
+ return "aws-security-hub";
+ }
+
+ @Override
+ public String getComponentClassName() {
+ return
"org.apache.camel.component.aws.securityhub.SecurityHubComponent";
+ }
+
+ @Override
+ public void beforeTracingEvent(Span span, Exchange exchange, Endpoint
endpoint) {
+ super.beforeTracingEvent(span, exchange, endpoint);
+
+ String operation = exchange.getIn().getHeader(OPERATION, String.class);
+ if (operation != null) {
+ span.setTag(SECURITY_HUB_OPERATION, operation);
+ }
+
+ String findingId = exchange.getIn().getHeader(FINDING_ID,
String.class);
+ if (findingId != null) {
+ span.setTag(SECURITY_HUB_FINDING_ID, findingId);
+ }
+
+ String productArn = exchange.getIn().getHeader(PRODUCT_ARN,
String.class);
+ if (productArn != null) {
+ span.setTag(SECURITY_HUB_PRODUCT_ARN, productArn);
+ }
+ }
+
+}
diff --git
a/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsStsSpanDecorator.java
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsStsSpanDecorator.java
new file mode 100644
index 000000000000..795cfe6e0ecf
--- /dev/null
+++
b/components/camel-telemetry/src/main/java/org/apache/camel/telemetry/decorators/AwsStsSpanDecorator.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.telemetry.Span;
+
+public class AwsStsSpanDecorator extends AbstractSpanDecorator {
+
+ static final String STS_OPERATION = "operation";
+ static final String STS_ROLE_ARN = "roleArn";
+ static final String STS_ROLE_SESSION_NAME = "roleSessionName";
+ static final String STS_FEDERATED_NAME = "federatedName";
+
+ /**
+ * Constants copied from {@link
org.apache.camel.component.aws2.sts.STS2Constants}
+ */
+ static final String OPERATION = "CamelAwsStsOperation";
+ static final String ROLE_ARN = "CamelAwsStsRoleArn";
+ static final String ROLE_SESSION_NAME = "CamelAwsStsRoleSessionName";
+ static final String FEDERATED_NAME = "CamelAwsStsFederatedName";
+
+ @Override
+ public String getComponent() {
+ return "aws2-sts";
+ }
+
+ @Override
+ public String getComponentClassName() {
+ return "org.apache.camel.component.aws2.sts.STS2Component";
+ }
+
+ @Override
+ public void beforeTracingEvent(Span span, Exchange exchange, Endpoint
endpoint) {
+ super.beforeTracingEvent(span, exchange, endpoint);
+
+ String operation = exchange.getIn().getHeader(OPERATION, String.class);
+ if (operation != null) {
+ span.setTag(STS_OPERATION, operation);
+ }
+
+ String roleArn = exchange.getIn().getHeader(ROLE_ARN, String.class);
+ if (roleArn != null) {
+ span.setTag(STS_ROLE_ARN, roleArn);
+ }
+
+ String roleSessionName = exchange.getIn().getHeader(ROLE_SESSION_NAME,
String.class);
+ if (roleSessionName != null) {
+ span.setTag(STS_ROLE_SESSION_NAME, roleSessionName);
+ }
+
+ String federatedName = exchange.getIn().getHeader(FEDERATED_NAME,
String.class);
+ if (federatedName != null) {
+ span.setTag(STS_FEDERATED_NAME, federatedName);
+ }
+ }
+
+}
diff --git
a/components/camel-telemetry/src/main/resources/META-INF/services/org.apache.camel.telemetry.SpanDecorator
b/components/camel-telemetry/src/main/resources/META-INF/services/org.apache.camel.telemetry.SpanDecorator
index c34a4b214104..3c8600fb70dd 100644
---
a/components/camel-telemetry/src/main/resources/META-INF/services/org.apache.camel.telemetry.SpanDecorator
+++
b/components/camel-telemetry/src/main/resources/META-INF/services/org.apache.camel.telemetry.SpanDecorator
@@ -22,22 +22,28 @@ org.apache.camel.telemetry.decorators.AmqpSpanDecorator
org.apache.camel.telemetry.decorators.AwsAthenaSpanDecorator
org.apache.camel.telemetry.decorators.AwsBedrockSpanDecorator
org.apache.camel.telemetry.decorators.AwsCloudtrailSpanDecorator
+org.apache.camel.telemetry.decorators.AwsConfigSpanDecorator
org.apache.camel.telemetry.decorators.AwsCwSpanDecorator
org.apache.camel.telemetry.decorators.AwsDdbSpanDecorator
org.apache.camel.telemetry.decorators.AwsDdbStreamSpanDecorator
org.apache.camel.telemetry.decorators.AwsEventbridgeSpanDecorator
+org.apache.camel.telemetry.decorators.AwsIamSpanDecorator
org.apache.camel.telemetry.decorators.AwsKinesisFirehoseSpanDecorator
org.apache.camel.telemetry.decorators.AwsKinesisSpanDecorator
org.apache.camel.telemetry.decorators.AwsKmsSpanDecorator
org.apache.camel.telemetry.decorators.AwsLambdaSpanDecorator
org.apache.camel.telemetry.decorators.AwsMqSpanDecorator
org.apache.camel.telemetry.decorators.AwsMskSpanDecorator
+org.apache.camel.telemetry.decorators.AwsParameterStoreSpanDecorator
org.apache.camel.telemetry.decorators.AwsRedshiftDataSpanDecorator
org.apache.camel.telemetry.decorators.AwsS3SpanDecorator
+org.apache.camel.telemetry.decorators.AwsSecretsManagerSpanDecorator
+org.apache.camel.telemetry.decorators.AwsSecurityHubSpanDecorator
org.apache.camel.telemetry.decorators.AwsSesSpanDecorator
org.apache.camel.telemetry.decorators.AwsSnsSpanDecorator
org.apache.camel.telemetry.decorators.AwsSqsSpanDecorator
org.apache.camel.telemetry.decorators.AwsStepFunctionsSpanDecorator
+org.apache.camel.telemetry.decorators.AwsStsSpanDecorator
org.apache.camel.telemetry.decorators.AwsTimestreamSpanDecorator
org.apache.camel.telemetry.decorators.AzureServiceBusSpanDecorator
org.apache.camel.telemetry.decorators.CometdSpanDecorator
diff --git
a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsConfigSpanDecoratorTest.java
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsConfigSpanDecoratorTest.java
new file mode 100644
index 000000000000..1d99222c2cdd
--- /dev/null
+++
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsConfigSpanDecoratorTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.telemetry.mock.MockSpanAdapter;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AwsConfigSpanDecoratorTest {
+
+ @Test
+ public void testPre() {
+ String operation = "putConfigRule";
+ String ruleName = "required-tags";
+ String ruleSourceIdentifier = "REQUIRED_TAGS";
+ String conformancePackName = "Operational-Best-Practices";
+
+ Endpoint endpoint = Mockito.mock(Endpoint.class);
+ Exchange exchange = Mockito.mock(Exchange.class);
+ Message message = Mockito.mock(Message.class);
+
+
Mockito.when(endpoint.getEndpointUri()).thenReturn("aws-config:default");
+ Mockito.when(exchange.getIn()).thenReturn(message);
+ Mockito.when(exchange.getExchangeId()).thenReturn("exchange-1");
+ Mockito.when(message.getHeader(AwsConfigSpanDecorator.OPERATION,
String.class)).thenReturn(operation);
+ Mockito.when(message.getHeader(AwsConfigSpanDecorator.RULE_NAME,
String.class)).thenReturn(ruleName);
+
Mockito.when(message.getHeader(AwsConfigSpanDecorator.RULE_SOURCE_IDENTIFIER,
String.class))
+ .thenReturn(ruleSourceIdentifier);
+
Mockito.when(message.getHeader(AwsConfigSpanDecorator.CONFORMANCE_PACK_NAME,
String.class))
+ .thenReturn(conformancePackName);
+
+ AbstractSpanDecorator decorator = new AwsConfigSpanDecorator();
+
+ MockSpanAdapter span = new MockSpanAdapter();
+
+ decorator.beforeTracingEvent(span, exchange, endpoint);
+
+ assertEquals(operation,
span.tags().get(AwsConfigSpanDecorator.CONFIG_OPERATION));
+ assertEquals(ruleName,
span.tags().get(AwsConfigSpanDecorator.CONFIG_RULE_NAME));
+ assertEquals(ruleSourceIdentifier,
span.tags().get(AwsConfigSpanDecorator.CONFIG_RULE_SOURCE_IDENTIFIER));
+ assertEquals(conformancePackName,
span.tags().get(AwsConfigSpanDecorator.CONFIG_CONFORMANCE_PACK_NAME));
+ }
+
+}
diff --git
a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsIamSpanDecoratorTest.java
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsIamSpanDecoratorTest.java
new file mode 100644
index 000000000000..de188b197a9b
--- /dev/null
+++
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsIamSpanDecoratorTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.telemetry.mock.MockSpanAdapter;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AwsIamSpanDecoratorTest {
+
+ @Test
+ public void testPre() {
+ String operation = "createGroup";
+ String groupName = "engineers";
+ String roleName = "deployer";
+ String policyName = "ReadOnlyAccess";
+
+ Endpoint endpoint = Mockito.mock(Endpoint.class);
+ Exchange exchange = Mockito.mock(Exchange.class);
+ Message message = Mockito.mock(Message.class);
+
+ Mockito.when(endpoint.getEndpointUri()).thenReturn("aws2-iam:default");
+ Mockito.when(exchange.getIn()).thenReturn(message);
+ Mockito.when(exchange.getExchangeId()).thenReturn("exchange-1");
+ Mockito.when(message.getHeader(AwsIamSpanDecorator.OPERATION,
String.class)).thenReturn(operation);
+ Mockito.when(message.getHeader(AwsIamSpanDecorator.GROUP_NAME,
String.class)).thenReturn(groupName);
+ Mockito.when(message.getHeader(AwsIamSpanDecorator.ROLE_NAME,
String.class)).thenReturn(roleName);
+ Mockito.when(message.getHeader(AwsIamSpanDecorator.POLICY_NAME,
String.class)).thenReturn(policyName);
+
+ AbstractSpanDecorator decorator = new AwsIamSpanDecorator();
+
+ MockSpanAdapter span = new MockSpanAdapter();
+
+ decorator.beforeTracingEvent(span, exchange, endpoint);
+
+ assertEquals(operation,
span.tags().get(AwsIamSpanDecorator.IAM_OPERATION));
+ assertEquals(groupName,
span.tags().get(AwsIamSpanDecorator.IAM_GROUP_NAME));
+ assertEquals(roleName,
span.tags().get(AwsIamSpanDecorator.IAM_ROLE_NAME));
+ assertEquals(policyName,
span.tags().get(AwsIamSpanDecorator.IAM_POLICY_NAME));
+ }
+
+}
diff --git
a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsParameterStoreSpanDecoratorTest.java
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsParameterStoreSpanDecoratorTest.java
new file mode 100644
index 000000000000..01fc5add3e9b
--- /dev/null
+++
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsParameterStoreSpanDecoratorTest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.telemetry.mock.MockSpanAdapter;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AwsParameterStoreSpanDecoratorTest {
+
+ @Test
+ public void testPre() {
+ String operation = "getParameter";
+ String parameterName = "/app/db/password";
+ String parameterPath = "/app/db/";
+
+ Endpoint endpoint = Mockito.mock(Endpoint.class);
+ Exchange exchange = Mockito.mock(Exchange.class);
+ Message message = Mockito.mock(Message.class);
+
+
Mockito.when(endpoint.getEndpointUri()).thenReturn("aws-parameter-store:default");
+ Mockito.when(exchange.getIn()).thenReturn(message);
+ Mockito.when(exchange.getExchangeId()).thenReturn("exchange-1");
+
Mockito.when(message.getHeader(AwsParameterStoreSpanDecorator.OPERATION,
String.class)).thenReturn(operation);
+
Mockito.when(message.getHeader(AwsParameterStoreSpanDecorator.PARAMETER_NAME,
String.class))
+ .thenReturn(parameterName);
+
Mockito.when(message.getHeader(AwsParameterStoreSpanDecorator.PARAMETER_PATH,
String.class))
+ .thenReturn(parameterPath);
+
+ AbstractSpanDecorator decorator = new AwsParameterStoreSpanDecorator();
+
+ MockSpanAdapter span = new MockSpanAdapter();
+
+ decorator.beforeTracingEvent(span, exchange, endpoint);
+
+ assertEquals(operation,
span.tags().get(AwsParameterStoreSpanDecorator.PARAMETER_STORE_OPERATION));
+ assertEquals(parameterName,
span.tags().get(AwsParameterStoreSpanDecorator.PARAMETER_STORE_NAME));
+ assertEquals(parameterPath,
span.tags().get(AwsParameterStoreSpanDecorator.PARAMETER_STORE_PATH));
+ }
+
+}
diff --git
a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsSecretsManagerSpanDecoratorTest.java
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsSecretsManagerSpanDecoratorTest.java
new file mode 100644
index 000000000000..2a1868c03cdc
--- /dev/null
+++
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsSecretsManagerSpanDecoratorTest.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.telemetry.mock.MockSpanAdapter;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AwsSecretsManagerSpanDecoratorTest {
+
+ @Test
+ public void testPre() {
+ String operation = "getSecret";
+ String secretId =
"arn:aws:secretsmanager:us-east-1:123456789012:secret:MySecret-AbCdEf";
+ String secretName = "MySecret";
+
+ Endpoint endpoint = Mockito.mock(Endpoint.class);
+ Exchange exchange = Mockito.mock(Exchange.class);
+ Message message = Mockito.mock(Message.class);
+
+
Mockito.when(endpoint.getEndpointUri()).thenReturn("aws-secrets-manager:default");
+ Mockito.when(exchange.getIn()).thenReturn(message);
+ Mockito.when(exchange.getExchangeId()).thenReturn("exchange-1");
+
Mockito.when(message.getHeader(AwsSecretsManagerSpanDecorator.OPERATION,
String.class)).thenReturn(operation);
+
Mockito.when(message.getHeader(AwsSecretsManagerSpanDecorator.SECRET_ID,
String.class)).thenReturn(secretId);
+
Mockito.when(message.getHeader(AwsSecretsManagerSpanDecorator.SECRET_NAME,
String.class)).thenReturn(secretName);
+
+ AbstractSpanDecorator decorator = new AwsSecretsManagerSpanDecorator();
+
+ MockSpanAdapter span = new MockSpanAdapter();
+
+ decorator.beforeTracingEvent(span, exchange, endpoint);
+
+ assertEquals(operation,
span.tags().get(AwsSecretsManagerSpanDecorator.SECRETS_MANAGER_OPERATION));
+ assertEquals(secretId,
span.tags().get(AwsSecretsManagerSpanDecorator.SECRETS_MANAGER_SECRET_ID));
+ assertEquals(secretName,
span.tags().get(AwsSecretsManagerSpanDecorator.SECRETS_MANAGER_SECRET_NAME));
+ }
+
+}
diff --git
a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsSecurityHubSpanDecoratorTest.java
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsSecurityHubSpanDecoratorTest.java
new file mode 100644
index 000000000000..2c0aa820f5a6
--- /dev/null
+++
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsSecurityHubSpanDecoratorTest.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.telemetry.mock.MockSpanAdapter;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AwsSecurityHubSpanDecoratorTest {
+
+ @Test
+ public void testPre() {
+ String operation = "getFindingHistory";
+ String findingId = "finding-1234";
+ String productArn =
"arn:aws:securityhub:us-east-1::product/aws/securityhub";
+
+ Endpoint endpoint = Mockito.mock(Endpoint.class);
+ Exchange exchange = Mockito.mock(Exchange.class);
+ Message message = Mockito.mock(Message.class);
+
+
Mockito.when(endpoint.getEndpointUri()).thenReturn("aws-security-hub:default");
+ Mockito.when(exchange.getIn()).thenReturn(message);
+ Mockito.when(exchange.getExchangeId()).thenReturn("exchange-1");
+ Mockito.when(message.getHeader(AwsSecurityHubSpanDecorator.OPERATION,
String.class)).thenReturn(operation);
+ Mockito.when(message.getHeader(AwsSecurityHubSpanDecorator.FINDING_ID,
String.class)).thenReturn(findingId);
+
Mockito.when(message.getHeader(AwsSecurityHubSpanDecorator.PRODUCT_ARN,
String.class)).thenReturn(productArn);
+
+ AbstractSpanDecorator decorator = new AwsSecurityHubSpanDecorator();
+
+ MockSpanAdapter span = new MockSpanAdapter();
+
+ decorator.beforeTracingEvent(span, exchange, endpoint);
+
+ assertEquals(operation,
span.tags().get(AwsSecurityHubSpanDecorator.SECURITY_HUB_OPERATION));
+ assertEquals(findingId,
span.tags().get(AwsSecurityHubSpanDecorator.SECURITY_HUB_FINDING_ID));
+ assertEquals(productArn,
span.tags().get(AwsSecurityHubSpanDecorator.SECURITY_HUB_PRODUCT_ARN));
+ }
+
+}
diff --git
a/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsStsSpanDecoratorTest.java
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsStsSpanDecoratorTest.java
new file mode 100644
index 000000000000..25c39c4440b5
--- /dev/null
+++
b/components/camel-telemetry/src/test/java/org/apache/camel/telemetry/decorators/AwsStsSpanDecoratorTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.telemetry.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.telemetry.mock.MockSpanAdapter;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AwsStsSpanDecoratorTest {
+
+ @Test
+ public void testPre() {
+ String operation = "assumeRole";
+ String roleArn = "arn:aws:iam::123456789012:role/MyRole";
+ String roleSessionName = "my-session";
+ String federatedName = "[email protected]";
+
+ Endpoint endpoint = Mockito.mock(Endpoint.class);
+ Exchange exchange = Mockito.mock(Exchange.class);
+ Message message = Mockito.mock(Message.class);
+
+ Mockito.when(endpoint.getEndpointUri()).thenReturn("aws2-sts:default");
+ Mockito.when(exchange.getIn()).thenReturn(message);
+ Mockito.when(exchange.getExchangeId()).thenReturn("exchange-1");
+ Mockito.when(message.getHeader(AwsStsSpanDecorator.OPERATION,
String.class)).thenReturn(operation);
+ Mockito.when(message.getHeader(AwsStsSpanDecorator.ROLE_ARN,
String.class)).thenReturn(roleArn);
+ Mockito.when(message.getHeader(AwsStsSpanDecorator.ROLE_SESSION_NAME,
String.class)).thenReturn(roleSessionName);
+ Mockito.when(message.getHeader(AwsStsSpanDecorator.FEDERATED_NAME,
String.class)).thenReturn(federatedName);
+
+ AbstractSpanDecorator decorator = new AwsStsSpanDecorator();
+
+ MockSpanAdapter span = new MockSpanAdapter();
+
+ decorator.beforeTracingEvent(span, exchange, endpoint);
+
+ assertEquals(operation,
span.tags().get(AwsStsSpanDecorator.STS_OPERATION));
+ assertEquals(roleArn,
span.tags().get(AwsStsSpanDecorator.STS_ROLE_ARN));
+ assertEquals(roleSessionName,
span.tags().get(AwsStsSpanDecorator.STS_ROLE_SESSION_NAME));
+ assertEquals(federatedName,
span.tags().get(AwsStsSpanDecorator.STS_FEDERATED_NAME));
+ }
+
+}