Class NeonServiceOptions
Optionally passed to the NeonService constructor to specify additional service related options.
Namespace: Neon.Service
Assembly: Neon.Service.dll
Syntax
public class NeonServiceOptions
Constructors
NeonServiceOptions()
Default constructor.
Declaration
public NeonServiceOptions()
Properties
AppendGitInfo
Indicates that the current git branch name and commit should be appended
to the service version passed to the NeonService constructor.
This defaults to true
.
note
This is ignored when your project is not using git for source control.
Declaration
public bool AppendGitInfo { get; set; }
Property Value
Type | Description |
---|---|
bool |
EnvironmentVariableDotReplacement
Optionally specifies the character to use to replace dots (.) in environment variable names.
Declaration
public string EnvironmentVariableDotReplacement { get; set; }
Property Value
Type | Description |
---|---|
string |
EnvironmentVariablePrefix
Optionally specifies the prefix to use for environment variables that will be loaded into configuration.
Declaration
public string EnvironmentVariablePrefix { get; set; }
Property Value
Type | Description |
---|---|
string |
GracefulShutdownTimeout
Optionally specifies the termination timeout (defaults to DefaultGracefulTimeout).
See ProcessTerminator for more information.
Declaration
public TimeSpan GracefulShutdownTimeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
HealthFolder
Optionally specifies the folder path where the service will maintain the health-status file and deploy the health-check and ready-check binaries. See the class documentation for more information: Neon.Service.
This defaults to: / to make it easy to configure the Kubernetes probes. You can disable this feature by passing "DISABLED" instead.
note
Health status generation only works on Linux. This feature is dsabled on Windows and OS/X.
Declaration
public string HealthFolder { get; set; }
Property Value
Type | Description |
---|---|
string |
LogEnrichers
Optionally specifies log enrichers to add to the Logging pipeline.
Declaration
public IEnumerable<ILogEnricher> LogEnrichers { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<ILogEnricher> |
LoggerFactory
Optionally specifies the ILoggerFactory the service will use for logging purposes.
When set to null
(the default), the NeonService class will configure
the OpenTelemetry logging pipeline and configure a logger factory for the service and NEONSDK libraries.
You can set this when you need a completely custom logging configuration.
Declaration
public ILoggerFactory LoggerFactory { get; set; }
Property Value
Type | Description |
---|---|
ILoggerFactory |
MinShutdownTime
Optionally specifies the minimum time to wait before allowing termination to proceed. This defaults to DefaultMinShutdownTime. See ProcessTerminator for more information.
Declaration
public TimeSpan MinShutdownTime { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
ServiceMap
Optionally specifies a service map describing this service and potentially other services. Service maps can be used to run services locally on developer workstations via Neon.Xunit.NeonServiceFixture or other means to avoid port conflicts or to emulate a cluster of services without Kubernetes or containers. This is a somewhat advanced topic that needs documentation.
note
ServiceMap is a somewhat dated concept that doesn't make a lot of sense in the Kubernetes world. We recommend that new code avoid this.
Declaration
public ServiceMap ServiceMap { get; set; }
Property Value
Type | Description |
---|---|
ServiceMap |
TerminationMessagePath
Optionally specifies the path where Kubernetes may write a termination message before terminating the pod hosting the message. The NeonService class will check for this file when it receives a termination signal when running on Linux and write the file contents to the log before terminating.
This defaults to: /dev/termination-log
note
This is ignored for all platforms besides Linux.
Declaration
public string TerminationMessagePath { get; set; }
Property Value
Type | Description |
---|---|
string |
TracerProvider
Optionally specifies the TracerProvider the service will use for tracing purposes.
When set to null
(the default), the NeonService class will configure the
tracing pipeline for the service and NEONSDK libraries.
You can set this when you need a completely custom tracing configuration.
Declaration
public TracerProvider TracerProvider { get; set; }
Property Value
Type | Description |
---|---|
TracerProvider |