Skip to content

Commit

Permalink
Merge pull request #83 from ZUOXIANGE/main
Browse files Browse the repository at this point in the history
OpenTelemetry support
  • Loading branch information
witskeeper authored Sep 20, 2024
2 parents dc51c60 + 418a788 commit 0dd8092
Show file tree
Hide file tree
Showing 19 changed files with 586 additions and 9 deletions.
1 change: 1 addition & 0 deletions docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATA_DIR=/data
114 changes: 114 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
version: '3.8'

services:

portainer:
image: portainer/portainer-ce
container_name: portainer_my
restart: always
ports:
- "9000:9000"
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${DATA_DIR}/portainer:/opt/portainer

openobserve:
container_name: openobserve
image: public.ecr.aws/zinclabs/openobserve:latest
restart: unless-stopped
environment:
ZO_ROOT_USER_EMAIL: "[email protected]"
ZO_ROOT_USER_PASSWORD: "test@123"
ports:
- "5080:5080"
- "5081:5081"
volumes:
- ${DATA_DIR}/openobserve/data:/data

otel-collector:
image: otel/opentelemetry-collector-contrib
restart: always
container_name: otel-collector
volumes:
- ${DATA_DIR}/otel-collector/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the Collector
- 8889:8889 # Prometheus exporter metrics
- 13133:13133 # health_check extension
- 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
- 55679:55679 # zpages extension

rabbitmq:
container_name: rabbitmq
image: heidiks/rabbitmq-delayed-message-exchange:latest
restart: always
volumes:
- ${DATA_DIR}/rabbitmq/data:/var/lib/rabbitmq
- ${DATA_DIR}/rabbitmq/log:/var/log/rabbitmq/log
ports:
- 4369:4369
- 25672:25672
- 15672:15672
- 5672:5672
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=test@123

mysql:
container_name: mysql
image: mysql:latest
restart: always
command: mysqld --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=test@123
- MYSQL_USER=admin
- MYSQL_PASS=admin@123
ports:
- '3306:3306'
volumes:
- ${DATA_DIR}/mysql/var/lib/mysql:/var/lib/mysql
- ${DATA_DIR}/mysql/my.cnf:/etc/mysql/conf.d/my.cnf

postgres:
container_name: pgsql
image: postgres:latest
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: test@123
ports:
- 5432:5432
volumes:
- ${DATA_DIR}/pgsql/data:/var/lib/postgresql/data

redis:
container_name: redis
image: redis:latest
restart: always
volumes:
- ${DATA_DIR}/redis/redis.conf:/usr/local/etc/redis/redis.conf
- ${DATA_DIR}/redis/data:/data
- ${DATA_DIR}/redis/logs:/logs
ports:
- 6379:6379
command: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"

rnacos:
container_name: rnacos
image: qingpan/rnacos:stable
restart: always
volumes:
- ${DATA_DIR}/nacos/io:/io:rw
ports:
- 8848:8848
- 9848:9848
- 10848:10848
environment:
- RNACOS_INIT_ADMIN_USERNAME=admin
- RNACOS_INIT_ADMIN_PASSWORD=test@123
- RNACOS_HTTP_PORT=8848
- RNACOS_GRPC_PORT=9848
- RNACOS_RAFT_NODE_ID=1
11 changes: 11 additions & 0 deletions docker/mysql/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[client]
default-character-set=utf8mb4

[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
default-time_zone = '+8:00'
sql_mode=""

[mysql]
default-character-set=utf8mb4
Empty file added docker/openobserve/.gitkeep
Empty file.
57 changes: 57 additions & 0 deletions docker/otel-collector/otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
http:
endpoint: "0.0.0.0:4318"
auth:
authenticator: basicauth/server

processors:
batch:
send_batch_size: 10000
timeout: 10s

queued_retry:
num_workers: 4
queue_size: 100
retry_on_failure: true

exporters:
otlphttp/openobserve:
endpoint: http://127.0.0.1:5080/api/default
headers:
Authorization: Basic YWRtaW5AZXhhbXBsZS5jb206ZFhQaDdzdlpPOWxaVGRPQw==
stream-name: default

otlp/openobserve:
endpoint: 127.0.0.1:5081
headers:
Authorization: "Basic YWRtaW5AZXhhbXBsZS5jb206ZFhQaDdzdlpPOWxaVGRPQw=="
organization: default
stream-name: default
tls:
insecure: true

extensions:
health_check: {}
basicauth/server:
htpasswd:
inline: admin:test@123 # Authorization=Basic YWRtaW46dGVzdEAxMjM=

service:
extensions: [health_check]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp/openobserve]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp/openobserve]
logs:
receivers: [otlp]
processors: [batch,queued_retry]
exporters: [otlphttp/openobserve]
Empty file added docker/pgsql/.gitkeep
Empty file.
Empty file added docker/portainer/.gitkeep
Empty file.
Empty file added docker/rabbitmq/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions docker/redis/redis.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requirepass test@123
Empty file added docker/rnacos/.gitkeep
Empty file.
7 changes: 7 additions & 0 deletions netcorepal-cloud-framework.sln
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCorePal.Extensions.Hangf
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCorePal.Extensions.DistributedTransactions.CAP.SqlServer", "src\DistributedTransactions.CAP.SqlServer\NetCorePal.Extensions.DistributedTransactions.CAP.SqlServer.csproj", "{C926EA21-8372-4494-87D2-05F6AF2CA44E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCorePal.OpenTelemetry.Diagnostics", "src\NetCorePal.OpenTelemetry.Diagnostics\NetCorePal.OpenTelemetry.Diagnostics.csproj", "{59BB1378-ABEE-4A1E-BF14-7C807F83C8E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -341,6 +343,10 @@ Global
{C926EA21-8372-4494-87D2-05F6AF2CA44E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C926EA21-8372-4494-87D2-05F6AF2CA44E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C926EA21-8372-4494-87D2-05F6AF2CA44E}.Release|Any CPU.Build.0 = Release|Any CPU
{59BB1378-ABEE-4A1E-BF14-7C807F83C8E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59BB1378-ABEE-4A1E-BF14-7C807F83C8E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59BB1378-ABEE-4A1E-BF14-7C807F83C8E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59BB1378-ABEE-4A1E-BF14-7C807F83C8E3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -401,6 +407,7 @@ Global
{ED4401A4-0B4B-4FF5-AEF3-55D5700A13FB} = {DB5A8331-2B57-4F2B-8F7D-02E167BCD8BB}
{664491B2-2001-4D42-8029-4EF4B1CDBEE6} = {605436C1-2560-47BA-99D4-7A80B628230F}
{C926EA21-8372-4494-87D2-05F6AF2CA44E} = {12EE5383-F550-4070-9362-B5C1000D3DF3}
{59BB1378-ABEE-4A1E-BF14-7C807F83C8E3} = {605436C1-2560-47BA-99D4-7A80B628230F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D46201E5-1E3C-47A0-8584-4ACCC135CF9A}
Expand Down
Loading

0 comments on commit 0dd8092

Please sign in to comment.