Jef Practice: Local testing of mutated events using netcat

Hey Everyone!
I found myself working with the prometheus event mutator that portertech put togther, so I could stream Sensu collected metrics into an external service that knows how to consume the prometheus metrics format.

To test everything was working, including the mutator, I spun up a very simple tcp listening service using using netcat:

nc -v -l -k localhost 9001

and a simple tcp handler definition making use of the prometheus mutator

api_version: core/v2
metadata:
  name: test_tcp
spec:
  mutator: sensu-prometheus-mutator
  socket:
    host: <host-ip>
    port: 9001
  type: tcp

When i execute a check configured to use the test_tcp handler, Iā€™m able to to get sample output from the handler making sure its formatted as I expect.

1 Like