> mobileapp Strategy - From Idea to Mobile App RealityVinova Our team will brainstorm with you on where to begin, where to go, and how to get you there. Whether you have a spark of an idea or an existing app – we can help. Getting your mobile strategy right is what our unique services are all about. We’ll wrestle with business challenges, discover new opportunities that will help you define and refine your product ideas into mobile app reality.

How to monitor your Laravel application by services (not by hostnames) | Laravel News

How to monitor your Laravel application by services (not by hostnames) | Laravel News

Hi, I’m Valerio, software engineer, founder & CTO at Inspector.

I decided to write this post after responding to a support request from a developer who asked me how he can monitor his Laravel application by services and not by hostnames.

The company is working on a backend API for a mobile app. The APIs are running on a set of AWS EC2 instances managed by an Autoscaling Group.

After a thorough investigation into the reason for this request, here is the solution we found.

What is an autoscaling group?

An Autoscaling Group contains a collection of VM instances that are treated as a logical grouping for the purposes of automatic scaling and management of specific component of your system.

In Laravel is quite easy to separate your application in logical components that runs in different servers, like APIs, background Jobs workers, web app, scheduled tasks (cron), etc, so they can scale in and out indipendently based on their specific workload.

Every established cloud provider allwos you to configure Autoscaling Groups, or you can use other technologies like Kubernetes. The result is the same:

Due to the constant turnover of servers to handle the application load dynamically you could see a bit of mess in your monitoring charts. A lot of trendlines turn on and off continuously, one for each underlying server.

Grouping monitoring data by service name

It may be more clear to use a human friendly service name to represent all your servers inside the same Autoscaling Group.

Since transactions in Inspector are grouped by the hostname, we can use the Inspector library to “artificially” change it just before the transaction is sent out of your application to make your dashboard more clear and understandable.

In the boot method of the AppServiceProvider you can use beforeFlush() to add a callback that simply change the hostname of the transaction, assigning a general service name (rest-api, workers, web-app, etc) instead of the original hostname of the server.

1<?php
5use App\Jobs\ExampleJob;
7use Inspector\Laravel\Facades\Inspector;
12 * Register any application services.
22 * Bootstrap any application services.
28 Inspector::beforeFlush(function ($inspector) {
31 // You can get the desired service_name by config, env, etc.
32 ->hostname = config(‘app.service_name’)
35}

You can control what service name should be used in each part of your system through the deployment process by using environment variables.

The app.service_name configuration property could be setup as below:

7 ‘service_name’ => env(‘INSPECTOR_SERVICE_NAME’, ‘rest_api’),

Along the deployment pipeline you can inject a different “INSPECTOR_SERVICE_NAME” for each autoscaling group.

Your dashboard will chage from this:

To this:

I think it looks more clear, and it is what our customer think too 😃!

The number of servers is no longer visible, but you could gather this information from your cloud console.

Use filters to eliminate noise

Thanks to the transactions filtering it’s even more easy to identify the most heaviest tasks in each Autoscaling Group, so you can optimize their performance and cut the costs due to the high number of tasks perfomed before the Autoscaling Group need to start a new server.

Thanks to its purely software library Inspector could be the right choice for developers that love to stay focused on coding instead of infrastructure management.

You will never have the need to install things at the server level or make complex configuration in your cloud infrastructure to monitor your application in real-time.

Inspector works with a lightweight software library that you can install in your application like any other dependencies. Try the Laravel package, it’s free.

This content was originally published here.

Malcare WordPress Security

design firms in singapore,mobile apps development singapore,mobile app development singapore,singapore website design,web design services singapore,ios developer singapore,mobile application developer singapore,website designer singapore,design agency singapore,singapore web design,singapore web design services,singapore mobile application developer,app developer singapore,singapore app developer,developers in singapore,web development singapore,mobile developer singapore,developer in singapore,web designer singapore,website development singapore,website design singapore,mobile app developer singapore,website developer singapore,android developer singapore,ios app development singapore,graphic designer in singapore,mobile game developer singapore,app development singapore,web design singapore,web development company singapore,singapore mobile app developer,singapore web development,ruby on rails developer singapore,mobile apps singapore,web application singapore,mobile application development singapore,web design company singapore