feat: prometheus & grafana minimal setup
This commit is contained in:
parent
5b8880f392
commit
769d0bf21c
10 changed files with 122 additions and 55 deletions
|
@ -1,18 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Server.db: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
|
||||
<deployment type="docker-compose.yml">
|
||||
<settings>
|
||||
<option name="envFilePath" value="" />
|
||||
<option name="services">
|
||||
<list>
|
||||
<option value="db" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="sourceFilePath" value="Server/docker-compose.yml" />
|
||||
<option name="upDetach" value="false" />
|
||||
</settings>
|
||||
</deployment>
|
||||
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,17 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Server.server: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
|
||||
<deployment type="docker-compose.yml">
|
||||
<settings>
|
||||
<option name="envFilePath" value="" />
|
||||
<option name="services">
|
||||
<list>
|
||||
<option value="server" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="sourceFilePath" value="Server/docker-compose.yml" />
|
||||
</settings>
|
||||
</deployment>
|
||||
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,10 +1,10 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Server: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
|
||||
<configuration default="false" name="docker-compose.yml: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
|
||||
<deployment type="docker-compose.yml">
|
||||
<settings>
|
||||
<option name="buildKitEnabledForCompose" value="true" />
|
||||
<option name="envFilePath" value="" />
|
||||
<option name="sourceFilePath" value="Server/docker-compose.yml" />
|
||||
<option name="sourceFilePath" value="docker-compose.yml" />
|
||||
<option name="upDetach" value="false" />
|
||||
<option name="upRemoveOrphans" value="true" />
|
||||
</settings>
|
|
@ -1,3 +0,0 @@
|
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=decryptor/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Wonderking/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
|
@ -56,6 +56,7 @@ if (configuration.GetValue<bool>("Tracing:Enabled"))
|
|||
.WithMetrics(metrics =>
|
||||
{
|
||||
metrics.AddRuntimeInstrumentation();
|
||||
metrics.AddProcessInstrumentation();
|
||||
});
|
||||
|
||||
builder.Logging.AddOpenTelemetry(logging =>
|
||||
|
@ -70,19 +71,19 @@ if (configuration.GetValue<bool>("Tracing:Enabled"))
|
|||
{
|
||||
logging.AddOtlpExporter(options =>
|
||||
{
|
||||
options.Endpoint = new Uri(configuration["OTLP:Endpoint"] ?? string.Empty);
|
||||
options.Endpoint = new Uri(configuration["OTLP:Logging:Endpoint"] ?? string.Empty);
|
||||
});
|
||||
});
|
||||
builder.Services.ConfigureOpenTelemetryMeterProvider(metrics =>
|
||||
{
|
||||
metrics.AddOtlpExporter(options =>
|
||||
options.Endpoint = new Uri(configuration["OTLP:Endpoint"] ?? string.Empty));
|
||||
options.Endpoint = new Uri(configuration["OTLP:Metrics:Endpoint"] ?? string.Empty));
|
||||
});
|
||||
builder.Services.ConfigureOpenTelemetryTracerProvider(tracing =>
|
||||
{
|
||||
tracing.AddZipkinExporter(options =>
|
||||
options.Endpoint = new Uri(configuration["Zipkin:Endpoint"] ?? string.Empty));
|
||||
tracing.AddOtlpExporter(options => options.Endpoint = new Uri(configuration["OTLP:Endpoint"] ?? string.Empty));
|
||||
tracing.AddOtlpExporter(options => options.Endpoint = new Uri(configuration["OTLP:Tracing:Endpoint"] ?? string.Empty));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0-alpha.1"/>
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.8"/>
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.6.0-beta.3"/>
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="1.0.0-alpha.6" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1"/>
|
||||
<PackageReference Include="OpenTelemetry.PersistentStorage.FileSystem" Version="1.0.0"/>
|
||||
<PackageReference Include="OpenTelemetry.ResourceDetectors.Container" Version="1.0.0-beta.4"/>
|
||||
|
|
|
@ -14,7 +14,9 @@ services:
|
|||
- DB:Password=continuity
|
||||
- Game:Data:Path=/app/data/
|
||||
- Tracing:Enabled=true
|
||||
- OTLP:Endpoint=http://jaeger:4317
|
||||
- OTLP:Tracing:Endpoint=http://otel-collector:4317
|
||||
- OTLP:Logging:Endpoint=http://otel-collector:4317
|
||||
- OTLP:Metrics:Endpoint=http://otel-collector:4317
|
||||
- Zipkin:Endpoint=http://zipkin:9411/api/v2/spans
|
||||
networks:
|
||||
- continuity
|
||||
|
@ -22,17 +24,14 @@ services:
|
|||
- 10001:10001
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ../wk-data
|
||||
source: wk-data
|
||||
target: /app/data
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../wk-logs
|
||||
target: /app/logs
|
||||
read_only: false
|
||||
- type: bind
|
||||
source: ../config
|
||||
source: config
|
||||
target: /app/config
|
||||
read_only: true
|
||||
mem_limit: 100m
|
||||
|
||||
db:
|
||||
container_name: continuity-db
|
||||
|
@ -58,14 +57,12 @@ services:
|
|||
container_name: continuity-jaeger
|
||||
image: jaegertracing/all-in-one:1.51.0
|
||||
restart: always
|
||||
depends_on:
|
||||
- server
|
||||
- prometheus
|
||||
networks:
|
||||
- continuity
|
||||
expose:
|
||||
- 6831
|
||||
- 6832
|
||||
- 5778
|
||||
- 4317
|
||||
- 4318
|
||||
- 14250
|
||||
- 14268
|
||||
- 14269
|
||||
|
@ -73,6 +70,11 @@ services:
|
|||
- 16686:16686
|
||||
environment:
|
||||
- COLLECTOR_OTLP_ENABLED=true
|
||||
- METRICS_STORAGE_TYPE=prometheus
|
||||
- PROMETHEUS_SERVER_URL=http://prometheus:9090
|
||||
- PROMETHEUS_QUERY_SUPPORT_SPANMETRICS_CONNECTOR=true
|
||||
- PROMETHEUS_QUERY_NORMALIZE_CALLS=true
|
||||
- PROMETHEUS_QUERY_NORMALIZE_DURATION=true
|
||||
|
||||
zipkin:
|
||||
container_name: continuity-zipkin
|
||||
|
@ -83,9 +85,55 @@ services:
|
|||
networks:
|
||||
- continuity
|
||||
|
||||
prometheus:
|
||||
container_name: continuity-prometheus
|
||||
image: prom/prometheus:latest
|
||||
restart: always
|
||||
depends_on:
|
||||
- server
|
||||
ports:
|
||||
- 9090:9090
|
||||
volumes:
|
||||
- prom-data:/prometheus
|
||||
- ./otlp/prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
networks:
|
||||
- continuity
|
||||
|
||||
otel-collector:
|
||||
container_name: continuity-otel-collector
|
||||
image: otel/opentelemetry-collector-contrib:0.89.0
|
||||
restart: always
|
||||
depends_on:
|
||||
- prometheus
|
||||
ports:
|
||||
- 14278:14278
|
||||
- 4317:4317
|
||||
- 9091:9091
|
||||
volumes:
|
||||
- ./otlp/otel-config.yaml:/etc/otel-config.yaml
|
||||
command: [ "--config=/etc/otel-config.yaml" ]
|
||||
networks:
|
||||
- continuity
|
||||
|
||||
grafana:
|
||||
networks:
|
||||
- continuity
|
||||
image: grafana/grafana:latest
|
||||
depends_on:
|
||||
- prometheus
|
||||
volumes:
|
||||
- ./otlp/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml
|
||||
environment:
|
||||
- GF_AUTH_ANONYMOUS_ENABLED=true
|
||||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
|
||||
- GF_AUTH_DISABLE_LOGIN_FORM=true
|
||||
ports:
|
||||
- 3000:3000
|
||||
|
||||
networks:
|
||||
continuity:
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
prom-data:
|
||||
server-logs:
|
8
otlp/datasource.yml
Normal file
8
otlp/datasource.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
apiVersion: 1
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
url: http://prometheus:9090
|
||||
isDefault: true
|
||||
access: proxy
|
||||
editable: true
|
39
otlp/otel-config.yaml
Normal file
39
otlp/otel-config.yaml
Normal file
|
@ -0,0 +1,39 @@
|
|||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
http:
|
||||
jaeger:
|
||||
protocols:
|
||||
thrift_http:
|
||||
endpoint: otel-collector:14278
|
||||
|
||||
|
||||
exporters:
|
||||
prometheus:
|
||||
endpoint: otel-collector:9091
|
||||
zipkin:
|
||||
endpoint: "http://zipkin:9411/api/v2/spans"
|
||||
format: proto
|
||||
otlp:
|
||||
endpoint: jaeger:4317
|
||||
tls:
|
||||
insecure: true
|
||||
|
||||
processors:
|
||||
batch:
|
||||
|
||||
extensions:
|
||||
health_check:
|
||||
|
||||
service:
|
||||
extensions: [ health_check ]
|
||||
pipelines:
|
||||
traces:
|
||||
receivers: [ otlp, jaeger ]
|
||||
processors: [ batch ]
|
||||
exporters: [ otlp, zipkin ]
|
||||
metrics:
|
||||
receivers: [ otlp ]
|
||||
processors: [ batch ]
|
||||
exporters: [ prometheus ]
|
8
otlp/prometheus.yml
Normal file
8
otlp/prometheus.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'otel-collector'
|
||||
static_configs:
|
||||
- targets: [ 'otel-collector:9091' ]
|
Loading…
Reference in a new issue