mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-01 19:12:57 +00:00
feat: Add Kubernetes config and ef otlp
This commit is contained in:
parent
0f5534ffe6
commit
273a7222d7
@ -27,6 +27,7 @@
|
|||||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
|
||||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
|
||||||
|
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.12" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
|
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||||
|
@ -91,6 +91,7 @@ builder.Services
|
|||||||
.WithTracing(tracing =>
|
.WithTracing(tracing =>
|
||||||
{
|
{
|
||||||
tracing
|
tracing
|
||||||
|
.AddEntityFrameworkCoreInstrumentation()
|
||||||
.AddHttpClientInstrumentation()
|
.AddHttpClientInstrumentation()
|
||||||
.AddAspNetCoreInstrumentation()
|
.AddAspNetCoreInstrumentation()
|
||||||
.AddSource(MassTransit.Logging.DiagnosticHeaders.DefaultListenerName);
|
.AddSource(MassTransit.Logging.DiagnosticHeaders.DefaultListenerName);
|
||||||
|
@ -10,6 +10,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
seq:
|
||||||
|
condition: service_started
|
||||||
redis:
|
redis:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
@ -22,8 +24,9 @@ services:
|
|||||||
- Kestrel__Endpoints__Grpc__Url=http://+:8080
|
- Kestrel__Endpoints__Grpc__Url=http://+:8080
|
||||||
- Kestrel__Endpoints__Grpc__Protocols=Http2
|
- Kestrel__Endpoints__Grpc__Protocols=Http2
|
||||||
- ConnectionStrings__DefaultConnection=Server=db;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#
|
- ConnectionStrings__DefaultConnection=Server=db;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#
|
||||||
- OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:5341/ingest/otlp/v1/traces
|
- OTEL_EXPORTER_OTLP_ENDPOINT=http://seq:5341/ingest/otlp/v1/traces
|
||||||
- OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
- OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
||||||
|
- Serilog__WriteTo__1__Args__serverUrl=http://seq:5341
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "--fail", "http://localhost/healthz"]
|
test: ["CMD", "curl", "--fail", "http://localhost/healthz"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
@ -42,4 +42,10 @@ spec:
|
|||||||
- name: Kestrel__Endpoints__Grpc__Protocols
|
- name: Kestrel__Endpoints__Grpc__Protocols
|
||||||
value: Http2
|
value: Http2
|
||||||
- name: ConnectionStrings__DefaultConnection
|
- name: ConnectionStrings__DefaultConnection
|
||||||
value: Server=sql-server;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#
|
value: Server=sql-server;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#
|
||||||
|
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
||||||
|
value: http://seq:5341/ingest/otlp/v1/traces
|
||||||
|
- name: OTEL_EXPORTER_OTLP_PROTOCOL
|
||||||
|
value: http/protobuf
|
||||||
|
- name: Serilog__WriteTo__1__Args__serverUrl
|
||||||
|
value: http://seq:5341
|
47
k8s-deployments/seq.yml
Normal file
47
k8s-deployments/seq.yml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: seq
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: seq
|
||||||
|
ports:
|
||||||
|
- name: seq
|
||||||
|
protocol: TCP
|
||||||
|
port: 5341
|
||||||
|
targetPort: 5341
|
||||||
|
- name: seq-frontend
|
||||||
|
protocol: TCP
|
||||||
|
port: 8081
|
||||||
|
targetPort: 80
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: seq-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: seq
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: seq
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: seq
|
||||||
|
image: datalust/seq:latest
|
||||||
|
env:
|
||||||
|
- name: ACCEPT_EULA
|
||||||
|
value: "y"
|
||||||
|
ports:
|
||||||
|
- containerPort: 5341
|
||||||
|
- containerPort: 80
|
||||||
|
volumeMounts:
|
||||||
|
- name: seq-data
|
||||||
|
mountPath: /data
|
||||||
|
volumes:
|
||||||
|
- name: seq-data
|
||||||
|
emptyDir: {}
|
Loading…
Reference in New Issue
Block a user