!0xRafael πŸ”¨πŸ‘·
!0xRafael πŸ”¨πŸ‘·
RRailway
Created by !0xRafael πŸ”¨πŸ‘· on 7/12/2024 in #βœ‹ο½œhelp
Visualize Failing Third Party APIs with Railway's "Observability"
Our service relies on many third party apis, and it is hard for us to keep track of how often the apis get called, how often they succeed and fail - if they fail then with what status code. I am wondering if Railway's "Observability" can be used to visualize such data, or if someone knows an easy way to visualize something like this. I would greatly appreciate help, thanks a lot!
9 replies
RRailway
Created by !0xRafael πŸ”¨πŸ‘· on 2/27/2024 in #βœ‹ο½œhelp
Problems using Railway's Redis Private Networking (Solved)
I have the following NestJs service:
import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
import { Redis } from 'ioredis';
import { EnvService } from 'src/env/env.service';

@Injectable()
export class RedisService extends Redis implements OnModuleInit {
private readonly logger = new Logger(RedisService.name);
public readonly redisUrl = this.envService.get('REDIS_URL');
public readonly redisProtocol = this.envService.get('REDIS_PROTOCOL');

constructor(private readonly envService: EnvService) {
const redisUrl = envService.get('REDIS_URL');
const redisProtocol = envService.get('REDIS_PROTOCOL');

super(redisUrl, {
family: redisProtocol,
maxRetriesPerRequest: null,
connectTimeout: 30000, // 30 seconds
});

this.redisUrl = redisUrl;
this.redisProtocol = redisProtocol;

this.logger.log('creating redis client', redisUrl, redisProtocol);
}

async onModuleInit(): Promise<void> {
await new Promise<void>((resolve, reject) => {
this.logger.log('connecting to redis...');

this.on('connect', () => {
this.logger.log('connected to redis');
resolve();
});

this.on('error', (error) => {
this.logger.error('Error connecting to Redis:', error);
reject(error);
});
});
}
}
import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
import { Redis } from 'ioredis';
import { EnvService } from 'src/env/env.service';

@Injectable()
export class RedisService extends Redis implements OnModuleInit {
private readonly logger = new Logger(RedisService.name);
public readonly redisUrl = this.envService.get('REDIS_URL');
public readonly redisProtocol = this.envService.get('REDIS_PROTOCOL');

constructor(private readonly envService: EnvService) {
const redisUrl = envService.get('REDIS_URL');
const redisProtocol = envService.get('REDIS_PROTOCOL');

super(redisUrl, {
family: redisProtocol,
maxRetriesPerRequest: null,
connectTimeout: 30000, // 30 seconds
});

this.redisUrl = redisUrl;
this.redisProtocol = redisProtocol;

this.logger.log('creating redis client', redisUrl, redisProtocol);
}

async onModuleInit(): Promise<void> {
await new Promise<void>((resolve, reject) => {
this.logger.log('connecting to redis...');

this.on('connect', () => {
this.logger.log('connected to redis');
resolve();
});

this.on('error', (error) => {
this.logger.error('Error connecting to Redis:', error);
reject(error);
});
});
}
}
In the Deploy Logs it prints the following values: [Nest] 25 - 02/27/2024, 2:52:04 PM LOG [RedisService] creating redis client [Nest] 25 - 02/27/2024, 2:52:04 PM LOG [RedisService] redis://default:[email protected]:6379 [Nest] 25 - 02/27/2024, 2:52:04 PM LOG [RedisService] 6 [Nest] 25 - 02/27/2024, 2:52:09 PM ERROR [RedisService] Error connecting to Redis: [Nest] 25 - 02/27/2024, 2:52:09 PM ERROR [RedisService] Error: getaddrinfo ENOTFOUND redis-eblx.railway.internal Any idea on what I am doing wrong?
35 replies
RRailway
Created by !0xRafael πŸ”¨πŸ‘· on 10/27/2023 in #βœ‹ο½œhelp
Help Required to understand how to make my setup work with Railway
Hey! I'm currently working on a setup involving multiple instances of Anvil, a CLI for running forked blockchains (more details at https://book.getfoundry.sh/anvil/), each running on a distinct port. These instances are initiated through a Dockerfile. Here's an outline of my setup and the challenge I'm facing: Setup: Primary Service: This contains a Dockerfile that initiates several Anvil instances. Each instance operates on a unique port (e.g., 8545, 8546, etc.). Secondary Service: This service needs to interact with each Anvil instance through different URLs, such as: http://someurl:8545 http://someurl:8546 and so forth... Challenge: I am struggling to understand how to effectively connect these services, particularly utilizing Railway's private networking capabilities or other potential solutions. My goal is to enable the secondary service to seamlessly communicate with each Anvil instance hosted by the primary service. Could you provide guidance or suggestions on how to configure this setup correctly? Any help or insights into this matter would be greatly appreciated. Thank you for your time and assistance!
71 replies