Skip to main content

Building a Simple Event-Driven Application with Datadog Workflows

Workflows, DevOps, AI, DevOps workflows, code Postman Dynatrace GitLab value Argo Atlassian database Sqlcommenter flow metrics VSM low-code PostgreSQL database JSON
Workflows, DevOps, AI, DevOps workflows, code Postman Dynatrace GitLab value Argo Atlassian database Sqlcommenter flow metrics VSM low-code PostgreSQL database JSON

Back in October 2022, I wrote a short blog post explaining how I automated our Datadog Marketplace sales cycle using a few AWS services and my first-ever Golang program. That basic, event-driven system saved our sales team several hours a week by replacing a manual process with something far more efficient.

Even though the original setup worked well and ran reliably for a couple of years, it still required ongoing maintenance — such as upgrading Go versions, fixing minor issues from those upgrades and updating the HubSpot SDK I built when their APIs changed. It wasn’t broken, but it was becoming a bit of a time sink. With Datadog Workflows becoming more robust and available, I figured it was time for a refresh. Why not see what it could do?

Breaking Down the Old Flow

The original flow followed a pretty typical event-driven architecture pattern: Event producers, a router and a consumer.

Producer: The customer’s Datadog instance, which triggered an event when a trial started. Email (via AWS SES) also played a supporting role here by capturing trial initiation messages.

Router: An SNS topic in AWS, which fanned out the messages to the consumer.

Consumer: A Lambda function that parsed the message and interacted with HubSpot’s APIs.

While this system did its job, it was fairly code-heavy and required occasional tweaks, especially around regex parsing and SDK maintenance.

Rebuilding With Datadog Workflows

To recreate the same logic in Datadog, I first needed a way to ingest emails. Luckily, Datadog has a built-in (and often overlooked) feature called the ‘Email Events API’. This lets you generate a unique email address that pipes incoming messages directly into your Datadog instance as events. Between that and the customer triggering a trial via the Marketplace, I had my event producers.

Next came ‘parsing’ those events. This was a huge improvement over the AWS version.

Instead of hand-rolling the regex for every single attribute, I used Datadog’s ‘Grok Parser’ and built-in pipeline processors to normalize the events. This made things more maintainable and much easier to evolve. A few additional processors helped clean up and standardize some attributes for downstream use.

You could argue that this event pipeline acts as both a consumer (processing the raw event) and a producer (outputting a normalized version of the event for downstream systems). Either way, it simplified a lot of the logic I previously had to write in code.

Routing Events in Datadog

At the time of writing, Datadog Workflows can’t be triggered directly from an ingested event. To work around this, I set up a monitor that looks for specific attributes — events from a certain service and a specific @title pattern. It also ignores trials that come from Datadog Partner instances.

This monitor acts as the router, forwarding qualified events to a Datadog Workflow.

The New Consumer: Datadog Workflow

Just like the old Lambda function, the Workflow is now the consumer. It takes the normalized event attributes and performs a sequence of steps to create objects in HubSpot — contacts, deals, products and line items. If the process succeeds, it sends a message to Slack with a link to the new deal in HubSpot. If anything fails, it also notifies the Slack channel with error details.

Final Thoughts

What started as an experiment turned into a functional and surprisingly low-maintenance solution. By using Datadog Workflows, I gained a simpler parsing mechanism and a flow that’s easier for our sales ops team to understand and update themselves. Since it’s a low-code solution, they can tweak it without touching infrastructure or digging into code.

Of course, there are trade-offs. Datadog Workflows aren’t meant to replace full-fledged serverless architectures, especially when it comes to high traffic or strict latency requirements. But for a system like ours, with moderate volume and no SLA constraints, it works just fine — and it was fun to build.



from DevOps.com https://ift.tt/JMsEZfr

Comments

Popular posts from this blog

Why the Software Development Tools you Choose Directly Affect Your CI/CD Reliability 

Most conversations about CI/CD reliability start in the wrong place. Teams debug flaky pipelines, investigate intermittent failures, tune alerting thresholds and optimize build times. All of that work is legitimate. However, the decisions that most directly determine whether a CI/CD pipeline is reliable or not were made months or years earlier, during tool selection. By the time teams are debugging pipeline reliability, they are usually dealing with the downstream consequences of upstream decisions that seemed reasonable at the time.   The software development tools a team chooses shape their CI/CD pipeline in ways that are not always visible during evaluation. Understanding those connections is the most practical starting point for teams that want reliable pipelines rather than better pipeline firefighting.   The Integration Surface Problem   Every tool in a software development stack creates an integration surface. Integration surface is the set of connections a tool has with oth...

Coronavirus Briefing: What Happened Today

Coronavirus Briefing: What Happened Today By Jonathan Wolfe and Lara Takenaga from NYT U.S. https://ift.tt/3gaVp9N Coronavirus (2019-nCoV)

Building a Security Feedback Process for DevOps

The last few years have seen some major slip-ups in the security space among all major cloud providers, resulting in uncertainty and speculation. That’s understanding; cloud security is an extremely complicated subject as enterprises build and deploy applications faster than ever before to keep up with business requirements. Most of the security issues that occur […] The post Building a Security Feedback Process for DevOps appeared first on DevOps.com . from DevOps.com http://bit.ly/2L1DS7t