-
Notifications
You must be signed in to change notification settings - Fork 76
chore: Add example application for connecting to memcached #718
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
base: main
Are you sure you want to change the base?
chore: Add example application for connecting to memcached #718
Conversation
alanwest
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot here that seems to have nothing to do with demonstrating relationships with memcached. This example can be trimmed down significantly.
This PR should also describe what, if anything, would need to do be done to ensure memcached itself is instrumented.
| description: "Measures the number of times the fibonacci method is invoked.", | ||
| }); | ||
|
|
||
| const fibonacci = (n, parentSpan) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using the fibonacci example? If the purpose is to demonstrate relationships between memcached and OpenTelemetry services, I see nothing in here that interacts with memcached. All this extra code makes it very difficult for a customer to understand the bare essentials of what you're trying to demonstrate.
| client.set('key', 'value', 10000, function(err) { | ||
| console.log('inside the cb') | ||
| if (err) { | ||
| console.error('Error setting value:', err); | ||
| return; | ||
| } | ||
| console.log('Value set successfully'); | ||
| }); | ||
|
|
||
| client.get('key', function(err, data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code at application start appears to be the only interactions between memcached and this application. The vast majority of the rest of the code is superfluous.
|
|
||
| const Memcached = require('memcached'); | ||
|
|
||
| const MEMCACHED_CONFIGURATION_ENDPOINT = 'test-memcached.abc123.cfg.use1.cache.amazonaws.com:11211'; // Replace with your Memcached configuration endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this specific to AWS? Do we only support relationships to memcached if it is hosted in AWS?
Is there anything a customer needs to do to configure their memcached instance so that it is instrumented? If so, where are the instructions for this?
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to demonstrate a relationship to memcached without a UI. The code for the UI bloats this example and makes it difficult to hone in on what you're attempting to demonstrate.
This node js application to demonstrate how to connect to an AWS Memcached cluster and use auto instrumentation for Memcached to genarate the span data related to that Memcached Cluster.