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 & Logging #23

Closed

Conversation

sophiadt
Copy link
Contributor

@sophiadt sophiadt commented Sep 19, 2024

  • PR to release Neptune Analytics - Logger #19 changes to main

    • This PR is to support connection to Neptune Analytics and additional logging enhancements. Support for Neptune Analytics SDK has not been added yet.

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
  • added in Andrea Child's changes from 42fa1017308a9ca3381b4ddb3ad924c97a71dd0d
    • 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

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

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 force-pushed the sophiadt/Neptune-Analytics---Logger branch from 51a491d to 12691dd Compare September 24, 2024 18:59
andreachild and others added 7 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.
}

function sanitize(text) {
// TODO implement sanitization logic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be coming in a future PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - still need to talk with AWS about the logic.

for (let fromLabel of result.fromLabel) {
for (let toLabel of result.toLabel) {
edgeStructure.directions.push({from:fromLabel, to:toLabel});
consoleOut(' Found edge: ' + yellow(edgeStructure.label) + ' direction: ' + yellow(fromLabel) + ' -> ' + yellow(toLabel));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the expectation that calls to consoleOut should always be paired with calls to loggerLog?

andreachild and others added 16 commits October 4, 2024 12:27
…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.
@andreachild
Copy link
Contributor

@xiazcy
Copy link

xiazcy commented Oct 22, 2024

This PR was broken into several smaller ones:

Sounds good. Thank you @andreachild!

@xiazcy xiazcy closed this Oct 22, 2024
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.

5 participants