chore: added plugin tags (#39955)
## Description Added plugin tags to distinguish between spans shared by different plugin implementation. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Datasource,@tag.Sanity" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14107363666> > Commit: bddf47f89cc0abac19244db557fcf24fc63d1f9d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14107363666&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource,@tag.Sanity` > Spec: > <hr>Thu, 27 Mar 2025 14:03:11 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced observability across multiple integrations: Various connectors have been updated to include additional contextual identifiers during execution. This improvement enhances the monitoring of API calls and data operations, potentially accelerating issue detection and resolution while maintaining seamless performance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
7f3a66de2b
commit
2b2d786854
|
|
@ -77,8 +77,10 @@ public class RestAPIActivateUtils {
|
|||
ActionExecutionResult errorResult,
|
||||
RequestCaptureFilter requestCaptureFilter,
|
||||
DatasourceConfiguration datasourceConfiguration,
|
||||
String className,
|
||||
ObservationRegistry observationRegistry) {
|
||||
return httpCall(client, httpMethod, uri, requestBody, 0)
|
||||
.tag("plugin", className)
|
||||
.name(ACTUAL_API_CALL)
|
||||
.tap(Micrometer.observation(observationRegistry))
|
||||
.flatMap(clientResponse -> clientResponse.toEntity(byte[].class))
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ public class GoogleSheetsPlugin extends BasePlugin {
|
|||
prepareConfigurationsForExecution(executeActionDTO, actionConfiguration, datasourceConfiguration);
|
||||
|
||||
return this.executeCommon(connection, datasourceConfiguration, actionConfiguration, featureFlagMap)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(PLUGIN_EXECUTE_COMMON)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
@ -222,6 +223,7 @@ public class GoogleSheetsPlugin extends BasePlugin {
|
|||
+ oauth2.getAuthenticationResponse()
|
||||
.getToken()))
|
||||
.exchange()
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(ACTUAL_API_CALL)
|
||||
.tap(Micrometer.observation(observationRegistry))
|
||||
.flatMap(clientResponse -> clientResponse.toEntity(byte[].class))
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@ public class GraphQLPlugin extends BasePlugin {
|
|||
errorResult,
|
||||
requestCaptureFilter,
|
||||
datasourceConfiguration,
|
||||
this.getClass().getName(),
|
||||
ObservationRegistry.NOOP)
|
||||
.onErrorResume(error -> {
|
||||
boolean isBodySentWithApiRequest = requestBodyObj == null ? false : true;
|
||||
|
|
|
|||
|
|
@ -297,6 +297,7 @@ public class MongoPlugin extends BasePlugin {
|
|||
actionConfiguration.setFormData(formData);
|
||||
|
||||
return this.executeCommon(mongoClient, datasourceConfiguration, actionConfiguration, parameters)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(PLUGIN_EXECUTE_COMMON)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ public class MssqlPlugin extends BasePlugin {
|
|||
String updatedQuery = MustacheHelper.replaceMustacheWithQuestionMark(query, mustacheKeysInOrder);
|
||||
actionConfiguration.setBody(updatedQuery);
|
||||
return executeCommon(hikariDSConnection, actionConfiguration, TRUE, mustacheKeysInOrder, executeActionDTO)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(ActionSpanCE.PLUGIN_EXECUTE_COMMON)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ public class MySqlPlugin extends BasePlugin {
|
|||
if (FALSE.equals(isPreparedStatement)) {
|
||||
prepareConfigurationsForExecution(executeActionDTO, actionConfiguration, datasourceConfiguration);
|
||||
return executeCommon(connectionContext, actionConfiguration, FALSE, null, null, requestData)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(PLUGIN_EXECUTE_COMMON)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
@ -258,6 +259,7 @@ public class MySqlPlugin extends BasePlugin {
|
|||
mustacheKeysInOrder,
|
||||
executeActionDTO,
|
||||
requestData)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(PLUGIN_EXECUTE_COMMON)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
@ -364,6 +366,9 @@ public class MySqlPlugin extends BasePlugin {
|
|||
executeActionDTO,
|
||||
requestData,
|
||||
psParams)
|
||||
.tag(
|
||||
"plugin",
|
||||
this.getClass().getName())
|
||||
.name(CREATE_AND_EXECUTE_QUERY_FROM_CONNECTION)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,6 +301,7 @@ public class PostgresPlugin extends BasePlugin {
|
|||
mustacheKeysInOrder,
|
||||
executeActionDTO,
|
||||
explicitCastDataTypes)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(PLUGIN_EXECUTE_COMMON)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ public class RestApiPlugin extends BasePlugin {
|
|||
headerUtils.setHeaderFromAutoGeneratedHeaders(actionConfiguration);
|
||||
|
||||
return this.executeCommon(connection, datasourceConfiguration, actionConfiguration, parameters)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(PLUGIN_EXECUTE_COMMON)
|
||||
.tap(Micrometer.observation(observationRegistry));
|
||||
}
|
||||
|
|
@ -215,7 +216,9 @@ public class RestApiPlugin extends BasePlugin {
|
|||
errorResult,
|
||||
requestCaptureFilter,
|
||||
datasourceConfiguration,
|
||||
this.getClass().getName(),
|
||||
observationRegistry)
|
||||
.tag("plugin", this.getClass().getName())
|
||||
.name(TRIGGER_API_CALL)
|
||||
.tap(Micrometer.observation(observationRegistry))
|
||||
.onErrorResume(error -> {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@ import io.micrometer.core.instrument.config.MeterFilter;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.appsmith.external.constants.spans.ce.ActionSpanCE.ACTION_EXECUTION_DATASOURCE_CONTEXT;
|
||||
import static com.appsmith.external.constants.spans.ce.ActionSpanCE.ACTION_EXECUTION_PLUGIN_EXECUTION;
|
||||
import static com.appsmith.external.constants.spans.ce.ActionSpanCE.ACTION_EXECUTION_SERVER_EXECUTION;
|
||||
import static com.appsmith.external.constants.spans.ce.ActionSpanCE.*;
|
||||
import static com.appsmith.external.git.constants.ce.GitSpanCE.FS_FETCH_REMOTE;
|
||||
import static com.appsmith.external.git.constants.ce.GitSpanCE.FS_RESET;
|
||||
import static com.appsmith.external.git.constants.ce.GitSpanCE.FS_STATUS;
|
||||
|
|
@ -19,16 +17,18 @@ import static com.appsmith.external.git.constants.ce.GitSpanCE.JGIT_RESET_HARD;
|
|||
import static com.appsmith.external.git.constants.ce.GitSpanCE.JGIT_STATUS;
|
||||
|
||||
public class NoTagsMeterFilter implements MeterFilter {
|
||||
private static final Map<String, List<String>> seriesExceptionMap = Map.of(
|
||||
ACTION_EXECUTION_PLUGIN_EXECUTION, List.of("plugin"),
|
||||
ACTION_EXECUTION_SERVER_EXECUTION, List.of("plugin"),
|
||||
ACTION_EXECUTION_DATASOURCE_CONTEXT, List.of("plugin"),
|
||||
FS_STATUS, List.of(),
|
||||
JGIT_STATUS, List.of(),
|
||||
FS_RESET, List.of(),
|
||||
JGIT_RESET_HARD, List.of(),
|
||||
FS_FETCH_REMOTE, List.of(),
|
||||
JGIT_FETCH_REMOTE, List.of());
|
||||
Map<String, List<String>> seriesExceptionMap = Map.ofEntries(
|
||||
Map.entry(ACTION_EXECUTION_PLUGIN_EXECUTION, List.of("plugin")),
|
||||
Map.entry(ACTION_EXECUTION_SERVER_EXECUTION, List.of("plugin")),
|
||||
Map.entry(ACTION_EXECUTION_DATASOURCE_CONTEXT, List.of("plugin")),
|
||||
Map.entry(PLUGIN_EXECUTE_COMMON, List.of("plugin")),
|
||||
Map.entry(ACTUAL_API_CALL, List.of("plugin")),
|
||||
Map.entry(FS_STATUS, List.of()),
|
||||
Map.entry(JGIT_STATUS, List.of()),
|
||||
Map.entry(FS_RESET, List.of()),
|
||||
Map.entry(JGIT_RESET_HARD, List.of()),
|
||||
Map.entry(FS_FETCH_REMOTE, List.of()),
|
||||
Map.entry(JGIT_FETCH_REMOTE, List.of()));
|
||||
|
||||
@Override
|
||||
public Meter.Id map(Meter.Id id) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user