Skip to content

Conversation

@Sanjalee-NewRelic
Copy link

@Sanjalee-NewRelic Sanjalee-NewRelic commented Jan 30, 2025

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.

Copy link
Member

@alanwest alanwest left a 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) => {
Copy link
Member

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.

Comment on lines +26 to +35
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) {
Copy link
Member

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
Copy link
Member

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?

Comment on lines +1 to +3
<!DOCTYPE html>
<html lang="en">
<head>
Copy link
Member

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.

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.

2 participants