Rastrear despliegues de código en New Relic con Laravel

Rastrea despliegues en New Relic con un comando artisan de Laravel que lee API key y App ID desde .env y envía metadatos de release, versión y timestamp para CI/CD y trazabilidad.

9 sept 2025 • 3 min read • Q2BSTUDIO Team

Inteligencia-Artificial-

Rastrear despliegues en New Relic puede ser complicado si no se utilizan GitHub Actions u otras integraciones ya preparadas. Una solución ligera y portable es crear un comando artisan personalizado en Laravel que envíe los datos de despliegue directamente a New Relic, incluyendo información útil como versión, identificador o timestamp.

La idea es sencilla y eficiente: implementar un comando que lea la configuración de la aplicación y haga una petición a la API de New Relic marcando cada despliegue. En Laravel esto se puede resolver con un comando que obtenga la API key y el app ID desde el archivo .env y la configuración en config/services.php, y que ejecute una llamada HTTP a New Relic con los metadatos del release. Con ello bastará ejecutar un único paso como php artisan app:deploy-mark en cualquier pipeline CI/CD para que New Relic registre el despliegue.

Este enfoque es especialmente útil cuando se trabaja con pipelines variados: Jenkins, GitLab CI, Bitbucket Pipelines, Azure DevOps o despliegues manuales. Al delegar la lógica en un comando artisan se mantiene la coherencia entre entornos y se facilita el trazado de versiones sin acoplarse a una sola plataforma. Además, es posible enriquecer el payload con variables adicionales como entorno, usuario que despliega o identificador del build.

En Q2BSTUDIO, empresa especializada en desarrollo de software y aplicaciones a medida, implementamos este tipo de soluciones para ofrecer trazabilidad y observabilidad en los despliegues de nuestros clientes. Si necesitas una solución integrada para tus proyectos a medida puedes conocer más sobre nuestro trabajo en aplicaciones a medida.

Tres recomendaciones prácticas para implementar el comando de despliegue en Laravel: primero, almacenar la API key y el app ID en .env y referenciarlos desde config/services.php; segundo, diseñar el comando para ser idempotente y tolerante a fallos de red; tercero, incluir metadatos que faciliten troubleshooting como commit hash, rama y timestamp. Con esto se logra un registro claro de cada release en New Relic y se mejora la correlación entre errores y versiones.

Además de rastrear despliegues, en Q2BSTUDIO ofrecemos servicios complementarios que mejoran la fiabilidad de los sistemas como servicios cloud aws y azure, ciberseguridad y pentesting, y soluciones de inteligencia de negocio. Si tu proyecto necesita un despliegue seguro y escalable podemos ayudarte a desplegar y monitorizar en la nube con las mejores prácticas: servicios cloud aws y azure.

Trabajamos con tecnologías de inteligencia artificial y agentes IA para automatizar tareas, mejorar la observabilidad y extraer valor de los datos. Combinamos software a medida con prácticas de ciberseguridad, servicios inteligencia de negocio y herramientas como Power BI para ofrecer soluciones completas que incluyen monitorización, alertas y reporting. Si buscas integrar trazabilidad de despliegues con capacidades de IA para empresas, Q2BSTUDIO aporta experiencia y soluciones flexibles.

En resumen, marcar despliegues en New Relic desde Laravel mediante un comando artisan personalizado es una solución ligera, portable y aplicable a cualquier stack CI/CD. Combina configuración segura en .env, buenas prácticas en el comando y la automatización en tu pipeline para mantener un historial claro de releases, mejorar la respuesta ante incidentes y facilitar auditorías.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.