Add IO Event tracking to graylog.
This commit is contained in:
@@ -6,9 +6,10 @@ import { WebSocketLink } from "@apollo/client/link/ws";
|
||||
import { getMainDefinition } from "@apollo/client/utilities";
|
||||
//import { split } from "apollo-link";
|
||||
import apolloLogger from "apollo-link-logger";
|
||||
import axios from "axios";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
import errorLink from "../graphql/apollo-error-handling";
|
||||
|
||||
import { store } from "../redux/store";
|
||||
const httpLink = new HttpLink({
|
||||
uri: process.env.REACT_APP_GRAPHQL_ENDPOINT,
|
||||
});
|
||||
@@ -47,7 +48,19 @@ const roundTripLink = new ApolloLink((operation, forward) => {
|
||||
});
|
||||
|
||||
const TrackExecutionTime = async (operationName, time) => {
|
||||
//await axios.post("/ioevent", { operationName, time, dbevent: true });
|
||||
const rdxStore = store.getState();
|
||||
try {
|
||||
console.log("trying");
|
||||
axios.post("/ioevent", {
|
||||
operationName,
|
||||
time,
|
||||
dbevent: true,
|
||||
user: rdxStore.user.currentUser.email,
|
||||
imexshopid: rdxStore.user.bodyshop.imexshopid,
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("IOEvent Error", error);
|
||||
}
|
||||
};
|
||||
|
||||
const subscriptionMiddleware = {
|
||||
|
||||
Reference in New Issue
Block a user