Skip to content

Commit

Permalink
chore: removed unwanted metrics (#37052)
Browse files Browse the repository at this point in the history
## Description
> This PR removes the extra metrics that were added which clouded up the
newrelic.
Old PR #37010 is to be
closed because extra indentation was added due to the IDE configuration.

Fixes #37051 

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/11493693400>
> Commit: 51ecb28
> Workflow: `PR Automation test suite`
> Tags: `@tag.Sanity`
> Spec: ``
> <hr>Thu, 24 Oct 2024 06:16:14 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
  • Loading branch information
NilanshBansal authored Oct 24, 2024
1 parent 5d571b9 commit 88b987f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ public class OnLoadSpanCE {
public static final String EXECUTABLE_IN_CREATOR_CONTEXT = APPSMITH_SPAN_PREFIX + "executablesInCreatorContext";
public static final String ADD_DIRECTLY_REFERENCED_EXECUTABLES_TO_GRAPH =
APPSMITH_SPAN_PREFIX + "addDirectlyReferencedExecutablesToGraph";
public static final String GET_POSSIBLE_ENTITY_REFERENCES = APPSMITH_SPAN_PREFIX + "getPossibleEntityReferences";
public static final String UPDATE_EXECUTABLE_SELF_REFERENCING_PATHS =
APPSMITH_SPAN_PREFIX + "updateExecutableSelfReferencingPaths";
public static final String GET_POSSIBLE_ENTITY_PARENTS_MAP = APPSMITH_SPAN_PREFIX + "getPossibleEntityParentsMap";
public static final String ADD_EXPLICIT_USER_SET_ON_LOAD_EXECUTABLES_TO_GRAPH =
APPSMITH_SPAN_PREFIX + "addExplicitUserSetOnLoadExecutablesToGraph";
public static final String GET_UNPUBLISHED_ON_LOAD_EXECUTABLES_EXPLICIT_SET_BY_USER_IN_CREATOR_CONTEXT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
import static com.appsmith.external.constants.spans.OnLoadSpan.ADD_EXPLICIT_USER_SET_ON_LOAD_EXECUTABLES_TO_GRAPH;
import static com.appsmith.external.constants.spans.OnLoadSpan.EXECUTABLE_NAME_TO_EXECUTABLE_MAP;
import static com.appsmith.external.constants.spans.OnLoadSpan.GET_ALL_EXECUTABLES_BY_CREATOR_ID;
import static com.appsmith.external.constants.spans.OnLoadSpan.GET_POSSIBLE_ENTITY_PARENTS_MAP;
import static com.appsmith.external.constants.spans.OnLoadSpan.GET_POSSIBLE_ENTITY_REFERENCES;
import static com.appsmith.external.constants.spans.OnLoadSpan.GET_UNPUBLISHED_ON_LOAD_EXECUTABLES_EXPLICIT_SET_BY_USER_IN_CREATOR_CONTEXT;
import static com.appsmith.external.constants.spans.OnLoadSpan.UPDATE_EXECUTABLE_SELF_REFERENCING_PATHS;
import static com.appsmith.external.helpers.MustacheHelper.EXECUTABLE_ENTITY_REFERENCES;
Expand Down Expand Up @@ -505,9 +503,7 @@ private Mono<List<Set<DslExecutableDTO>>> filterAndTransformSchedulingOrderToDTO
*/
private Mono<Set<EntityDependencyNode>> getPossibleEntityReferences(
Mono<Map<String, Executable>> executableNameToExecutableMapMono, Set<String> bindings, int evalVersion) {
return getPossibleEntityReferences(executableNameToExecutableMapMono, bindings, evalVersion, null)
.name(GET_POSSIBLE_ENTITY_REFERENCES)
.tap(Micrometer.observation(observationRegistry));
return getPossibleEntityReferences(executableNameToExecutableMapMono, bindings, evalVersion, null);
}

/**
Expand All @@ -530,9 +526,7 @@ private Mono<Set<EntityDependencyNode>> getPossibleEntityReferences(
final int entityTypes = EXECUTABLE_ENTITY_REFERENCES | WIDGET_ENTITY_REFERENCES;

return executableNameToExecutableMono
.zipWith(getPossibleEntityParentsMap(bindings, entityTypes, evalVersion)
.name(GET_POSSIBLE_ENTITY_PARENTS_MAP)
.tap(Micrometer.observation(observationRegistry)))
.zipWith(getPossibleEntityParentsMap(bindings, entityTypes, evalVersion))
.map(tuple -> {
Map<String, Executable> executableMap = tuple.getT1();
// For each binding, here we receive a set of possible references to global entities
Expand Down Expand Up @@ -647,8 +641,6 @@ private Mono<Set<ExecutableDependencyEdge>> addDirectlyReferencedExecutablesToGr
bindingsInWidget,
evalVersion,
executableBindingsInDslRef)
.name(GET_POSSIBLE_ENTITY_REFERENCES)
.tap(Micrometer.observation(observationRegistry))
.flatMapMany(Flux::fromIterable)
// Add dependencies of the executables found in the DSL in the graph
// We are ignoring the widget references at this point
Expand Down Expand Up @@ -939,8 +931,6 @@ private Mono<Set<ExecutableDependencyEdge>> recursivelyAddExecutablesAndTheirDep
// First fetch all the executables in the page whose name matches the words found in all the dynamic bindings
Mono<List<EntityDependencyNode>> findAndAddExecutablesInBindingsMono = getPossibleEntityReferences(
executableNameToExecutableMapMono, dynamicBindings, evalVersion)
.name(GET_POSSIBLE_ENTITY_REFERENCES)
.tap(Micrometer.observation(observationRegistry))
.flatMapMany(Flux::fromIterable)
// Add dependencies of the executables found in the DSL in the graph.
.flatMap(possibleEntity -> {
Expand Down Expand Up @@ -1115,8 +1105,6 @@ private Mono<Void> extractAndSetExecutableBindingsInGraphEdges(
executableBindingsMap.get(bindingPath),
evalVersion,
bindingsInDsl)
.name(GET_POSSIBLE_ENTITY_REFERENCES)
.tap(Micrometer.observation(observationRegistry))
.flatMapMany(Flux::fromIterable)
.map(relatedDependencyNode -> {
bindingsFromExecutables.add(relatedDependencyNode.getReferenceString());
Expand Down Expand Up @@ -1147,8 +1135,6 @@ private Mono<Set<ExecutableDependencyEdge>> addWidgetRelationshipToGraph(
return Flux.fromIterable(widgetBindingMap.entrySet())
.flatMap(widgetBindingEntries -> getPossibleEntityParentsMap(
widgetBindingEntries.getValue(), entityTypes, evalVersion)
.name(GET_POSSIBLE_ENTITY_PARENTS_MAP)
.tap(Micrometer.observation(observationRegistry))
.map(possibleParentsMap -> {
possibleParentsMap.entrySet().stream().forEach(entry -> {
if (entry.getValue() == null || entry.getValue().isEmpty()) {
Expand Down

0 comments on commit 88b987f

Please sign in to comment.