Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/
export interface RedisPluginClientTypes {
options?: {
host: string;
port: string;
connection_options?: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

options and connection_options are both ancient - this commit in 2.5.0-1is what renamed connection_option to connection_options

Since the instrumentation targets ^2.6.0 this feels ok. If earlier is desired, we can fall back on connection_option

port?: string;
host?: string;
};

address?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ export const getTracedInternalSendCommand = (
);

// Set attributes for not explicitly typed RedisPluginClientTypes
if (this.options) {
if (this.connection_options) {
span.setAttributes({
[SEMATTRS_NET_PEER_NAME]: this.options.host,
[SEMATTRS_NET_PEER_PORT]: this.options.port,
[SEMATTRS_NET_PEER_NAME]: this.connection_options.host,
[SEMATTRS_NET_PEER_PORT]: this.connection_options.port,
});
}
if (this.address) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const memoryExporter = new InMemorySpanExporter();

const CONFIG = {
host: process.env.OPENTELEMETRY_REDIS_HOST || 'localhost',
port: process.env.OPENTELEMETRY_REDIS_PORT || '63790',
port: Number(process.env.OPENTELEMETRY_REDIS_PORT || 63790),
};

const URL = `redis://${CONFIG.host}:${CONFIG.port}`;
Expand Down