Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
0GiS0 committed Dec 18, 2023
2 parents 9491fc7 + f4ab710 commit c019be3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
32 changes: 25 additions & 7 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
version: '3'
version: "3.5"

services:
app:
build:
# build:
# context: .
# dockerfile: Dockerfile
build:
context: .
dockerfile: Dockerfile

volumes:
- ../..:/workspaces:cached

Expand All @@ -15,10 +17,10 @@ services:
environment:
OTEL_SERVICE_NAME: tour-of-heroes-api
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317
OTEL_EXPORTER_JAEGER_ENDPOINT: http://jaeger:14268/api/traces
OTEL_EXPORTER_JAEGER_AGENT_HOST: jaeger
OTEL_EXPORTER_JAEGER_AGENT_PORT: 6831
APPLICATIONINSIGHTS_CONNECTION_STRING: <INSTRUMENTATION_KEY>
# OTEL_EXPORTER_JAEGER_ENDPOINT: http://jaeger:14268/api/traces
# OTEL_EXPORTER_JAEGER_AGENT_HOST: jaeger
# OTEL_EXPORTER_JAEGER_AGENT_PORT: 6831
# APPLICATIONINSIGHTS_CONNECTION_STRING: <INSTRUMENTATION_KEY>
ports:
- "127.0.0.1:5010:5010"

Expand Down Expand Up @@ -91,5 +93,21 @@ services:
depends_on:
- jaeger

fake-calls:
image: alpine/curl:latest
entrypoint:
- /bin/sh
- -c
- |
sleep 5
while true; do
curl -s "http://app:5010/api/hero" || true
sleep 0.5
done
networks:
- observability
depends_on:
- app

networks:
observability:
12 changes: 5 additions & 7 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
resourceBuilder.AddService(builder.Configuration["OTEL_SERVICE_NAME"]);
options.SetResourceBuilder(resourceBuilder);

options.AddConsoleExporter();
// options.AddConsoleExporter();

// options.AddOtlpExporter();
options.AddOtlpExporter();

});

Expand All @@ -51,19 +51,17 @@
tracing.AddHttpClientInstrumentation();
// tracing.AddSqlClientInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation();
tracing.AddConsoleExporter();
// tracing.AddOtlpExporter();
// tracing.AddConsoleExporter();
tracing.AddOtlpExporter();
})
.WithMetrics(metrics =>
{
metrics.AddAspNetCoreInstrumentation();
metrics.AddHttpClientInstrumentation();
metrics.AddProcessInstrumentation();
metrics.AddRuntimeInstrumentation();
metrics.AddConsoleExporter();
// metrics.AddConsoleExporter();
metrics.AddPrometheusExporter();

// metrics.AddOtlpExporter();
});

builder.Services.Configure<AspNetCoreInstrumentationOptions>(options =>
Expand Down

0 comments on commit c019be3

Please sign in to comment.