Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Moesif/moesif-gcp-function-go-example

Open more actions menu

Repository files navigation

Moesif GCP "Cloud Functions" example for Go to log outbound HTTP(s) calls

Moesif is an API analytics platform. Cloud Functions is a serverless Function as a service (Faas) offer from Google Cloud Platform (GCP)

Scenario:

A Moesif client who utilizes Cloud Functions, written in Go Lang, would like to log all "outbound" calls originating from their cloud functions to be logged into Moesif.

Solution:

This is a simple "Cloud function" that shows how to integrate Moesif outbound call logging.

Overview:

  1. Create a Cloud Function in go by following GCP Quickstart. Deploy and verify it works.
  2. Copy moesif-init.go from this project into your Cloud Function project. Update the package name to match yours.
  3. In your Cloud Functions file (eg: function.go) add/update the init function to invoke moesifInit:
func init() {
	moesifInit()
}
  1. In GCP console, add the following Runtime environment variable

MOESIF_APPLICATION_ID : <enter the moesif application id here>


Try it in 2 minutes!

Follow 3 simple steps to create sample function, invoke it, and see the results in Moesif dashboard:

HOWTO quickly run sample in GCP using gcloud tool

About

Moesif GCP Cloud Functions middleware to capture/log outbound http calls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.