GS2-Deploy/CDK Reference of GS2-Log

Entities

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
typestring“gs2”~ 128 charsLog Export Method
gcpCredentialJsonstring{type} == “bigquery”~ 5120 charsGCP Credentials
bigQueryDatasetNamestring{type} == “bigquery”~ 1024 charsBigQuery dataset name
logExpireDaysint{type} in [“gs2”, “bigquery”]~ 3650Log retention period (days)
awsRegionstring{type} == “firehose”~ 256 charsAWS Region
awsAccessKeyIdstring{type} == “firehose”~ 256 charsAWS access key ID
awsSecretAccessKeystring{type} == “firehose”~ 256 charsAWS Secret Access Key
firehoseStreamNamestring{type} == “firehose”~ 256 charsKinesis Firehose stream name

Enumeration type definition to specify as type

Enumerator String DefinitionDescription
gs2Management by GS2
bigqueryExport to BigQuery
firehoseExport to Kinesis Firehose

GetAttr

TypeDescription
ItemNamespaceNamespace created

Implementation Example

Type: GS2::Log::Namespace
Properties:
  Name: namespace1
  Description: null
  Type: gs2
  GcpCredentialJson: {"project_id": "gs2-dev"}
  BigQueryDatasetName: dataset_0001
  LogExpireDays: 3
  AwsRegion: awsRegion
  AwsAccessKeyId: awsAccessKeyId
  AwsSecretAccessKey: awsSecretAccessKey
  FirehoseStreamName: firehoseStreamName
from gs2_cdk import Stack, core, log

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        log.Namespace(
            stack=self,
            name="namespace-0001",
            options=log.NamespaceOptions(
                type='gs2',
                gcp_credential_json='{"project_id": "gs2-dev"}',
                big_query_dataset_name='dataset_0001',
                log_expire_days=3,
                aws_region='awsRegion',
                aws_access_key_id='awsAccessKeyId',
                aws_secret_access_key='awsSecretAccessKey',
                firehose_stream_name='firehoseStreamName',
            ),
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Log\Model\Namespace_(
            stack: $this,
            name: "namespace-0001",
            options: new \Gs2Cdk\Log\Model\Options\NamespaceOptions(
                type: "gs2",
                gcpCredentialJson: "{\"project_id\": \"gs2-dev\"}",
                bigQueryDatasetName: "dataset_0001",
                logExpireDays: 3,
                awsRegion: "awsRegion",
                awsAccessKeyId: "awsAccessKeyId",
                awsSecretAccessKey: "awsSecretAccessKey",
                firehoseStreamName: "firehoseStreamName"
            )
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.log.model.Namespace(
            this,
            "namespace-0001",
            new io.gs2.cdk.log.model.options.NamespaceOptions() {
                {
                    type = "gs2";
                    gcpCredentialJson = "{\"project_id\": \"gs2-dev\"}";
                    bigQueryDatasetName = "dataset_0001";
                    logExpireDays = 3;
                    awsRegion = "awsRegion";
                    awsAccessKeyId = "awsAccessKeyId";
                    awsSecretAccessKey = "awsSecretAccessKey";
                    firehoseStreamName = "firehoseStreamName";
                }
            }
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import log from "@/gs2cdk/log";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new log.model.Namespace(
            this,
            "namespace-0001",
            {
                type: "gs2",
                gcpCredentialJson: "{\"project_id\": \"gs2-dev\"}",
                bigQueryDatasetName: "dataset_0001",
                logExpireDays: 3,
                awsRegion: "awsRegion",
                awsAccessKeyId: "awsAccessKeyId",
                awsSecretAccessKey: "awsSecretAccessKey",
                firehoseStreamName: "firehoseStreamName"
            }
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Log.Model.Namespace(
            this,
            "namespace-0001",
            new Gs2Cdk.Gs2Log.Model.Options.NamespaceOptions {
                type = "gs2",
                gcpCredentialJson = "{\"project_id\": \"gs2-dev\"}",
                bigQueryDatasetName = "dataset_0001",
                logExpireDays = 3,
                awsRegion = "awsRegion",
                awsAccessKeyId = "awsAccessKeyId",
                awsSecretAccessKey = "awsSecretAccessKey",
                firehoseStreamName = "firehoseStreamName"
            }
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

Insight

GS2-Insight is a tool for visualizing and analyzing access logs stored in GS2-Log. GS2-Insight itself is open source and available on github. https://github.com/gs2io/gs2-insight

Here, you can launch and use the publicly available open source code on-demand without hosting it yourself. GS2-Insight activated on demand can be used for up to 2 hours. If you wish to use it for more than 2 hours, please host it yourself.

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Enumeration type definition to specify as status

Enumerator String DefinitionDescription
ALLOCATINGServer assignment in progress
LAUNCHINGduring startup
ACTIVEActive
DELETEDDeleted

GetAttr

TypeDescription
ItemInsightGS2-Insight

Implementation Example

Type: GS2::Log::Insight
Properties:
  NamespaceName: namespace1
from gs2_cdk import Stack, core, log

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        log.Insight(
            stack=self,
            namespace_name="namespace-0001",
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Log\Model\Insight(
            stack: $this,
            namespaceName: "namespace-0001"
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.log.model.Insight(
            this,
            "namespace-0001"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import log from "@/gs2cdk/log";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new log.model.Insight(
            this,
            "namespace-0001"
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Log.Model.Insight(
            this,
            "namespace-0001"
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

AccessLog

Access log

This log records requests to microservices and their responses.

TypeRequireDefaultLimitationDescription
timestamplongTimestamp (Unix time unit:milliseconds)
requestIdstring~ 1024 charsRequest ID
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
requeststring~ 10485760 charsRequest Content
resultstring~ 10485760 charsResponse Content

AccessLogCount

Access log aggregation

TypeRequireDefaultLimitationDescription
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
countlong~ 9223372036854775805Count

IssueStampSheetLog

Issued transaction log

TypeRequireDefaultLimitationDescription
timestamplongTimestamp (Unix time unit:milliseconds)
transactionIdstring~ 1024 charsTransaction ID
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
actionstring~ 1024 charsAcquire Action
argsstring~ 5242880 charsArguments
tasksList<string>~ 10 itemsList of Stamp task

IssueStampSheetLogCount

Issued transaction log

TypeRequireDefaultLimitationDescription
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
actionstring~ 1024 charsAcquire Action
countlong~ 9223372036854775805Count

ExecuteStampSheetLog

Stamp Sheet Execution Log

This is a log of the execution details of the transaction for each microservice.

TypeRequireDefaultLimitationDescription
timestamplongTimestamp (Unix time unit:milliseconds)
transactionIdstring~ 1024 charsTransaction ID
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
actionstring~ 1024 charsAcquire Action
argsstring~ 5242880 charsArguments

ExecuteStampSheetLogCount

Acquire actions execution log tally

TypeRequireDefaultLimitationDescription
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
actionstring~ 1024 charsAcquire Action
countlong~ 9223372036854775805Count

ExecuteStampTaskLog

Stamp Task Execution Log

This is a log of the execution details of the stamp task for each microservice.

TypeRequireDefaultLimitationDescription
timestamplongTimestamp (Unix time unit:milliseconds)
taskIdstring~ 1024 charsTask ID
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
actionstring~ 1024 charsAcquire Action
argsstring~ 5242880 charsArguments

ExecuteStampTaskLogCount

Acquire actions execution log tally

TypeRequireDefaultLimitationDescription
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
actionstring~ 1024 charsAcquire Action
countlong~ 9223372036854775805Count

AccessLogWithTelemetry

This log records requests to microservices and their responses. The log includes response time and context information of the caller.

TypeRequireDefaultLimitationDescription
timestamplongTimestamp (Unix time unit:milliseconds)
sourceRequestIdstring~ 1024 charsSource Request ID
requestIdstring~ 1024 charsRequest ID
durationlong~ 9223372036854775805Duration(ms)
servicestring~ 1024 charsTypes of Microservices
methodstring~ 1024 charsMicroservice Methods
userIdstring~ 128 charsUser Id
requeststring~ 10485760 charsRequest Content
resultstring~ 10485760 charsResponse Content
statusenum {
    “ok”,
    “error”
}
~ 128 charsDuration(ms)

Enumeration type definition to specify as status

Enumerator String DefinitionDescription
okOK
errorError

InGameLogTag

In-game log tag

TypeRequireDefaultLimitationDescription
keystring~ 64 charsTag Key
valuestring~ 128 charsTag Value