Unsupported Protocol Error When Attempting POST

TLDR: Can’t make a POST… get the following error:

ts=2020-07-17T22:18:13.503Z lvl=error msg="failed to POST alert data" service=httppost task=test_low_picks err="Post : unsupported protocol scheme \"\""


I’m having a heck of a time getting my my alert to properly send a POST message. I can integrate with slack no problem, but not a POST message. The end of my tickScript looks as follows…

    |alert()
        .crit(lambda: "attempted" < 30 AND "eligible" > 60)
        .post()
        .endpoint('function-name-here')
        .skipSSLVerification()
        .captureResponse()
        .timeout(5s)
    |log()

My successful POST message to change the endpoint/node in kapacitor.conf file looks like the following (obviously hiding credentials and changing url here).

{
    "set":{
        "alert-template": "",
        "alert-template-file": "",
        "basic-auth": { "username" : "MY USERNAME", "password": "MY PASSWORD"},
        "endpoint": "function-name-here",
        "headers": { "Authorization": "bearer $(gcloud auth print-identity-token)"},
        "row-template": "",
        "row-template-file": "",
        "url": "https://path_to_my_cloud_function.cloudfunctions.net/function-name-here"
    }
}

When I check that it was successful through a GET request… I get the below, which I believe looks ok?

{
    "link": {
        "rel": "self",
        "href": "/kapacitor/v1/config/httppost"
    },
    "elements": [
        {
            "link": {
                "rel": "self",
                "href": "/kapacitor/v1/config/httppost/example"
            },
            "options": {
                "alert-template": "",
                "alert-template-file": "",
                "basic-auth": false,
                "endpoint": "example",
                "headers": null,
                "row-template": "",
                "row-template-file": "",
                "url": "http://example.com"
            },
            "redacted": [
                "basic-auth"
            ]
        },
        {
            "link": {
                "rel": "self",
                "href": "/kapacitor/v1/config/httppost/test-anomaly-detection"
            },
            "options": {
                "alert-template": "",
                "alert-template-file": "",
                "basic-auth": true,
                "endpoint": "function-name-here",
                "headers": {
                    "Authorization": "bearer $(gcloud auth print-identity-token)"
                },
                "row-template": "",
                "row-template-file": "",
                "url": "https://path_to_cloud_function/function-name-here"
            },
            "redacted": [
                "basic-auth"
            ]
        }
    ]
}

The error shown from grepping the logs is…

ts=2020-07-17T22:18:13.503Z lvl=error msg="failed to POST alert data" service=httppost task=test_low_picks err="Post : unsupported protocol scheme \"\""

I’m trying to use the post request to trigger a google cloud function (which is why you see the authorization header). I have successfully run the cloud function with a POST request using curl and the same credentials as above… so I know the issue is not on the GCP side.

curl https://REGION-PROJECT_ID.cloudfunctions.net/FUNCTION_NAME \
  -H "Authorization: bearer $(gcloud auth print-identity-token)"

Does anyone have any suggestions. It would be GREATLY appreciated! Is there a way to see the raw POST request that kapacitor is producing and where the protocol is goofed?

As a side note, I could try the .exec() node instead of the .post() node, but I can’t figure out how to host a python script on the kapacitor instance (since my kapacitor instance is set up through influxDB cloud)… not to mention how to add additional python libraries (like opencv) to the hosted kapacitor instance… Any useful info on these things would be useful too.