Skip to content

Instantly share code, notes, and snippets.

💭
🤔

syossan27 syossan27

💭
🤔
Block or report user

Report or block syossan27

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 02.start-telegraf.config
container_commands:
01start:
command: "sudo service telegraf start"
ignoreErrors: true
View 01.telegraf-config.config
files:
"/etc/telegraf/telegraf.conf"
mode: "000666"
owner: root
group: root
content: |
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
View 00.install-telegraf.config
files:
"/etc/yum.repos.d/influxdb.repo"
mode: "00644"
owner: root
group: root
content: |
[influxdb]
name = InfluxDB Repository - RHEL $releasever
baseurl = https://repos.influxdata.com/rhel/7/$basearch/stable
enabled = 1
View telegraf.config
# Telegraf Configuration
[agent]
## メトリクスの集計間隔
## agentは他に設定があるけども特にこだわりなければこれを弄るだけでよいかな
interval = "10s"
###############################################################################
# OUTPUT PLUGINS #
###############################################################################
View sample-recover-format.proto
service Sample {
rpc SampleAPI(Request) returns (Response) {
option (google.api.http) = {
get : "/sample"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
summary : "サンプル"
responses : {
key : "500"
value : {
View sample-recover.proto
service Sample {
rpc SampleAPI(Request) returns (Response) {
option (google.api.http) = {
get : "/sample"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
summary : "サンプル"
responses : {
key : "500"
value : {
View sample-broken.proto
service Sample {
rpc SampleAPI(Request) returns (Response) {
option (google.api.http) = {
get: "/sample"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
summary: "サンプル"
responses: {
key: "500";
value : {
View sample.proto
service Sample {
rpc SampleAPI(Request) returns (Response) {
option (google.api.http) = {
get : "/sample"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
summary : "サンプル"
responses : {
key : "500";
value : {
View gateway-response.go
func main() {
flag.Parse()
defer glog.Flush()
ctx := context.Background()
opts := gateway.Options{
Addr: ":8080",
GRPCServer: gateway.Endpoint{
Network: *network,
Addr: *endpoint,
View server-response.go
func (s *server) Example(ctx context.Context, in *pb.Request) (*pb.Response, error) {
// Server側のページネーションメッセージ
paginationMessage := &pb.ServerPaginationMessage{
Page: 2,
Limit: 20,
Size: 100,
First: &pb.PaginationMessage{ Page: 1, Limit: 20 },
Last: &pb.PaginationMessage{ Page: 5, Limit: 20 },
Next: &pb.PaginationMessage{ Page: 3, Limit: 20 },
Prev: &pb.PaginationMessage{ Page: 1, Limit: 20 },
You can’t perform that action at this time.