Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* 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 GoogleFunctionsSpanDecorator extends AbstractSpanDecorator {

static final String FUNCTIONS_OPERATION = "operation";
static final String FUNCTIONS_ENTRY_POINT = "entryPoint";
static final String FUNCTIONS_RUNTIME = "runtime";

/**
* Constants copied from {@link org.apache.camel.component.google.functions.GoogleCloudFunctionsConstants}
*/
static final String OPERATION = "CamelGoogleCloudFunctionsOperation";
static final String ENTRY_POINT = "CamelGoogleCloudFunctionsEntryPoint";
static final String RUNTIME = "CamelGoogleCloudFunctionsRuntime";

@Override
public String getComponent() {
return "google-functions";
}

@Override
public String getComponentClassName() {
return "org.apache.camel.component.google.functions.GoogleCloudFunctionsComponent";
}

@Override
public void beforeTracingEvent(Span span, Exchange exchange, Endpoint endpoint) {
super.beforeTracingEvent(span, exchange, endpoint);

Object operation = exchange.getIn().getHeader(OPERATION);
if (operation != null) {
span.setTag(FUNCTIONS_OPERATION, operation.toString());
}

String entryPoint = exchange.getIn().getHeader(ENTRY_POINT, String.class);
if (entryPoint != null) {
span.setTag(FUNCTIONS_ENTRY_POINT, entryPoint);
}

String runtime = exchange.getIn().getHeader(RUNTIME, String.class);
if (runtime != null) {
span.setTag(FUNCTIONS_RUNTIME, runtime);
}
}
}
Original file line number Diff line number Diff line change
@@ -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 GoogleSecretManagerSpanDecorator extends AbstractSpanDecorator {

static final String SECRET_MANAGER_OPERATION = "operation";
static final String SECRET_MANAGER_SECRET_ID = "secretId";
static final String SECRET_MANAGER_VERSION_ID = "versionId";

/**
* Constants copied from {@link org.apache.camel.component.google.secret.manager.GoogleSecretManagerConstants}. Only
* the secret identifier (name) and version are tagged, never the secret value.
*/
static final String OPERATION = "CamelGoogleSecretManagerOperation";
static final String SECRET_ID = "CamelGoogleSecretManagerSecretId";
static final String VERSION_ID = "CamelGoogleSecretManagerVersionId";

@Override
public String getComponent() {
return "google-secret-manager";
}

@Override
public String getComponentClassName() {
return "org.apache.camel.component.google.secret.manager.GoogleSecretManagerComponent";
}

@Override
public void beforeTracingEvent(Span span, Exchange exchange, Endpoint endpoint) {
super.beforeTracingEvent(span, exchange, endpoint);

Object operation = exchange.getIn().getHeader(OPERATION);
if (operation != null) {
span.setTag(SECRET_MANAGER_OPERATION, operation.toString());
}

String secretId = exchange.getIn().getHeader(SECRET_ID, String.class);
if (secretId != null) {
span.setTag(SECRET_MANAGER_SECRET_ID, secretId);
}

String versionId = exchange.getIn().getHeader(VERSION_ID, String.class);
if (versionId != null) {
span.setTag(SECRET_MANAGER_VERSION_ID, versionId);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 GoogleSpeechToTextSpanDecorator extends AbstractSpanDecorator {

static final String SPEECH_TO_TEXT_OPERATION = "operation";

/**
* Constants copied from {@link org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConstants}.
* Only the operation is tagged; the response object may carry large audio/image payloads and is not emitted.
*/
static final String OPERATION = "CamelGoogleCloudSpeechToTextOperation";

@Override
public String getComponent() {
return "google-speech-to-text";
}

@Override
public String getComponentClassName() {
return "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextComponent";
}

@Override
public void beforeTracingEvent(Span span, Exchange exchange, Endpoint endpoint) {
super.beforeTracingEvent(span, exchange, endpoint);

Object operation = exchange.getIn().getHeader(OPERATION);
if (operation != null) {
span.setTag(SPEECH_TO_TEXT_OPERATION, operation.toString());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 GoogleTextToSpeechSpanDecorator extends AbstractSpanDecorator {

static final String TEXT_TO_SPEECH_OPERATION = "operation";

/**
* Constants copied from {@link org.apache.camel.component.google.texttospeech.GoogleCloudTextToSpeechConstants}.
* Only the operation is tagged; the response object may carry large audio/image payloads and is not emitted.
*/
static final String OPERATION = "CamelGoogleCloudTextToSpeechOperation";

@Override
public String getComponent() {
return "google-text-to-speech";
}

@Override
public String getComponentClassName() {
return "org.apache.camel.component.google.texttospeech.GoogleCloudTextToSpeechComponent";
}

@Override
public void beforeTracingEvent(Span span, Exchange exchange, Endpoint endpoint) {
super.beforeTracingEvent(span, exchange, endpoint);

Object operation = exchange.getIn().getHeader(OPERATION);
if (operation != null) {
span.setTag(TEXT_TO_SPEECH_OPERATION, operation.toString());
}
}
}
Original file line number Diff line number Diff line change
@@ -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 GoogleVertexAISpanDecorator extends AbstractSpanDecorator {

static final String VERTEXAI_OPERATION = "operation";
static final String VERTEXAI_MODEL_ID = "modelId";
static final String VERTEXAI_LOCATION = "location";

/**
* Constants copied from {@link org.apache.camel.component.google.vertexai.GoogleVertexAIConstants}. The prompt and
* chat messages carry user content and the tuning parameters are not useful as tags, so they are not emitted.
*/
static final String OPERATION = "CamelGoogleVertexAIOperation";
static final String MODEL_ID = "CamelGoogleVertexAIModelId";
static final String LOCATION = "CamelGoogleVertexAILocation";

@Override
public String getComponent() {
return "google-vertexai";
}

@Override
public String getComponentClassName() {
return "org.apache.camel.component.google.vertexai.GoogleVertexAIComponent";
}

@Override
public void beforeTracingEvent(Span span, Exchange exchange, Endpoint endpoint) {
super.beforeTracingEvent(span, exchange, endpoint);

Object operation = exchange.getIn().getHeader(OPERATION);
if (operation != null) {
span.setTag(VERTEXAI_OPERATION, operation.toString());
}

String modelId = exchange.getIn().getHeader(MODEL_ID, String.class);
if (modelId != null) {
span.setTag(VERTEXAI_MODEL_ID, modelId);
}

String location = exchange.getIn().getHeader(LOCATION, String.class);
if (location != null) {
span.setTag(VERTEXAI_LOCATION, location);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 GoogleVisionSpanDecorator extends AbstractSpanDecorator {

static final String VISION_OPERATION = "operation";

/**
* Constants copied from {@link org.apache.camel.component.google.vision.GoogleCloudVisionConstants}. Only the
* operation is tagged; the response object may carry large audio/image payloads and is not emitted.
*/
static final String OPERATION = "CamelGoogleCloudVisionOperation";

@Override
public String getComponent() {
return "google-vision";
}

@Override
public String getComponentClassName() {
return "org.apache.camel.component.google.vision.GoogleCloudVisionComponent";
}

@Override
public void beforeTracingEvent(Span span, Exchange exchange, Endpoint endpoint) {
super.beforeTracingEvent(span, exchange, endpoint);

Object operation = exchange.getIn().getHeader(OPERATION);
if (operation != null) {
span.setTag(VISION_OPERATION, operation.toString());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ org.apache.camel.telemetry.decorators.FtpSpanDecorator
org.apache.camel.telemetry.decorators.FtpsSpanDecorator
org.apache.camel.telemetry.decorators.GoogleBigQuerySpanDecorator
org.apache.camel.telemetry.decorators.GoogleFirestoreSpanDecorator
org.apache.camel.telemetry.decorators.GoogleFunctionsSpanDecorator
org.apache.camel.telemetry.decorators.GooglePubsubSpanDecorator
org.apache.camel.telemetry.decorators.GoogleSecretManagerSpanDecorator
org.apache.camel.telemetry.decorators.GoogleSpeechToTextSpanDecorator
org.apache.camel.telemetry.decorators.GoogleStorageSpanDecorator
org.apache.camel.telemetry.decorators.GoogleTextToSpeechSpanDecorator
org.apache.camel.telemetry.decorators.GoogleVertexAISpanDecorator
org.apache.camel.telemetry.decorators.GoogleVisionSpanDecorator
org.apache.camel.telemetry.decorators.HttpSpanDecorator
org.apache.camel.telemetry.decorators.HttpsSpanDecorator
org.apache.camel.telemetry.decorators.IronmqSpanDecorator
Expand Down
Loading