Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ public static IResourceBuilder<OpenTelemetryCollectorResource> AddOpenTelemetryC
$@"--config=yaml:receivers::otlp::protocols::grpc::tls::key_file: ""{certKeyPath}""");
}
}

if (!settings.DisableHealthcheck)
{
const int healthPort = 13233;
resourceBuilder.WithEndpoint(targetPort: healthPort, name: "health", scheme: "http")
.WithHttpHealthCheck("/health", endpointName: "health")
.WithArgs(
"--feature-gates=confmap.enableMergeAppendOption",
$"--config=yaml:extensions::health_check/aspire::endpoint: 0.0.0.0:{healthPort}",
"--config=yaml:service::extensions: [ health_check/aspire ]"
);
}
return resourceBuilder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ public class OpenTelemetryCollectorSettings
/// Note: this will also setup SSL if Aspire is configured for HTTPS
/// </summary>
public bool EnableHttpEndpoint { get; set; } = true;

/// <summary>
/// Disable the healthcheck on the collector container
/// </summary>
public bool DisableHealthcheck { get; set; } = false;
}
Loading