Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neptune Analytics Support & Logger #3

Closed
wants to merge 45 commits into from

Conversation

andreachild
Copy link

No description provided.

Cole-Greer and others added 22 commits March 28, 2024 10:09
Replaces the queries to fetch edge directions while building the schema.
The old queries worked by testing for the existance of any possible edge,
which resulted in a large number of queries for graphs with lots of node and
edge labels.

The new query instead iterates through all the edge labels, and runs a query
to fetch the corresponding from-label to-label pairs.
Replaces the queries to fetch edge directions while building the schema.
The old queries worked by testing for the existance of any possible edge,
which resulted in a large number of queries for graphs with lots of node and
edge labels.

The new query instead iterates through all the edge labels, and runs a query
to fetch the corresponding from-label to-label pairs.
…g of test cases, and changed to analytics endpoint
…ould also be logged to console. Added new loggerError method which logs the message to file and console.error.
@sophiadt sophiadt changed the title Sophiadt/neptune analytics logger Neptune Analytics Support & Logger Sep 24, 2024
@sophiadt
Copy link

sophiadt commented Sep 24, 2024

Changes:

  • corrected the consoleOut.error(msg) statements to console.error(msg)
  • added an if statement to only retrieve the database cluster information if the type is neptune-db
  • fixed todo.schema.graphql that failed to create when utility is used with the todo schema
  • fixed errors in the tests cases ex. missing commas and incorrect test case ordering
  • changed logger to accept flag if text should be logged to console
  • added new loggerError method that logs message to file and console.error
  • made message to logger more concise
  • changed flag to check if endpoint has 2 parts when split with :
    • ex. <your-airroutes-db-host>:<your-airroutes-db-port>
  • removed default region and changed parsing of region from URL to differentiate between analytics and databases
  • removed code for dual lamba option and read-only endpoints
  • added parameterized queries for databases and analytics
    • discovered using type, label, and WHERE is not memory efficient
    • used query sanitization instead by passing parameters through the sanitize function made
  • merged Update getEdgesDirections queries aws/amazon-neptune-for-graphql#16 to fetch edge directions while building the schema
  • replaced file and console logging with pino logger library for easier maintainability and future customization
  • integrate neptune graph SDK support
  • created graphQL utility tarball
  • fixed typos in README.md
  • refactored console output to look more like a CL progress UI and added debug level file logs

Note: connecting to a Neptune Analytics graph requires the additional argument: --create-update-aws-pipeline-neptune-IAM

andreachild and others added 6 commits September 26, 2024 15:31
…and use parameterized query for getNodeProperties.
Replaces the queries to fetch edge directions while building the schema.

The old queries worked by testing for the existence of any possible edge, which resulted in a large number of queries for graphs with lots of node and
edge labels.

The new query instead iterates through all the edge labels, and runs a query to fetch the corresponding from-label to-label pairs.
sophiadt and others added 12 commits October 3, 2024 13:19
…sier maintainability and future customization. Changed the quiet option to set the console log level to 'warn' if enabled ('debug' if disabled) instead of checking for the quiet value before each log. File logging is by default at the 'debug' level but could be customized in the future with a user-provided level. Removed some ARNs and other info from logged statements for privacy concerns. (#4)
…gic (#5)

Introduce usage of the neptune graph (analytics) SDK in a couple scenarios: 1. during pipeline creation, if an axios request fails when querying the Neptune Analytics graph and falls back to SDK and 2. if the user has opted to use SDK for the generated lambda (as opposed to http).

Summary of changes:

-added new dependency on client-neptune-graph version 3.662.0
-created new lambda template which is used if the user specifies --output-resolver-query-sdk option
-set additional lambda environment variable for neptune db name which is required to execute queries using the neptune graph SDK
-added logic to fall back to neptune graph SDK if Axios request fails during pipeline creation (previous logic threw Error as the analytics SDK was not yet available)
-fixed function which retrieves graph summary to use neptune graph SDK if the neptune-type is neptune-graph (the summary endpoint path for neptune-db is not the same for neptune-graph)
-fixed CDK pipeline to only fetch cluster info if the type is neptune-db as it is not required for Neptune-graph (analytics)
-set isNeptuneIAMAuth to true if the neptune type is detected as neptune-graph
-introduced util.js for parsing functions that are used across multiple modules
-refactored function which had many params to use an object param instead for better readability
-fixed some typos which specified 'neptume' instead of 'neptune'
-changed queryNeptune function to have default value of empty object for params
-change jest config from json to js to allow for globals to be set from environment variables
-changed test cases to reference <AIR_ROUTES_DB_HOST> and <AIR_ROUTES_DB_PORT values which are swapped at test runtime for the environment variable values for easier test configurability and to prevent future accidental commit of real URLs
-removed duplicated airports.source.schema.graphql file in test cases and changed to reference single file in parent directory
-fixed Case05/case02.json which I believe was accidentally changed from remove to create pipeline
-introduced new test case 7 which sets --output-resolver-query-sdk option
…equired for axios credential interceptor in the http lambda.
Refactored console output and spinners to be more like a command line progress UI and introduced debug level file logs. Setting the verbose-log option to true will log more data to the log file. Since the verbose log data can include graph data values it is intended for the user to have to opt in to this verbose logging. Changed pino standard out logger to console as the pino logger was causing interleaving log messages that were out of order with the spinners. Ensured to not log to console if a spinner is spinning as this can have unintended interleaving of output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants