582 Followers
·
Follow

What I wish every Library author would do in the world of API Libraries.

Image for post
Image for post
Photo by Brad Barmore on Unsplash

Background

If you are building web services with Node.JS or TypeScript, chances are you have used many community-built API bindings to make 3rd Party API calls. Since these bindings are built by different teams from different backgrounds, their conventions can vary quite a bit.

Below are three things that would drastically improve the usability of an API Library for end users. Library Authors, if you care about gaining more users, please make them happen!

1. Include Type Definition

TypeScript is gaining traction and saving developers a lot of headaches in finding type related bugs. When a request to 3rd party API does not specify its input Shape nor its return Shape, it results in developers putting in lots…


Image for post
Image for post
Photo by Chris Chan on Unsplash

tl;dr: Full example code: https://github.com/teamzerolabs/mirth_channel_exporter, read on to see step by step instructions

Background

Exporters are the heart and soul of Prometheus Monitoring Pipelines. If you run into a situation where an exporter does not exist yet, you are encouraged to write your own. We will cover the steps required to make the exporter. No worries, it is quick.

Goal

  • Write an exporter in GO.
  • Exporter will call REST API against an application (Mirth Connect in this example) when scraped.
  • Exporter will convert the result payload into Metrics.

1. Setup GO and Package Dependencies

go mod init my_first_exporter 
go get github.com/prometheus/client_golang
go get github.com/joho/godotenv …


Image for post
Image for post
Photo by Marten Newhall on Unsplash

tl;dr: If you are already familiar with the concept of monitoring and only need the Mirth channel exporter: https://github.com/teamzerolabs/mirth_channel_exporter

New assignment: Monitor Message Throughput and Errors with Mirth Channels

Let me know if this matches your story:

  • You have gone live with several hospitals on HL7 Channels.
  • You use Mirth Connect, and everything is running well.
  • Sometimes, you hear from the hospital that HL7 messages (ADT/MFN) are queuing up on their end. Or, they haven’t seen any message from you (MDM/ORU) in a while.
  • You log into Mirth, and discover that messages have queued up, or getting into the error states for the last two or three days.

You are busy leading a team in implementing new features, company is in the early phase, and cannot spare cycles to check up on Mirth Connect. …

About

Jack Yeh

I monitor your full stack deployment in production, so you can sleep at night. Docker | Kubernetes | AWS | Prometheus | Grafana

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store