spade_edge

command module
v0.0.0-...-5348dab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2018 License: MIT Imports: 23 Imported by: 0

README

NOTE: This project is no longer being updated publicly.

Spade Edge

Spade Edge is the entry point for data into the Spade pipeline. It is a minimally-validating, write-only API server which annotates events and writes them to Kinesis and S3. The service is typically scaled behind an Elastic Load Balancer, which handles concerns such as HTTPS. Standard requests result in a 204 No Content, and the persisted event is annotated with source IP, generated UUID, and server time.

Since Spade Edge is the single entry point from many different servers and many different domains, it has a configurable cross-domain policy.

HTTP API

POST / /track /track/

Data should be sent to Spade with POST; GET is available but deprecated, and will soon have an 8k URI limit. Spade Edge accepts any request that is properly formatted with data encoded with standard base64, with padding, using the alphabet1:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789+/=

If you are hooking Spade Edge up to the rest of the Spade pipeline, then data (after base64 decoding) should conform to a JSON encoded object or list of objects that look like the following (whitespace is not significant) and defined in Blueprint:

{
    "event": "some-event-to-track",
    "properties": {
        "property1": "value1",
        "otherproperty": "someothervalue"
    }
}

The two important pieces are event and properties. Spade Edge will automatically attach the current server timestamp, a UUID, the source IP, and optionally the user agent (if ua=1 is supplied as a request query parameter) to the raw data provided.

In both cases, the base64 should be posted as urlencoded form style:

data=eyJldmVudCI6InNvbWUtZXZlbnQtdG8tdHJhY2siLCJwcm9wZXJ0aWVzIjp7Im90aGVycHJvcGVydHkiOiJzb21lb3RoZXJ2YWx1ZSIsInByb3BlcnR5MSI6InZhbHVlMSJ9fQ==

Due to ambiguity in HTTP, the + in the base64 alphabet may be decoded to a space by the edge. Both the edge and spade itself will interpret spaces as + when base64 decoding to handle this.

Spade Edge will respond with a 204 No Content unless a img=1 is supplied as a request query parameter, in which case it will respond with a 200 and a 1x1 transparent pixel. It will also return a 413 if you send a payload larger than 500 kB.

1For compatibility reasons, Spade will also accept the URLSafe Base64 alphabet, but we don't recommend it for new clients.

GET /healthcheck

Returns a 200 status code without content.

GET /xarth

Returns a 200 status code with the content XARTH.

GET /crossdomain.xml

Returns an xml document containing the configured cross-domain policy.

Documentation

Overview

Package spade_edge provides a write-only API server for data ingest into the Spade pipeline. It performs light validation, annotation, and manages writes to Kinesis and S3. The service is typically behind an Elastic Load Balancer, which handles concerns such as HTTPS. Standard requests result in a 204 No Content, and the persisted event is annotated with source IP, a generated UUID, and server time.

Directories

Path Synopsis
_vendor
github.com/afex/hystrix-go/hystrix
Package hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
Package hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
github.com/aws/aws-sdk-go/aws
Package aws provides core functionality for making requests to AWS services.
Package aws provides core functionality for making requests to AWS services.
github.com/aws/aws-sdk-go/aws/awserr
Package awserr represents API error interface accessors for the SDK.
Package awserr represents API error interface accessors for the SDK.
github.com/aws/aws-sdk-go/aws/credentials
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
github.com/aws/aws-sdk-go/aws/credentials/endpointcreds
Package endpointcreds provides support for retrieving credentials from an arbitrary HTTP endpoint.
Package endpointcreds provides support for retrieving credentials from an arbitrary HTTP endpoint.
github.com/aws/aws-sdk-go/aws/credentials/stscreds
Package stscreds are credential Providers to retrieve STS AWS credentials.
Package stscreds are credential Providers to retrieve STS AWS credentials.
github.com/aws/aws-sdk-go/aws/defaults
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers.
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers.
github.com/aws/aws-sdk-go/aws/ec2metadata
Package ec2metadata provides the client for making API calls to the EC2 Metadata service.
Package ec2metadata provides the client for making API calls to the EC2 Metadata service.
github.com/aws/aws-sdk-go/aws/endpoints
Package endpoints provides the types and functionality for defining regions and endpoints, as well as querying those definitions.
Package endpoints provides the types and functionality for defining regions and endpoints, as well as querying those definitions.
github.com/aws/aws-sdk-go/aws/session
Package session provides configuration for the SDK's service clients.
Package session provides configuration for the SDK's service clients.
github.com/aws/aws-sdk-go/aws/signer/v4
Package v4 implements signing for AWS V4 signer Provides request signing for request that need to be signed with AWS V4 Signatures.
Package v4 implements signing for AWS V4 signer Provides request signing for request that need to be signed with AWS V4 Signatures.
github.com/aws/aws-sdk-go/private/protocol/json/jsonutil
Package jsonutil provides JSON serialization of AWS requests and responses.
Package jsonutil provides JSON serialization of AWS requests and responses.
github.com/aws/aws-sdk-go/private/protocol/jsonrpc
Package jsonrpc provides JSON RPC utilities for serialization of AWS requests and responses.
Package jsonrpc provides JSON RPC utilities for serialization of AWS requests and responses.
github.com/aws/aws-sdk-go/private/protocol/query
Package query provides serialization of AWS query requests, and responses.
Package query provides serialization of AWS query requests, and responses.
github.com/aws/aws-sdk-go/private/protocol/rest
Package rest provides RESTful serialization of AWS requests and responses.
Package rest provides RESTful serialization of AWS requests and responses.
github.com/aws/aws-sdk-go/private/protocol/restxml
Package restxml provides RESTful XML serialization of AWS requests and responses.
Package restxml provides RESTful XML serialization of AWS requests and responses.
github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil
Package xmlutil provides XML serialization of AWS requests and responses.
Package xmlutil provides XML serialization of AWS requests and responses.
github.com/aws/aws-sdk-go/service/kinesis
Package kinesis provides a client for Amazon Kinesis.
Package kinesis provides a client for Amazon Kinesis.
github.com/aws/aws-sdk-go/service/s3
Package s3 provides a client for Amazon Simple Storage Service.
Package s3 provides a client for Amazon Simple Storage Service.
github.com/aws/aws-sdk-go/service/s3/s3iface
Package s3iface provides an interface to enable mocking the Amazon Simple Storage Service service client for testing your code.
Package s3iface provides an interface to enable mocking the Amazon Simple Storage Service service client for testing your code.
github.com/aws/aws-sdk-go/service/s3/s3manager
Package s3manager provides utilities to upload and download objects from S3 concurrently.
Package s3manager provides utilities to upload and download objects from S3 concurrently.
github.com/aws/aws-sdk-go/service/s3/s3manager/s3manageriface
Package s3manageriface provides an interface for the s3manager package
Package s3manageriface provides an interface for the s3manager package
github.com/aws/aws-sdk-go/service/sns
Package sns provides a client for Amazon Simple Notification Service.
Package sns provides a client for Amazon Simple Notification Service.
github.com/aws/aws-sdk-go/service/sns/snsiface
Package snsiface provides an interface to enable mocking the Amazon Simple Notification Service service client for testing your code.
Package snsiface provides an interface to enable mocking the Amazon Simple Notification Service service client for testing your code.
github.com/aws/aws-sdk-go/service/sqs
Package sqs provides a client for Amazon Simple Queue Service.
Package sqs provides a client for Amazon Simple Queue Service.
github.com/aws/aws-sdk-go/service/sqs/sqsiface
Package sqsiface provides an interface to enable mocking the Amazon Simple Queue Service service client for testing your code.
Package sqsiface provides an interface to enable mocking the Amazon Simple Queue Service service client for testing your code.
github.com/aws/aws-sdk-go/service/sts
Package sts provides a client for AWS Security Token Service.
Package sts provides a client for AWS Security Token Service.
github.com/cactus/go-statsd-client/statsd
Package statsd provides a StatsD client implementation that is safe for concurrent use by multiple goroutines and for efficiency can be created and reused.
Package statsd provides a StatsD client implementation that is safe for concurrent use by multiple goroutines and for efficiency can be created and reused.
github.com/go-ini/ini
Package ini provides INI file read and write functionality in Go.
Package ini provides INI file read and write functionality in Go.
github.com/sirupsen/logrus
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
github.com/twitchscience/aws_utils/logger
Package logger is a wrapper around logrus that logs in a structured JSON format and provides additional context keys.
Package logger is a wrapper around logrus that logs in a structured JSON format and provides additional context keys.
golang.org/x/net/netutil
Package netutil provides network utility functions, complementing the more common ones in the net package.
Package netutil provides network utility functions, complementing the more common ones in the net package.
golang.org/x/sys/unix
Package unix contains an interface to the low-level operating system primitives.
Package unix contains an interface to the low-level operating system primitives.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL