Skip to content

Commit

Permalink
init project
Browse files Browse the repository at this point in the history
  • Loading branch information
qiansheng91 committed Aug 15, 2021
1 parent 87c608c commit 13424e6
Show file tree
Hide file tree
Showing 24 changed files with 1,104 additions and 110 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.16 AS build
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
COPY *.go ./
COPY sls_store/*.go ./sls_store/
RUN go mod download && CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o /jaeger-sls-plugin

FROM jaegertracing/all-in-one:1.25.0
ENV ACCESS_KEY_SECRET="" \
ACCESS_KEY_ID="" \
PROJECT="" \
ENDPOINT="" \
INSTANCE="" \
GRPC_STORAGE_PLUGIN_BINARY="/jaeger-sls-plugin" \
SPAN_STORAGE_TYPE=grpc-plugin \
JAEGER_DISABLED=true \
GRPC_STORAGE_PLUGIN_LOG_LEVEL=DEBUG
COPY --from=build /jaeger-sls-plugin /jaeger-sls-plugin

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 千乘(Qian Sheng)
Copyright (c) 2021 Alibaba Cloud

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SLS Storage Plugin

This is the repository that contains object storage (Alibaba Could log service) plugin for Jaeger.

## About
Expand All @@ -12,7 +14,21 @@ The [Alibaba Could log service](https://www.alibabacloud.com/product/log-service
resilience, and freedom from operation and maintenance, allowing users to cope with surge traffic or inaccurate size
assessment quickly, and the SLS service itself provides 99.9% availability and 11 out of 9 data reliability.

Jaeger :heart: The Alibab Cloud log service
The Alibab Cloud log service :heart: Jaeger

## Quick Start

1. Login [Alibaba Cloud log service Console](https://sls.console.aliyun.com/lognext/profile)
2. Create Project
[CrateProject](./images/create_project.gif)
3. Create Trace Instance
[CreateTraceInstance](./images/create_trace_instance.gif)
4. Modify Docker compose file
[ModifyConfigure](./images/modify_configure.gif)
5. Start Demo
[StartingDemo](./images/start_demos.gif)
6. Having fun with Jaeger and SLS. :grinning:
[HavingFunWithJaegerAndSLS](./images/havingfun.gif)

## Build/Compile

Expand All @@ -23,13 +39,17 @@ cd /path/to/jaeger-sls
go build
```

## Parameter Flag

(TODO)

## Start

(TODO)
Executing the following command to start jaeger with Tenon Plugin
```shell
export ACCESS_KEY_SECRET: ""
export ACCESS_KEY_ID: ""
export PROJECT: ""
export ENDPOINT: ""
export INSTANCE: ""
GRPC_STORAGE_PLUGIN_BINARY="./jaeger-sls" GRPC_STORAGE_PLUGIN_CONFIGURATION_FILE=./config.yaml SPAN_STORAGE_TYPE=grpc-plugin JAEGER_DISABLED=true GRPC_STORAGE_PLUGIN_LOG_LEVEL=DEBUG ./all-in-one
```

## License

Expand Down
5 changes: 5 additions & 0 deletions config.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ACCESS_KEY_SECRET: ""
ACCESS_KEY_ID: ""
PROJECT: ""
ENDPOINT: ""
INSTANCE: ""
128 changes: 128 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
version: '3.3'

services:
mysql:
image: mysql:5.6
ports:
- "3306:3306"
expose:
- 3306
networks:
- backend
restart: always
environment:
MYSQL_ROOT_PASSWORD: "mysqlpwd"
TZ: "Asia/Shanghai"
volumes:
- "./examples/database.sql:/docker-entrypoint-initdb.d/database.sql"

jaeger:
build: .
networks:
- backend
ports:
- "6831:6831"
- "6832:6832"
- "5778:5778"
- "16686:16686"
- "14268:14268"
- "14250:14250"
environment:
TZ: "Asia/Shanghai"
ACCESS_KEY_SECRET: ""
ACCESS_KEY_ID: ""
PROJECT: ""
ENDPOINT: ""
INSTANCE: ""

tracing-poc:
image: iqfarhad/medium-poc_tracing:latest
ports:
- "8080:8080"
networks:
- backend
restart: always
environment:
PORT: ":8080"
DEBUG: "true"
TRACING_OPTION: "otel-collector"
OTEL_EXPORTER_OTLP_ENDPOINT: "otel-agent:4317"
MYSQL_URL: "root:mysqlpwd@tcp(mysql:3306)/sampleDB"
JAEGER_AGENT_NAME: "jaeger"
JAEGER_AGENT_PORT: "5775"
JAEGER_COLLECTOR_URL: "http://jaeger:14268/api/traces"
QUERYYER_URL: "http://tracing-queryyer:8081/getPerson/"
FORMATTER_URL: "http://tracing-formatter:8082/formatGreeting?"
TZ: "Asia/Shanghai"
entrypoint: "/go/bin/tracing-poc"
depends_on:
- otel-collector
- mysql
- tracing-queryyer

tracing-queryyer:
image: iqfarhad/medium-poc_tracing:latest
networks:
- backend
restart: always
environment:
PORT: ":8081"
DEBUG: "true"
TRACING_OPTION: "otel-collector"
OTEL_EXPORTER_OTLP_ENDPOINT: "otel-agent:4317"
JAEGER_AGENT_NAME: "jaeger"
JAEGER_AGENT_PORT: "5775"
MYSQL_URL: "root:mysqlpwd@tcp(mysql:3306)/sampleDB"
JAEGER_COLLECTOR_URL: "http://jaeger:14268/api/traces"
TZ: "Asia/Shanghai"
entrypoint: "/go/bin/queryyer"
depends_on:
- otel-collector

tracing-formatter:
image: iqfarhad/medium-poc_tracing:latest
networks:
- backend
restart: always
environment:
PORT: ":8082"
DEBUG: "true"
TRACING_OPTION: "otel-collector"
OTEL_EXPORTER_OTLP_ENDPOINT: "otel-agent:4317"
JAEGER_AGENT_NAME: "jaeger"
JAEGER_AGENT_PORT: "5775"
MYSQL_URL: "root:mysqlpwd@tcp(mysql:3306)/sampleDB"
JAEGER_COLLECTOR_URL: "http://jaeger:14268/api/traces"
TZ: "Asia/Shanghai"
entrypoint: "/go/bin/formatter"
depends_on:
- otel-collector

otel-agent:
image: otel/opentelemetry-collector:latest
command: [ "--config=/etc/otel-agent-config.yaml", "--log-level=DEBUG" ]
volumes:
- ./examples/config-agent.yaml:/etc/otel-agent-config.yaml
ports:
- "1777:1777"
- "55679:55679"
- "13133"
- "4317:4317"
- "55681:55681"
networks:
- backend
environment:
TZ: "Asia/Shanghai"

otel-collector:
image: otel/opentelemetry-collector:latest
command: [ "--config=/etc/otel-collector-config.yaml", "--log-level=DEBUG" ]
volumes:
- ./examples/config-collector.yaml:/etc/otel-collector-config.yaml
networks:
- backend
environment:
TZ: "Asia/Shanghai"

networks:
backend:
29 changes: 29 additions & 0 deletions examples/config-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
extensions:
health_check:

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:55681

processors:
batch/traces:
timeout: 1s
send_batch_size: 50

exporters:
otlp:
endpoint: otel-collector:4317
insecure: true

service:
pipelines:
traces:
receivers: [otlp]
processors: [batch/traces]
exporters: [otlp]

extensions: [health_check]
21 changes: 21 additions & 0 deletions examples/config-collector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317

exporters:
jaeger:
endpoint: "jaeger:14250"
insecure: true

processors:
batch:


service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [jaeger]
18 changes: 18 additions & 0 deletions examples/database.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE DATABASE IF NOT EXISTS sampleDB;

USE sampleDB;

CREATE TABLE IF NOT EXISTS sampleDB.people (
name VARCHAR(100),
title VARCHAR(10),
description VARCHAR(100),
PRIMARY KEY (name)
);

DELETE FROM sampleDB.people;

INSERT INTO sampleDB.people VALUES ('EQ', 'Tech', 'Where are the cakes?');
INSERT INTO sampleDB.people VALUES ('Farhad', 'Dr.', 'Why ... why are you so nice?');
INSERT INTO sampleDB.people VALUES ('Sonos', 'Mr.', 'you are so loud!');
INSERT INTO sampleDB.people VALUES ('Margo', 'Ms.', 'Privet!');
INSERT INTO sampleDB.people VALUES ('Trace', 'Mr.', 'This is so cool!');
8 changes: 6 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module github.com/qiansheng91/jaeger-sls
module github.com/aliyun/aliyun-log-jaeger

go 1.16

require (
github.com/aliyun/aliyun-log-go-sdk v0.1.21
github.com/gogo/protobuf v1.3.2
github.com/hashicorp/go-hclog v0.16.2
github.com/jaegertracing/jaeger v1.24.0
github.com/spf13/cast v1.3.1
github.com/spf13/viper v1.8.1
)

replace . => github.com/qiansheng91/jaeger-sls v0.0.0-20210803014446-26eb89a251e1
replace github.com/aliyun/aliyun-log-jaeger => ./
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,9 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o=
github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
Expand Down
Binary file added images/create_project.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/create_trace_instance.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/havingfun.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/modify_configure.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/start_demos.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 13424e6

Please sign in to comment.