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.
| Type | Require | Default | Limitation | Description |
---|
name | string | ✓ | | ~ 32 chars | Namespace name |
description | string | | | ~ 1024 chars | description of Namespace |
type | string | ✓ | “gs2” | ~ 128 chars | Log Export Method |
gcpCredentialJson | string | {type} == “bigquery” | | ~ 5120 chars | GCP Credentials |
bigQueryDatasetName | string | {type} == “bigquery” | | ~ 1024 chars | BigQuery dataset name |
logExpireDays | int | {type} in [“gs2”, “bigquery”] | | ~ 3650 | Log retention period (days) |
awsRegion | string | {type} == “firehose” | | ~ 256 chars | AWS Region |
awsAccessKeyId | string | {type} == “firehose” | | ~ 256 chars | AWS access key ID |
awsSecretAccessKey | string | {type} == “firehose” | | ~ 256 chars | AWS Secret Access Key |
firehoseStreamName | string | {type} == “firehose” | | ~ 256 chars | Kinesis Firehose stream name |
GetAttr
| Type | Description |
---|
Item | Namespace | Namespace 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.
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
GetAttr
| Type | Description |
---|
Item | Insight | GS2-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
| Type | Require | Default | Limitation | Description |
---|
timestamp | long | ✓ | | | Timestamp |
requestId | string | ✓ | | ~ 1024 chars | Request ID |
service | string | ✓ | | ~ 1024 chars | Types of Microservices |
method | string | ✓ | | ~ 1024 chars | Microservice Methods |
userId | string | | | ~ 128 chars | User Id |
request | string | ✓ | | ~ 10485760 chars | Request Content |
result | string | ✓ | | ~ 10485760 chars | Response Content |
AccessLogCount
| Type | Require | Default | Limitation | Description |
---|
service | string | | | ~ 1024 chars | Types of Microservices |
method | string | | | ~ 1024 chars | Microservice Methods |
userId | string | | | ~ 128 chars | User Id |
count | long | ✓ | | ~ 9223372036854775805 | Count |
IssueStampSheetLog
| Type | Require | Default | Limitation | Description |
---|
timestamp | long | ✓ | | | Timestamp |
transactionId | string | ✓ | | ~ 1024 chars | Transaction ID |
service | string | ✓ | | ~ 1024 chars | Types of Microservices |
method | string | ✓ | | ~ 1024 chars | Microservice Methods |
userId | string | ✓ | | ~ 128 chars | User Id |
action | string | ✓ | | ~ 1024 chars | Acquire Action |
args | string | ✓ | | ~ 5242880 chars | Arguments |
tasks | List<string> | | | ~ 10 items | List of Stamp task |
IssueStampSheetLogCount
| Type | Require | Default | Limitation | Description |
---|
service | string | | | ~ 1024 chars | Types of Microservices |
method | string | | | ~ 1024 chars | Microservice Methods |
userId | string | | | ~ 128 chars | User Id |
action | string | | | ~ 1024 chars | Acquire Action |
count | long | ✓ | | ~ 9223372036854775805 | Count |
ExecuteStampSheetLog
| Type | Require | Default | Limitation | Description |
---|
timestamp | long | ✓ | | | Timestamp |
transactionId | string | ✓ | | ~ 1024 chars | Transaction ID |
service | string | ✓ | | ~ 1024 chars | Types of Microservices |
method | string | ✓ | | ~ 1024 chars | Microservice Methods |
userId | string | ✓ | | ~ 128 chars | User Id |
action | string | ✓ | | ~ 1024 chars | Acquire Action |
args | string | ✓ | | ~ 5242880 chars | Arguments |
ExecuteStampSheetLogCount
| Type | Require | Default | Limitation | Description |
---|
service | string | | | ~ 1024 chars | Types of Microservices |
method | string | | | ~ 1024 chars | Microservice Methods |
userId | string | | | ~ 128 chars | User Id |
action | string | | | ~ 1024 chars | Acquire Action |
count | long | ✓ | | ~ 9223372036854775805 | Count |
ExecuteStampTaskLog
| Type | Require | Default | Limitation | Description |
---|
timestamp | long | ✓ | | | Timestamp |
taskId | string | ✓ | | ~ 1024 chars | Task ID |
service | string | ✓ | | ~ 1024 chars | Types of Microservices |
method | string | ✓ | | ~ 1024 chars | Microservice Methods |
userId | string | ✓ | | ~ 128 chars | User Id |
action | string | ✓ | | ~ 1024 chars | Acquire Action |
args | string | ✓ | | ~ 5242880 chars | Arguments |
ExecuteStampTaskLogCount
| Type | Require | Default | Limitation | Description |
---|
service | string | | | ~ 1024 chars | Types of Microservices |
method | string | | | ~ 1024 chars | Microservice Methods |
userId | string | | | ~ 128 chars | User Id |
action | string | | | ~ 1024 chars | Acquire Action |
count | long | ✓ | | ~ 9223372036854775805 | Count |