Server Troubleshooting Guide

Moesif server integrations can usually be installed in 15 minutes or less. If you don’t see your data show up in Moesif after a minute, you can follow the below troubleshooting steps to diagnose common problems. If you contact Moesif support, please follow these steps when contacting Moesif support.

1. Enable Debug Option

If you’re using a Moesif server integration, you should first enable the integrations’s debug option. With the debug option enabled, the integration will log additional diagnostic info to your application’s standard output which can provide you visibility into what might be happening. Please share the log with Moesif Support so we can root cause any issue.

To enable debug, review the integration options for your specific server integration.

For example, to enable debug for moesif-nodejs, you would set the option to true:

var options = {

  applicationId: 'Your Moesif Application Id',
  debug: true, // Enable debug mode
};

// 3. Initialize the middleware object with options
var moesifMiddleware = moesif(options);

2. Send Test API Traffic

Send some test traffic to your API to ensure it’s receiving requests. If the integration is working, your events should show up in metrics reports within a minute. Events may not show in User and Company reports for up to 10 minutes.

3. Verify Moesif Started

All SDKs and most gateway plugins require your server to restart. Try restart your respective server that has Moesif installed. If you have debug mode enabled, you should see Moesif logs. If you don’t see any logs containing the text moesif, it’s possible Moesif is not yet enabled. Check that Moesif is enabled. Also, try running your application locally to see if it’s a deployment issue.

4. Verify Connectivity to Moesif Collector API

If you’re seeing timeouts to Moesif in your logs or events are not showing up, your application may be unable to communicate to Moesif Collector API. Unless you are using Moesif secure proxy, your application must allow outgoing traffic to api.moesif.net

CURL the API Directly

From your container or virtual machine, execute the following curl command curl -XGET -v "https://api.moesif.net/health/probe" to ensure you receive a 200 OK response. If the connection times out, you may have an issue connecting to the Moesif such as due to local firewall settings (See below).

Verify You Server Supports TLS 1.2 or Higher

All Moesif APIs require Transport Layer Security (TLS) 1.2 or higher to increase security posture. TLS 1.0 and 1.1 is disabled as these older versions are considered to be less secure compared to the newer versions. TLS v1.0 dates back to 1999.

You can verify this by running openssl s_client -connect api.moesif.net:443 -tls1_2

If there’s an error or if the connection fails, it may mean that the server does not support TLS 1.2 or higher, or there could be other issues such as network connectivity problems.

Add Moesif to Outgoing Firewalls

Add a rule to your outgoing firewall and network security groups to allow traffic to the domain api.moesif.net. Moesif integrations always communicate using port 443 for SSL.

Create an allow rule for the domain api.moesif.net is strongly recommended as Moesif IP addresses can change. If your firewall only supports allowing by IP address, add the two IPs 75.2.93.6 and 99.83.168.36 to your firewall allow list.

5. Check Presence of Conflicting Middleware

If you’re using a Moesif server SDK and already have other monitoring middleware or exception handlers, it’s possible the two can conflict due to the way both instruments your application. Moesif validates our integrations with the latest version of common APM vendors like DataDog and New Relic. However, if you have a custom middleware or exception handler, Moesif may be conflicting with your custom code.

First, try to find the conflicting middleware by removing each middleware one-by-one and restart your application. Once you identify the conflicting middleware, you can reorder it relative to the Moesif middleware in your request chain.

If the conflicting middleware is a commercial product, let our support team know and the version of the conflicting middleware.

6. Ensure Moesif Middleware is Called Last

If you are using a Moesif SDK, you must ensure Moesif is initialized last in your “middleware stack”. The Moesif middleware should come after any authentication or authorization middleware you have. This ensures the Moesif middleware can read the identified user or identified company correctly. You should also ensure Moesif comes after any body parsers or decompression middleware you have.

7. Ensure Your Moesif Subscription is Active

For security and compliance, Moesif will not collect events if the subscription is cancelled. If you’re on a free tier, Moesif will also stop collecting events once you exceed your free quota until it resets. You can verify this under Subscriptions within the Moesif UI.

9. Ensure Transaction Id is Different

If you are ingesting raw events directly, check if you’re reusing the same transaction ids across different events. Different events should have a different transaction id so Moesif doesn’t deduplicate different events. This should be a 36 character UUID such as 123e4567-e89b-12d3-a456-426614174000

10. Contact Moesif Support

If you still experiencing integration or connectivity issues, please collect the below details and share them with Moesif Support via Email or Chat. Our team will further investigate the root cause.

  • Moesif server integration name and version
  • Programming language version
  • Web Framework or API gateway version
  • Operating System and/or cloud provider
  • A Sample request made against your API including headers and body
  • If you experienced an error, share the timestamp when it happened

Updated: