Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
warning-explosive committed Mar 28, 2023
1 parent e825094 commit aa80a1c
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.1
image: postgres:15.1-alpine
env:
POSTGRES_PASSWORD: Password12!
options: >-
Expand All @@ -32,7 +32,7 @@ jobs:
ports:
- 5432:5432
rabbit_mq:
image: rabbitmq:3.11.9-management
image: rabbitmq:3.11.11-management-alpine
ports:
- 5672:5672
- 15672:15672
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private static async Task PersistInbox(

await databaseContext
.Insert(new[] { inbox }, EnInsertBehavior.DoNothing)
.CachedExpression("98696B21-1D0D-416B-9A39-AFA6AFB16A0A")
.CachedExpression($"{nameof(PersistInbox)}:{inbox.Message.Headers.Count}")
.Invoke(token)
.ConfigureAwait(false);
}
Expand Down
2 changes: 0 additions & 2 deletions Endpoints/GenericEndpoint/Pipeline/0_TracingMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ namespace SpaceEngineers.Core.GenericEndpoint.Pipeline;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using AutoRegistration.Api.Abstractions;
using AutoRegistration.Api.Attributes;
using AutoRegistration.Api.Enumerations;
using Contract.Abstractions;
using Endpoint;
using Messaging;
using Messaging.MessageHeaders;
Expand Down
1 change: 1 addition & 0 deletions Tests/GenericHost.Test/BuildHostTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ static void CheckTransport(IHost host, Action<string> log)

var expectedUserScopeProviders = new[]
{
typeof(TraceContextPropagationProvider),
typeof(ConversationIdProvider),
typeof(MessageInitiatorProvider),
typeof(MessageOriginProvider),
Expand Down

This file was deleted.

This file was deleted.

67 changes: 49 additions & 18 deletions Tests/Test.WebApplication/ComposeSettings/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,53 @@
}
},
"AllowedHosts": "*",
"SqlDatabaseSettings": {
"Host": "postgres",
"Port": 5432,
"Database": "WebApplicationDatabase",
"Username": "postgres",
"Password": "Password12!",
"IsolationLevel": "ReadCommitted",
"ConnectionPoolSize": 1
},
"GenericEndpointSettings": {
"RpcRequestSecondsTimeout": 60
},
"OrmSettings": {
"CommandSecondsTimeout": 60
},
"OutboxSettings": {
"OutboxDeliverySecondsInterval": 60
"Endpoints":{
"TransportEndpointGateway": {
"GenericEndpointSettings": {
"RpcRequestSecondsTimeout": 60
},
"RabbitMqSettings": {
"Hosts": [
"rabbit"
],
"Port": "5672",
"HttpApiPort": "15672",
"User": "guest",
"Password": "guest",
"VirtualHost": "WebApplication",
"ApplicationName": "WebApplication",
"ConsumerPrefetchCount": 100,
"QueueMaxLengthBytes": 1048576,
"ConsumerPriority": 0
}
},
"AuthEndpoint": {
"Authorization": {
"Issuer": "Test",
"Audience": "Test",
"PrivateKey": "db3OIsj+BXE9NZDy0t8W3TcNekrF+2d/1sFnWG4HnV8TZY30iTOdtVWJG8abWvB1GlOgJuQZdcF2Luqm/hccMw=="
},
"AuthorizationSettings": {
"TokenExpirationMinutesTimeout": 5
},
"GenericEndpointSettings": {
"RpcRequestSecondsTimeout": 60
},
"OrmSettings": {
"CommandSecondsTimeout": 60
},
"OutboxSettings": {
"OutboxDeliverySecondsInterval": 60
},
"SqlDatabaseSettings": {
"Host": "postgres",
"Port": 5432,
"Database": "WebApplication",
"IsolationLevel": "ReadCommitted",
"Username": "postgres",
"Password": "Password12!",
"ConnectionPoolSize": 1
}
}
}
}
}
49 changes: 26 additions & 23 deletions docker-compose-webtest.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
version: '3'
services:

# PostgreSql
postgres:
image: postgres:15.1-alpine
container_name: postgres
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=Password12!
ports:
- '5432:5432'

# RabbitMQ
rabbit:
image: rabbitmq:3.11.11-management-alpine
container_name: rabbit
restart: unless-stopped
ports:
- '15672:15672'
- '5672:5672'

# Jaeger
jaeger:
image: jaegertracing/all-in-one:1.43.0
environment:
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
- COLLECTOR_OTLP_ENABLED=true
container_name: jaeger
restart: unless-stopped
ports:
- '5778:5778' # serve configs (sampling, etc.)
- '16686:16686' # serve frontend
- '14250:14250' # accept model.proto

# OpenTelemetry collector
otel-collector:
image: otel/opentelemetry-collector:0.74.0
container_name: otel-collector
command: [ --config=/etc/otel-collector-config.yaml ]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- 6831:6831/udp # accept jaeger.thrift over Thrift-compact protocol
- 6832:6832/udp # accept jaeger.thrift over Thrift-binary protocol
- 5778:5778 # serve configs (sampling, etc.)
- 16686:16686 # serve frontend
- 4317:4317 # accept OpenTelemetry Protocol (OTLP) over gRPC, if enabled
- 4318:4318 # accept OpenTelemetry Protocol (OTLP) over HTTP, if enabled
- 14250:14250 # accept model.proto
- 14268:14268 # accept jaeger.thrift directly from clients
- 14269:14269 # ???
- 9411:9411 # Zipkin compatible endpoint (optional)
web-app:
- '13133:13133' # health_check extension
- '4317:4317' # OTLP gRPC receiver
- '4318:4318' # OTLP http receiver
depends_on:
- postgres
- rabbit
- jaeger
build:
dockerfile: Dockerfile.webtest
context: .
restart: unless-stopped
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- '5000:80'
- jaeger
30 changes: 30 additions & 0 deletions otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
extensions:
memory_ballast:
size_mib: 512

receivers:
otlp:
protocols:
grpc:
http:

processors:
batch:
memory_limiter:
limit_mib: 1024
spike_limit_mib: 512
check_interval: 5s

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

service:
extensions: [memory_ballast]
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [jaeger]

0 comments on commit aa80a1c

Please sign in to comment.