pushpinfastly

How to Pass Pushpin Pod Instance Details When Invoking Backend Service Defined in Pushpin Config Routes


I'm currently working with Pushpin instances running within a distributed system. Each Pushpin instance communicates with a Java backend service via routes that are defined in the Pushpin configuration YAML file. My goal is to enrich the backend service requests with specific Pushpin instance details, like the pod name, while utilizing the defined routes.

To give you a clearer picture of the setup:

We have multiple Pushpin instances operating within the system. Communication between these Pushpin instances and a Java backend service occurs through routes outlined in the Pushpin configuration YAML file. I'm keen on understanding the best approach to pass along pertinent Pushpin instance information, such as the pod name, for each backend service request made via the configured routes. Essentially, I want to correlate backend service requests with the originating Pushpin instance.

I'm interested in insights on how to achieve this seamlessly while adhering to best practices. Should I modify the Pushpin configuration directly? Would utilizing custom headers or parameters be appropriate for transmitting the instance details? Furthermore, what adjustments would be necessary within the Java backend service to extract and leverage this Pushpin instance information effectively?

Any assistance, including code snippets or examples, would be immensely valuable in helping me implement this integration successfully. Thank you for your expertise!


Solution

  • One way to do this would be to use your Pushpin instance's routes configuration.

    There's a route condition parameter header that can set arbitrary hard-coded headers on proxied requests.

    https://pushpin.org/docs/configuration/#condition-parameters

    If your routes file could be templatized with the pod name then you could use this.